(menu_status, Name, Tips)
| 119 | |
| 120 | // 菜单开关 |
| 121 | function menu_switch(menu_status, Name, Tips) { |
| 122 | if (menu_status == 'true') { |
| 123 | GM_setValue(`${Name}`, false); |
| 124 | if (Name == 'menu_refreshCorrection') { |
| 125 | GM_notification({text: `已关闭 [${Tips}] 功能`, timeout: 3500}); |
| 126 | } else { |
| 127 | GM_notification({text: `已关闭 [${Tips}] 功能\n(点击刷新网页后生效)`, timeout: 3500, onclick: function(){location.reload();}}); |
| 128 | } |
| 129 | } else { |
| 130 | GM_setValue(`${Name}`, true); |
| 131 | if (Name == 'menu_refreshCorrection') { |
| 132 | GM_notification({text: `已开启 [${Tips}] 功能`, timeout: 3500}); |
| 133 | } else { |
| 134 | GM_notification({text: `已开启 [${Tips}] 功能\n(点击刷新网页后生效)`, timeout: 3500, onclick: function(){location.reload();}}); |
| 135 | } |
| 136 | } |
| 137 | registerMenuCommand(); // 重新注册脚本菜单 |
| 138 | }; |
| 139 | |
| 140 | // 返回菜单值 |
| 141 | function menu_value(menuName) { |
no test coverage detected