()
| 29 | |
| 30 | // 注册脚本菜单 |
| 31 | function registerMenuCommand() { |
| 32 | var menu_streamline_; |
| 33 | if (menu_feedBack_ID){ // 如果反馈菜单ID不是 null,则删除所有脚本菜单 |
| 34 | GM_unregisterMenuCommand(menu_streamline_ID); |
| 35 | GM_unregisterMenuCommand(menu_feedBack_ID); |
| 36 | menu_streamline = GM_getValue('xiu2_menu_streamline'); |
| 37 | } |
| 38 | |
| 39 | if (menu_streamline){menu_streamline_ = "√";}else{menu_streamline_ = "×";} |
| 40 | |
| 41 | menu_streamline_ID = GM_registerMenuCommand(`[ ${menu_streamline_} ] 精简美化`, function(){menu_switch(menu_streamline,'xiu2_menu_streamline','精简美化')}); |
| 42 | menu_feedBack_ID = GM_registerMenuCommand('反馈 & 建议', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});}); |
| 43 | } |
| 44 | |
| 45 | // 菜单开关 |
| 46 | function menu_switch(menu_status, Name, Tips) { |
no test coverage detected