Autoclick Download Button journaldupirate.net

try to take over the world!

< 脚本Autoclick Download Button journaldupirate.net的反馈

评价:一般 - 脚本能用,但还有一些问题

§
发表于:2020-12-26

Hi,
I've just added some features to your script :
- Auto copy the url found into the clipboard
- Auto close window, like this, it's easier to use it with program like FreeRapid or others download programs.

// ==UserScript==
// @name Autoclick Download Button journaldupirate.net
// @namespace https://gf.qytechs.cn/fr/users/11667-hoax017
// @version 0.1
// @description try to take over the world!
// @author Hoax017
// @match https://www.journaldupirate.net/go_to/*
// @grant window.close
// @grant window.focus
// ==/UserScript==
//
//TODO in firefox settings for the automatic close
// Go to address bar and type about:config
// Go to parameter dom.allow_scripts_to_close_windows
// Set its value as true


(function() {
'use strict';
if(document.querySelector('input[value="Continuer pour voir le lien"]')) {
document.querySelector('input[value="Continuer pour voir le lien"]').click()
}

if (document.querySelector('div.alert a')) {
var link = document.querySelector('div.alert a')
link.href = link.href.replace(/(\?|&)af=\d+/,'').replace(/(\?|&)aff_id=\d+/,'')
//alert(link.href)
textToClipboard(link.href)
window.close();
}
})();

function textToClipboard (text) {
var dummy = document.createElement("textarea");
document.body.appendChild(dummy);
dummy.value = text;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
}

发表回复

登录(不可用)以发表回复。

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址