MCPcopy Create free account
hub / github.com/XIU2/UserScript / promptCustomUrl

Function promptCustomUrl

GithubEnhanced-High-Speed-Download.user.js:145–151  ·  view source on GitHub ↗
(index = 0)

Source from the content-addressed store, hash-verified

143 ];
144 // 递归弹出输入框
145 function promptCustomUrl(index = 0) {
146 if (index >= customKeys.length) {GM_notification({ text: '自定义加速源设置已完成!\n(点击刷新网页后生效)', timeout: 3500, onclick: function () { location.reload(); } });return;}
147 const { key, desc, placeholder } = customKeys[index];
148 let current = GM_getValue(key, '');
149 let input = prompt(`请输入自定义${desc}地址:\n- 当前:\n${current || '(未设置)'}\n\n- 示例:\n${placeholder}\n\n- 留空为不设置\n- 点击 [确定] 保存 并 继续设置下一个\n- 点击 [取消] 不保存 并 终止后续设置`,current);
150 if (input !== null) {GM_setValue(key, input.trim());promptCustomUrl(index + 1);}// 如果用户点击 取消 按钮,则不再继续弹出
151 }
152 promptCustomUrl();
153 });
154 menu_feedBack_ID = GM_registerMenuCommand('💬 反馈 & 建议 [Github]', function () {window.GM_openInTab('https://github.com/XIU2/UserScript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/412245/feedback', {active: true,insert: true,setParent: true});});

Callers 1

registerMenuCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected