(menu_status, Name, Tips)
| 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 | // 返回菜单值 |
no test coverage detected