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

Function menu_switch

DarkMode.user.js:320–332  ·  view source on GitHub ↗
(menu_status, Name, Tips)

Source from the content-addressed store, hash-verified

318
319 // 菜单开关
320 function menu_switch(menu_status, Name, Tips) {
321 if (menu_status == 'true'){
322 GM_setValue(`${Name}`, false);
323 GM_notification({text: `已关闭 [${Tips}] 功能\n(点击刷新网页后生效)`, timeout: 3500, onclick: function(){location.reload();}});
324 }else{
325 GM_setValue(`${Name}`, true);
326 GM_notification({text: `已开启 [${Tips}] 功能\n(点击刷新网页后生效)`, timeout: 3500, onclick: function(){location.reload();}});
327 }
328 if (Name === 'menu_autoRecognition') {
329 location.reload(); // 刷新网页
330 }
331 registerMenuCommand(); // 重新注册脚本菜单
332 };
333
334
335 // 返回菜单值

Callers 1

registerMenuCommandFunction · 0.70

Calls 1

registerMenuCommandFunction · 0.70

Tested by

no test coverage detected