Greasy Fork is available in English.
识别任意BT网站的磁力链接、电驴链接、迅雷下载链接,双击当前页面即可快速复制[hahacium(GitHub)]
当前为
// ==UserScript==
// @name Bt磁力电驴迅雷双击复制
// @namespace https://github.com/hahacium
// @version 0.2
// @description 识别任意BT网站的磁力链接、电驴链接、迅雷下载链接,双击当前页面即可快速复制[hahacium(GitHub)]
// @author hahacium(GitHub)
// @include *
// ==/UserScript==
(function() {
'use strict';
var cli=document.getElementsByTagName("a");
var urlmag=/^magnet:\?xt=urn:btih:.*$/;
var urled2k=/^ed2k:.*$/;
var urlthunder=/^thunder:.*$/;
for(var i=0;i<cli.length;i++){
if(urlmag.test(cli[i].getAttribute("href"))||urled2k.test(cli[i].getAttribute("href"))||urlthunder.test(cli[i].getAttribute("href")))
{
var ok=cli[i].getAttribute("href");
document.ondblclick=function(){
var input = document.createElement('input');
document.body.appendChild(input);
input.setAttribute('value', ok);
input.select();
if (document.execCommand("copy")) {
document.execCommand("copy");
}
input.style.cssText="display: none;";
var div = document.createElement('div');
document.body.appendChild(div);
div.style.cssText="width:0px;height:40px;color:#fff;background-color:#12709e;font-size:17px;text-align:center;transition:width .2s,height .2s,transform .2s;border-radius:5px;position:fixed;top:20%;right:0;display:flex;justify-content:center;align-items:center;";
div.innerHTML='<span style="height:60%;overflow:hidden">复制成功</span>';
setTimeout( function(){
div.style.cssText+="width: 120px;";
}, 10 );
setTimeout( function(){
div.style.cssText+="width: 0px;";
}, 1000 );
}
break;
}
}
})();