yimuhe

1.去除javlibrary详情页面中下载url的重定向;高亮yimuhe的下载链接

2021-02-28 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         yimuhe
// @namespace    https://greasyfork.org/zh-CN/scripts/38740-yimuhe
// @version      1.0.5
// @description  1.去除javlibrary详情页面中下载url的重定向;高亮yimuhe的下载链接
//               2.破坏torrentkitty的脚本变量引用. 原先l8l1X变量是引用window,然后给加定时器,不停地添加页面的mousedown事件,导致鼠标点击任何地方都会跳转到广告页面
//               3.给141jav每个车牌号后面加上复制按钮
// @author       You
// @include      http://*.javlib.com/*
// @include      http*:/*.torrentkitty.*/*
// @include      http*://*.b49t.com/*
// @include      http*://*.b47w.com/*
// @include      http*://*.141jav.com/*
// @require      http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.4.min.js

// @grant        none
// @run-at document-end
// ==/UserScript==



(function () {
    console.log("1");
    execute("g46e|b47w|b49t.com|javlib.com",function(location){
        console.info("1.去除javlibrary详情页面中下载url的重定向;高亮yimuhe的下载链接");
        $.each($("a[href^='redirect.php?url']"),function(index,a){
            var origin = location.origin;
            a.href = decodeURIComponent(a.href.replace(origin+"/cn/redirect.php?url=",""));

            a.text = a.text + "    " + a.href + "      ";
            if(a.href.includes("yimuhe")){
                $(a).parentsUntil("tr").closest('.t').css('background-color', '#6B6C83');
                a.style='font-size:40px;';
            }else{
                a.style='font-size:20px;';
            }
        });
    });

    execute("torrentkitty",function(location){
        console.info("2.破坏torrentkitty的脚本变量引用. 原先l8l1X变量是引用window,然后给加定时器,不停地添加页面的mousedown事件,导致鼠标点击任何地方都会跳转到广告页面.");
        window.l8l1X=1;
    });

    execute("141jav",function(location){
        console.info("3.给141jav每个车牌号后面加上复制按钮");
        $("h5.title.is-4.is-spaced > a").each(function(index,element){
            var copyButton = $('<button style="width:70px;height:50px">复 制</button>');
            $(element).next().after(copyButton);
            copyButton.click(function(){
                copyToClipboard(element.innerText.trim());
            });
        });
    });


    function execute(regExpString,callback){
        var href = window.location.href;
        var pattern=new RegExp(regExpString);
        if(pattern.test(href)){
            callback(window.location);
        }else{
            console.info("输入的参数 %s 与 %s 不匹配",regExpString,href);
        }
    }

    function copyToClipboard (text) {
        var textArea = document.createElement("textarea");
        textArea.style.position = 'fixed';
        textArea.style.top = '0';
        textArea.style.left = '0';
        textArea.style.width = '2em';
        textArea.style.height = '2em';
        textArea.style.padding = '0';
        textArea.style.border = 'none';
        textArea.style.outline = 'none';
        textArea.style.boxShadow = 'none';
        textArea.style.background = 'transparent';
        textArea.value = text;
        document.body.appendChild(textArea);
        textArea.select();

        try {
            var successful = document.execCommand('copy');
            var msg = successful ? '成功复制到剪贴板' : '该浏览器不支持点击复制到剪贴板';
            //alert(msg);
        } catch (err) {
            alert('该浏览器不支持点击复制到剪贴板');
        }

        document.body.removeChild(textArea);
    }  // end function copyToClipboard

}) ();