本文最后更新于 2024-08-05T22:48:02+08:00
0065_油猴脚本_eh磁力链助手
eh磁力链助手
代码
点我展开代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
(function() { const tableList = document.querySelectorAll("#torrentinfo form table"); if (tableList && tableList.length) { tableList.forEach((table) => { const href = table.querySelector('a')?.href; if (!href) return; const magnet = href.replace(/.*?([0-9a-f]{40}).*$/i,"magnet:?xt=urn:btih:$1") ; if (magnet.length != 60) return; const insertionPoint = table.querySelector('input[type="submit"],button[type="submit"]'); if (!insertionPoint) return; const button = document.createElement("input"); button.type = "button"; button.value = "复制磁力链"; button.setAttribute('ehs-input', ''); button.style.marginBottom = '4px' button.onclick = () => { GM_setClipboard(magnet); button.value = "✅已复制"; button.disabled = true; setTimeout(() => { button.disabled = false; button.value = "复制磁力链"; }, 1000) }; insertionPoint.parentNode.insertBefore( button, insertionPoint ); }) } })();
|
0065_油猴脚本_eh磁力链助手
https://100497.github.io/3413675388/