MCPcopy Index your code
hub / github.com/XIU2/UserScript / menu_switch

Function menu_switch

Zhihu-Enhanced.user.js:108–117  ·  view source on GitHub ↗
(menu_status, Name, Tips)

Source from the content-addressed store, hash-verified

106
107// 菜单开关
108function menu_switch(menu_status, Name, Tips) {
109 if (menu_status == 'true'){
110 GM_setValue(`${Name}`, false);
111 GM_notification({text: `已关闭 [${Tips}] 功能\n(点击刷新网页后生效)`, timeout: 3500, onclick: function(){location.reload();}});
112 }else{
113 GM_setValue(`${Name}`, true);
114 GM_notification({text: `已开启 [${Tips}] 功能\n(点击刷新网页后生效)`, timeout: 3500, onclick: function(){location.reload();}});
115 }
116 registerMenuCommand(); // 重新注册脚本菜单
117};
118
119
120// 返回菜单值

Callers 1

registerMenuCommandFunction · 0.70

Calls 1

registerMenuCommandFunction · 0.70

Tested by

no test coverage detected