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

Function registerMenuCommand

Ping.Sx-Enhanced.user.js:32–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 if (GM_getValue('menu_separator') == null){GM_setValue('menu_separator', true)};
31 registerMenuCommand();
32 function registerMenuCommand() {
33 if (menu_separator_ID) GM_unregisterMenuCommand(menu_separator_ID);
34 menu_separator_ID = GM_registerMenuCommand(`🔁 当前复制 IP 分隔方式为:${GM_getValue('menu_separator')?'[一行一个]':'[逗号分隔]'}`, function(){GM_setValue('menu_separator', !GM_getValue('menu_separator'));registerMenuCommand();}, {title: '点击可切换:当前复制 IP 的分隔方式为 [一行一个](默认) 或 [逗号分隔],切换后立即生效。'})
35 }
36 // 站长之家
37 // let ip = new Array(); document.querySelectorAll('[name=ip]>a').forEach(function(_this) {ip.push(_this.innerText);});console.log(Array.from(new Set(ip)).sort().toString().replaceAll(',','\n'))
38

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected