scripts/userscripts/hidemy.name-free-ipport-export.user.js

39 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-03-18 17:10:05 +00:00
// ==UserScript==
// @name hidemy.name - Free export IP:Port button
// @namespace Violentmonkey Scripts
// @match *://hidemy.name/*/proxy-list/
// @grant none
// @version 1.0
// @author tretrauit
// @description Replace the IP:Port button with a free button that copy to clipboard
// @run-at document-idle
// @homepageURL https://gitlab.com/tretrauit/scripts
// @supportURL https://gitlab.com/tretrauit/scripts/-/issues
2024-03-06 16:48:06 +00:00
// @downloadURL https://git.tretrauit.me/tretrauit/scripts/raw/branch/main/userscripts/hidemy.name-free-ipport-export.user.js
2022-03-18 17:10:05 +00:00
// ==/UserScript==
2023-08-21 18:28:47 +00:00
setTimeout(function () {
const tblContent = document
.getElementsByClassName("table_block")[0]
.getElementsByTagName("tbody")[0].children;
2022-03-18 17:10:05 +00:00
// 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);
2022-03-18 17:10:05 +00:00
}, 5000);