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

Function menu_switch

Hostloc-Enhanced.user.js:66–75  ·  view source on GitHub ↗
(menu_status, Name, Tips)

Source from the content-addressed store, hash-verified

64 }
65 // 菜单开关
66 function menu_switch(menu_status, Name, Tips) {
67 if (menu_status == 'true') {
68 GM_setValue(`${Name}`, false);
69 GM_notification({ text: `已关闭 [${Tips}] 功能\n(点击刷新网页后生效)`, timeout: 3500, onclick: function () { location.reload(); } });
70 } else {
71 GM_setValue(`${Name}`, true);
72 GM_notification({ text: `已开启 [${Tips}] 功能\n(点击刷新网页后生效)`, timeout: 3500, onclick: function () { location.reload(); } });
73 }
74 registerMenuCommand(); // 重新注册脚本菜单
75 };
76 // 返回菜单值
77 function menu_value(menuName) {
78 for (let menu of menu_ALL) {

Callers 1

registerMenuCommandFunction · 0.70

Calls 1

registerMenuCommandFunction · 0.70

Tested by

no test coverage detected