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

Function menu_toggle_raw_fast

GithubEnhanced-High-Speed-Download.user.js:158–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156
157 // 切换加速源
158 function menu_toggle_raw_fast() {
159 // 如果当前加速源位置大于等于加速源总数,则改为第一个加速源,反之递增下一个加速源
160 if (menu_rawFast >= raw_url.length - 1) {menu_rawFast = 0;} else {menu_rawFast += 1;}
161 GM_setValue('xiu2_menu_raw_fast', menu_rawFast);
162 delRawDownLink(); // 删除旧加速源
163 addRawDownLink(); // 添加新加速源
164 GM_notification({text: "已切换加速源为:" + raw_url[menu_rawFast][1], timeout: 3000}); // 提示消息
165 registerMenuCommand(); // 重新注册脚本菜单
166 };
167
168 colorMode(); // 适配白天/夜间主题模式
169 setTimeout(addRawFile, 1000); // Raw 加速

Callers

nothing calls this directly

Calls 3

delRawDownLinkFunction · 0.85
addRawDownLinkFunction · 0.85
registerMenuCommandFunction · 0.70

Tested by

no test coverage detected