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

Function cleanLinks

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

Source from the content-addressed store, hash-verified

85
86 // 清理链接(可以直接点击复制单个 IP)
87 function cleanLinks() {
88 const callback = (mutationsList, observer) => {
89 for (const mutation of mutationsList) {
90 for (const target of mutation.addedNodes) {
91 if (target.nodeType != 1) return
92 if (target.tagName === 'TD' && target.className.indexOf('w-4/12') > -1) {
93 target.querySelectorAll('span.select-all > a[href]').forEach(function(_this) {
94 _this.href = 'javascript:void(0);';
95 _this.target = '_self';
96 })
97 }
98 }
99 }
100 };
101 const observer = new MutationObserver(callback);
102 observer.observe(document, { childList: true, subtree: true });
103 }
104
105
106 // 快捷回到顶部(右键左右两侧空白处)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected