Fuck Baidu Cursor(update)

对百度竖中指|Fuck Baidu Cursor

// ==UserScript==
// @name         Fuck Baidu Cursor(update)
// @namespace    https://www.tempermonkey.net/PY-DNG
// @version      2020.08.23.1
// @description  对百度竖中指|Fuck Baidu Cursor
// @author       PY-DNG
// @include      *://www.baidu.com/*
// @include      *://www.baidu.com
// @run-at       document-start
// ==/UserScript==

// primary author: ipcjs(https://github.com/ipcjs)
// cursor image design by [@mariotaku](https://twitter.com/mariotaku/status/842375672404164610). [get cursor](http://www.cursor.cc/?action=icon&file_id=74960)

(function(){
    'use strict';
    let Interval //Interval变量,用于储存Interval循环,控制其运行与停止
    let FuckInterval //FuckInterval变量,用于储存click事件处理器函数
    const StyleId = 'FuckingStyle' //StyleId常量,用于定义FuckingStyle的Element.Id
    let AddStyle = function(NewStyle, SytleId){
        if(SytleId && document.getElementById(SytleId)){
            document.getElementById(SytleId).remove();
        }
        let NewStyleElement = document.createElement("style");
        NewStyleElement.type = "text/css";
        if(SytleId){NewStyleElement.id = SytleId;};
        NewStyleElement.appendChild(document.createTextNode(NewStyle));
        let HeadElement = document.getElementsByTagName("head")[0];
        HeadElement.appendChild(NewStyleElement);
    }
    let Fuck = function(){
        let fuckingtext = "#su.btnhover {cursor: url('data:image/x-icon;base64,AAACAAEAICAAAAAAAACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACYUEgkmFBJvJhQSwyYUEtImFBK9JhQSjSYUEjMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmFBJjLhwZ/4R6eP/MyMf/2dbV/8fBwf+dlZT/UUNA/yYUEpMmFBIVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJhQSh0IyMP/U0ND////////////////////////////8/Pz/kYiG/ykXFP8mFBItAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACYUEmxPQD7/8vHx////////////////////////////////////////////pZ6c/yYUEpYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmFBIzLhwZ/9vY2P//////////////////////////////////////////////////////VkhG/yYUEjwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACYUEpyqo6L///////////////////////////////////////////////////////////+yq6r/JhQSpQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmFBKQf3Rz/////////////////////////////////////////////////////////////////+bj4/8mFBLhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJhQSfllLSf/6+fn/////////////////////////////////////////////////////////////////+vn5/yYUEvkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACYUElc9LSr/6+np////////////6+np////////////////////////////////////////////////////////////JhQS/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJhQSwMrEw////////////8fBwf9ENTL///////////////////////////////////////////////////////////8mFBL/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmFBK6xL++//Lx8f+Eenj/KRcU/yYUEv///////////////////////////////////////////////////////////yYUEv8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACYUElEmFBK6KxoX/yYUEocmFBIGJhQS////////////////////////////////////////////////////////////JhQS/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmFBIGAAAAAAAAAAAmFBL////////////o5ub////////////y8fH////////////Ev77///////////8mFBL/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACYUEv///////////ysaF////////////0c4Nf///////////zMiH////////////yYUEv8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMyIf////////////JhQS////////////JhQS////////////MyIf////////////JhQS/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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mFBL8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACYUErG8trb/x8HB/yYUEr0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJhQSSCYUErEmFBK9JhQSVAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////////////////////////////////////h////gH///gA///4AH//8AB//+AAP//AAD//wAA//4AAP/8AAD//AAA//4gAP//4AD//+AA///gAP//4AD//+AB///wD////D////w////8P////D////w////+f//8='), auto;}";
        //百度LOGO在搜索页和首页是不同的Element,需要分别处理
        if (window.location.href.indexOf("//www.baidu.com/") !== -1 && window.location.href.indexOf("&wd=") === -1 && window.location.href.indexOf("?wd=") === -1){ //百度首页
            console.log('Homepage');
            //如果百度没有提供id就用自定义的id
            let logoid = 'homelogo'
            //给首页LOGO添加id
            let LOGO = document.querySelector('#lg map area');
            if(LOGO.id === ''){LOGO.id = logoid}else{logoid = LOGO.id};
            LOGO.style.cursor = "";
            //加在CSS选择器里
            fuckingtext = "#" + logoid + "," + fuckingtext;
        }else{
            console.log('Not Homepage');
            //如果搜索页面加载完成就停止Fuck循环,判断方法:有FuckStyle、有搜索结果数量统计 And 没有搜索中创建、搜索后消失的三个Element
            if(document.getElementById(StyleId) && document.getElementsByClassName('nums_text')[0] && !document.getElementById('_mask') && !document.getElementById('_FP_userDataDiv') && !document.getElementById('_FP_comDiv')){
                clearInterval(Interval);
            }
            //如果百度没有提供id就用自定义的id
            let logoid = 'searchlogo'
            //给搜索页LOGO添加id
            let pe = document.getElementById('result_logo');
            let LOGO = pe.children[0];
            if(LOGO.id === ''){LOGO.id = logoid};
            LOGO.style.cursor = "";
            //加在CSS选择器里
            fuckingtext = "#" + logoid + ',' + fuckingtext
        }
        AddStyle(fuckingtext, StyleId);
        if(!FuckInterval){
            FuckInterval = function(){
                Interval = setInterval(Fuck, '350');
            }
            document.getElementById('su').addEventListener('click', FuckInterval);
        }
    }
    window.addEventListener('load', Fuck);
})()