feat: add scripts

This commit is contained in:
2023-08-22 01:28:47 +07:00
parent 7fe79a2bdb
commit 92c0e0ee6c
19 changed files with 581 additions and 438 deletions

View File

@ -12,25 +12,27 @@
// @downloadURL https://gitlab.com/tretrauit/scripts/-/raw/main/userscripts/hidemy.name-free-ipport-export.user.js
// ==/UserScript==
setTimeout(function() {
const tblContent = document.getElementsByClassName("table_block")[0].getElementsByTagName("tbody")[0].children
setTimeout(function () {
const tblContent = document
.getElementsByClassName("table_block")[0]
.getElementsByTagName("tbody")[0].children;
// Replace the export IP:Port button
const btns = document.getElementsByClassName("export")[0]
const exportBtn = btns.children[0]
const fakeExportBtn = exportBtn.cloneNode(true)
fakeExportBtn.removeAttribute("href")
fakeExportBtn.addEventListener("click", () => {
var proxyStr = ""
for (let proxyContent of tblContent) {
const proxyContentChildren = proxyContent.children
const proxyIp = proxyContentChildren[0].innerHTML
const proxyPort = proxyContentChildren[1].innerHTML
proxyStr += proxyIp + ":" + proxyPort + "\n"
}
navigator.clipboard.writeText(proxyStr)
alert("Copied IP:Port list to clipboard.")
})
exportBtn.remove()
btns.prepend(fakeExportBtn)
// Replace the export IP:Port button
const btns = document.getElementsByClassName("export")[0];
const exportBtn = btns.children[0];
const fakeExportBtn = exportBtn.cloneNode(true);
fakeExportBtn.removeAttribute("href");
fakeExportBtn.addEventListener("click", () => {
var proxyStr = "";
for (let proxyContent of tblContent) {
const proxyContentChildren = proxyContent.children;
const proxyIp = proxyContentChildren[0].innerHTML;
const proxyPort = proxyContentChildren[1].innerHTML;
proxyStr += proxyIp + ":" + proxyPort + "\n";
}
navigator.clipboard.writeText(proxyStr);
alert("Copied IP:Port list to clipboard.");
});
exportBtn.remove();
btns.prepend(fakeExportBtn);
}, 5000);