Last active
June 29, 2023 10:35
-
-
Save julenwang/df4035af577b50b062bcf9d4474fc3be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name copyNcRawsAllUrls.js | |
// @version 0.3.0 | |
// @description 2023/06/29 | |
// @author Julen | |
// @match https://ouo.si/* | |
// @grant none | |
// ==/UserScript== | |
(function () { | |
let nav = document.querySelector("nav"); | |
if (nav) { | |
let btn = document.createElement("button"); | |
btn.type = "button"; | |
btn.textContent = "copy所有磁力链"; | |
nav.appendChild(btn); | |
btn.onclick = () => { | |
let result = Array.from(document.querySelectorAll("table>tbody>tr")) | |
.map((tr) => tr.querySelector('.tr-links>a').href) | |
.reduce((acc, cur) => { | |
return `${acc}${cur}\n`; | |
}, ""); | |
window.navigator.clipboard.writeText(result); | |
}; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment