try
目前為
// ==UserScript==
// @name Copy All Link Imagas
// @namespace http://yu.net/
// @version 2024-01-23
// @description try
// @author Yu
// @match https://bunkr.sk/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=monotaro.id
// @require https://update.greasyfork.org/scripts/485684/1317487/Downloader%20JS%20File.js
// @grant GM_download
// @license MIT
// ==/UserScript==
function createDownloadElement() {
const button = document.createElement("button")
button.style.background = "#ffd369";
button.style.color = "#272727"
button.style.fontWeight = "bold";
button.classList.add("block", "mx-auto", "py-2", "px-4", "rounded");
button.innerText = "Copy All Link";
return button
}
function handleDownloadAllImages() {
const elements = document.querySelectorAll(".grid-images_box a");
const images = []
elements.forEach(item => images.push(`https://i-taquito.bunkr.ru/${item.href.replace("https://bunkr.sk/i/", "")}`))
if("navigator" in window) {
navigator.clipboard.writeText(images.join("\n")).then(() => window.alert("Link Copied")).catch((err) => alert("error"))
} else {
alert("Browser not supported");
}
}
function removeAllIframe() {
const all = document.querySelector("iframe");
if(all) return;
for(const element of all) {
element.remove()
}
}
(function() {
'use strict';
const button = createDownloadElement();
button.onclick = handleDownloadAllImages;
document.querySelector("section").append(button);
removeAllIframe();
setInterval(() => removeAllIframe(), 1000);
})();