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

Function addCopyButtonEvent2

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

Source from the content-addressed store, hash-verified

68 }
69 }
70 function addCopyButtonEvent2() {
71 let ip = new Array();
72 document.querySelectorAll('span.select-all > a[href]').forEach(function(_this) {
73 let img = findParentElement(_this, 'TR').querySelector('img.max-w-none');
74 if (img) {if (img.alt != 'CN Flag') ip.push(_this.innerText);}
75 })
76 if (ip.length > 0) {
77 if (GM_getValue('menu_separator')) {
78 GM_setClipboard(unique(ip).toString().replaceAll(',','\n'), 'text');
79 } else {
80 GM_setClipboard(unique(ip).toString(), 'text');
81 }
82 }
83 }
84
85
86 // 清理链接(可以直接点击复制单个 IP)

Callers

nothing calls this directly

Calls 2

uniqueFunction · 0.85
findParentElementFunction · 0.70

Tested by

no test coverage detected