Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Journal du Pirate - Copy Link
- // @namespace YP
- // @version 2021.0414.0749
- // @description Copy uptobox.com links from JdP
- // @author Yunga Palatino <[email protected]>
- //
- // @grant GM_setClipboard
- // @run-at idle
- // @inject-into auto
- // @noframes
- //
- // @match https://*.journaldupirate.net/go_to/*
- // ==/UserScript==
- function yp_jdp_copy_link() {
- "use strict";
- const myName = `jdpCopyLink`;
- let btn = document.getElementsByClassName("button button-blue button-full set-button")
- console.log(`${myName}: Found ${btn.length} buttons`);
- if (btn.length === 1) {
- btn[0].click();
- } else {
- for (let lnk of document.links) {
- if (lnk.href.match("uptobox")) {
- console.log(`${myName}: Found url: ${lnk.href}`);
- GM_setClipboard(lnk.href);
- }
- }
- }
- }
- yp_jdp_copy_link();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement