蜘蛛磁力搜索

搜索想看的视频,书籍,软件的磁力链接,方便,节省时间

// ==UserScript==
// @name         蜘蛛磁力搜索
// @namespace    https://zizhucili.com
// @version      0.1.2
// @description  搜索想看的视频,书籍,软件的磁力链接,方便,节省时间
// @author       Fructose
// @match        *://*/*
// @grant        GM_addStyle
// @require      https://code.jquery.com/jquery-3.1.0.js
// @license      MIT
// @icon         https://cdn-img.easyicon.net/png/376/37643.gif
// ==/UserScript==

(function() {
    'use strict';
    GM_addStyle(`#zizhuIcon {width: 36px; height: 36px;box-shadow: 2px 2px 4px rgba(12,12,12,.3); border-radius: 5px; cursor: pointer;}
                 #zizhuMain {position: absolute; top: 0; left: 0; width: 0; height: 0; background: #fff; font-size: 12px; opacity: 0;z-index: 9999;display:none;box-sizing: border-box;}`)
    var innerIcon = "<img src='data:image/gif;base64,R0lGODlhgACAAPfrAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUNDQ0REREVFRUZGRkdHR0hISElJSUpKSktLS0xMTE1NTU5OTk9PT1BQUFFRUVJSUlNTU1RUVFVVVVZWVldXV1hYWFlZWVpaWltbW1xcXF1dXV5eXl9fX2BgYGFhYWJiYmRkZGVlZWZmZmdnZ2hoaGpqamtra2xsbG1tbW5ubm9vb3BwcHFxcXJycnNzc3R0dHV1dXZ2dnd3d3h4eHl5eXp6ent7e3x8fH19fX5+fn9/f4GBgYKCgoODg4SEhIWFhYeHh4iIiImJiYqKiouLi4yMjI2NjY6OjpCQkJGRkZKSkpOTk5SUlJWVlZeXl5iYmJmZmZqampubm5ycnJ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y2edKUTnek4f3rTkX50pivd6kNHDVXcs3WuU/e0p9062AcSNrGHvSBePzvYuz52Pbv97XCPu9znTve6AyUgADs=' id='zizhuIcon' alt='蜘蛛磁力搜索' title='蜘蛛磁力搜索'/>"
    var txt = ''
    var odom = document.createElement("div");
    odom.id = "zizhuMain";
    odom.innerHTML = innerIcon;
    document.body.appendChild(odom);
    document.querySelector("#zizhuMain").addEventListener("click",searchSetting);
    function searchSetting(){
       //location.href="https://zizhucili.com/s/"+txt
        if(txt.length != 0){
            //window.open('http://www.zhizhud.com/so/'+txt+'-first-asc-1')
            window.open('https://zizhucili.com/s/'+txt+'/time-1.html')
        }
    }
    $('body').mouseup(function(e){
        txt = window.getSelection?window.getSelection().toString():document.selection.createRange().text;
        let sel = window.getSelection()
        var range = sel.getRangeAt(0);
        var rect = range.getBoundingClientRect();
        var scrollH = $(document).scrollTop();
        var scrollW = $(document).scrollLeft();
        if(txt && txt.length != 0){
            $('#zizhuMain').css({ "top": rect.y+scrollH+20+'px', "left": rect.x+scrollW+'px','opacity':1,'width':'36px','height':'36px','display': 'block' })
        } else {
            $('#zizhuMain').css({'opacity':0 ,'width':'0','height':'0','display': 'none' })
        }
    })
})();