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

Function menu_switch

3dm-Enhanced.user.js:50–59  ·  view source on GitHub ↗
(menu_status, Name, Tips)

Source from the content-addressed store, hash-verified

48
49 // 菜单开关
50 function menu_switch(menu_status, Name, Tips) {
51 if (menu_status == 'true'){
52 GM_setValue(`${Name}`, false);
53 GM_notification({text: `已关闭 [${Tips}] 功能\n(点击刷新网页后生效)`, timeout: 3500, onclick: function(){location.reload();}});
54 }else{
55 GM_setValue(`${Name}`, true);
56 GM_notification({text: `已开启 [${Tips}] 功能\n(点击刷新网页后生效)`, timeout: 3500, onclick: function(){location.reload();}});
57 }
58 registerMenuCommand(); // 重新注册脚本菜单
59 };
60
61 // 返回菜单值
62 function menu_value(menuName) {

Callers 1

registerMenuCommandFunction · 0.70

Calls 1

registerMenuCommandFunction · 0.70

Tested by

no test coverage detected