百Bing图

给百度首页换上Bing的背景图,并添加背景图链接与日历组件

// ==UserScript==
// @name         百Bing图
// @name:en      BingBgForBaidu
// @namespace    hoothin
// @version      2.3.41
// @description     给百度首页换上Bing的背景图,并添加背景图链接与日历组件
// @description:en  Just change the background image of baidu.com to bing.com
// @author       hoothin
// @grant        GM_xmlhttpRequest
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_addStyle
// @grant        unsafeWindow
// @connect      global.bing.com
// @connect      cn.bing.com
// @license      MIT License
// @match      *://www.baidu.com/
// @match      *://www.baidu.com/home*
// @match      *://www.baidu.com/?tn=*
// @match      *://www.baidu.com/index.php*
// @match      *://ipv6.baidu.com/
// @match      *://ipv6.baidu.com/home*
// @match      *://ipv6.baidu.com/?tn=*
// @match      *://ipv6.baidu.com/index.php*
// ==/UserScript==

(function() {
    'use strict';
    if(/&wd=/.test(location.href))return;
    var head=document.querySelector("#head");
    if(!head.classList.contains("s-skin-hasbg")){
        head.classList.add("s-skin-hasbg");
        head.classList.add("s-opacity-50");
        GM_addStyle(".s-opacity-50 .s-opacity-border1-top{border-top-color: rgba(233,233,233,0.5) !important;}.s-opacity-50 .s-opacity-border1-bottom{border-bottom-color: rgba(233,233,233,0.5) !important;}.s-opacity-50 .s-opacity-border1-left{border-left-color: rgba(233,233,233,0.5) !important;}.s-opacity-50 .s-opacity-border1-right{border-right-color: rgba(233,233,233,0.5) !important;}.s-opacity-50 .s-opacity-border2-top{border-top-color: rgba(234,234,234,0.5) !important;}.s-opacity-50 .s-opacity-border2-bottom{border-bottom-color: rgba(234,234,234,0.5) !important;}.s-opacity-50 .s-opacity-border2-left{border-left-color: rgba(234,234,234,0.5) !important;}.s-opacity-50 .s-opacity-border2-right{border-right-color: rgba(234,234,234,0.5) !important;}.s-opacity-50 .s-opacity-border3-top{border-top-color: rgba(238,238,238,0.5) !important;}.s-opacity-50 .s-opacity-border3-bottom{border-bottom-color: rgba(238,238,238,0.5) !important;}.s-opacity-50 .s-opacity-border3-left{border-left-color: rgba(238,238,238,0.5) !important;}.s-opacity-50 .s-opacity-border3-right{border-right-color: rgba(238,238,238,0.5) !important;}.s-opacity-50 .s-opacity-border4-top{border-top-color: rgba(240,240,240,0.5) !important;}.s-opacity-50 .s-opacity-border4-bottom{border-bottom-color: rgba(240,240,240,0.5) !important;}.s-opacity-50 .s-opacity-border4-left{border-left-color: rgba(240,240,240,0.5) !important;}.s-opacity-50 .s-opacity-border4-right{border-right-color: rgba(240,240,240,0.5) !important;}.s-opacity-50 .s-opacity-border5-top{border-top-color: rgba(243,243,243,0.5) !important;}.s-opacity-50 .s-opacity-border5-bottom{border-bottom-color: rgba(243,243,243,0.5) !important;}.s-opacity-50 .s-opacity-border5-left{border-left-color: rgba(243,243,243,0.5) !important;}.s-opacity-50 .s-opacity-border5-right{border-right-color: rgba(243,243,243,0.5) !important;}.s-opacity-50 .s-opacity-border6-top{border-top-color: rgba(218,218,218,0.5) !important;}.s-opacity-50 .s-opacity-border6-bottom{border-bottom-color: rgba(218,218,218,0.5) !important;}.s-opacity-50 .s-opacity-border6-left{border-left-color: rgba(218,218,218,0.5) !important;}.s-opacity-50 .s-opacity-border6-right{border-right-color: rgba(218,218,218,0.5) !important;}.s-opacity-50 .s-opacity-border7-top{border-top-color: rgba(226,226,226,0.5) !important;}.s-opacity-50 .s-opacity-border7-bottom{border-bottom-color: rgba(226,226,226,0.5) !important;}.s-opacity-50 .s-opacity-border7-left{border-left-color: rgba(226,226,226,0.5) !important;}.s-opacity-50 .s-opacity-border7-right{border-right-color: rgba(226,226,226,0.5) !important;}.s-opacity-50 .s-opacity-blank1{border-color: rgba(206,206,206,0.5) !important;}.s-opacity-50 .s-opacity-blank2{border-color: rgba(233,233,233,0.5) !important;}.s-opacity-50 .s-opacity-blank3{border-color: rgba(240,240,240,0.5) !important;}.s-opacity-50 .s-opacity-blank4{border-color: rgba(218,218,218,0.5) !important;}.s-opacity-50 .s-opacity-blank5{border-color: rgba(216,216,216,0.5) !important;}.s-opacity-50 .s-opacity-blank6{border-color: rgba(238,238,238,0.5) !important;}.s-opacity-50 .s-opacity-blank7{border-color: rgba(234,234,234,0.5) !important;}.s-opacity-50 .s-opacity-blank8{border-color: rgba(226,226,226,0.5) !important;}.s-opacity-50 .s-opacity-scroll{border-color: rgba(227,227,227,0.5) !important;}.s-opacity-50 .s-opacity-scroll{border-left-color: rgba(225,225,225,0.5) !important;}.s-opacity-50 .s-opacity-scroll{background: none !important;background-image: -webkit-gradient(linear,left top,left bottom,from(rgba(227,227,227,0.5)),to(rgba(227,227,227,0.5))) !important;background-image: -moz-linear-gradient(rgba(227,227,227,0.5) 0%,rgba(227,227,227,0.5) 100%) !important;background-image: -ms-linear-gradient(rgba(227,227,227,0.5) 0%,rgba(227,227,227,0.5) 100%) !important;background-image: -o-linear-gradient(rgba(227,227,227,0.5) 0%,rgba(227,227,227,0.5) 100%) !important;background-image: linear-gradient(rgba(227,227,227,0.5) 0%,rgba(227,227,227,0.5) 100%) !important;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7FE3E3E3,endColorstr=#7FE3E3E3) !important;}.s-opacity-50 .s-opacity-scroll-slider{border-color: rgba(225,225,225,0.5) !important;}.s-opacity-50 .s-opacity-scroll-slider{border-bottom-color: rgba(212,212,212,0.5) !important;}.s-opacity-50 .s-opacity-scroll-slider{background: none !important;background-image: -webkit-gradient(linear,left top,left bottom,from(rgba(255,255,255,0.5)),to(rgba(255,255,255,0.5))) !important;background-image: -moz-linear-gradient(rgba(255,255,255,0.5) 0%,rgba(255,255,255,0.5) 100%) !important;background-image: -ms-linear-gradient(rgba(255,255,255,0.5) 0%,rgba(255,255,255,0.5) 100%) !important;background-image: -o-linear-gradient(rgba(255,255,255,0.5) 0%,rgba(255,255,255,0.5) 100%) !important;background-image: linear-gradient(rgba(255,255,255,0.5) 0%,rgba(255,255,255,0.5) 100%) !important;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7FFFFFFF,endColorstr=#7FFFFFFF) !important;}.s-opacity-50 .s-opacity-background1{background: none !important;background-image: -webkit-gradient(linear,left top,left bottom,from(rgba(243,243,243,0.5)),to(rgba(243,243,243,0.5))) !important;background-image: -moz-linear-gradient(rgba(243,243,243,0.5) 0%,rgba(243,243,243,0.5) 100%) !important;background-image: -ms-linear-gradient(rgba(243,243,243,0.5) 0%,rgba(243,243,243,0.5) 100%) !important;background-image: -o-linear-gradient(rgba(243,243,243,0.5) 0%,rgba(243,243,243,0.5) 100%) !important;background-image: linear-gradient(rgba(243,243,243,0.5) 0%,rgba(243,243,243,0.5) 100%) !important;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7FF3F3F3,endColorstr=#7FF3F3F3) !important;}.s-opacity-50 .s-opacity-background2{background: none !important;background-image: -webkit-gradient(linear,left top,left bottom,from(rgba(248,248,248,0.5)),to(rgba(248,248,248,0.5))) !important;background-image: -moz-linear-gradient(rgba(248,248,248,0.5) 0%,rgba(248,248,248,0.5) 100%) !important;background-image: -ms-linear-gradient(rgba(248,248,248,0.5) 0%,rgba(248,248,248,0.5) 100%) !important;background-image: -o-linear-gradient(rgba(248,248,248,0.5) 0%,rgba(248,248,248,0.5) 100%) !important;background-image: linear-gradient(rgba(248,248,248,0.5) 0%,rgba(248,248,248,0.5) 100%) !important;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7FF8F8F8,endColorstr=#7FF8F8F8) !important;}.s-opacity-50 .s-opacity-white-background{background: none !important;background-image: -webkit-gradient(linear,left top,left bottom,from(rgba(255,255,255,0.5)),to(rgba(255,255,255,0.5))) !important;background-image: -moz-linear-gradient(rgba(255,255,255,0.5) 0%,rgba(255,255,255,0.5) 100%) !important;background-image: -ms-linear-gradient(rgba(255,255,255,0.5) 0%,rgba(255,255,255,0.5) 100%) !important;background-image: -o-linear-gradient(rgba(255,255,255,0.5) 0%,rgba(255,255,255,0.5) 100%) !important;background-image: linear-gradient(rgba(255,255,255,0.5) 0%,rgba(255,255,255,0.5) 100%) !important;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7FFFFFFF,endColorstr=#7FFFFFFF) !important;}.s-opacity-50 .s-opacity-menu1{background: none !important;background-image: -webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0.4)),to(rgba(0,0,0,0.4))) !important;background-image: -moz-linear-gradient(rgba(0,0,0,0.4) 0%,rgba(0,0,0,0.4) 100%) !important;background-image: -ms-linear-gradient(rgba(0,0,0,0.4) 0%,rgba(0,0,0,0.4) 100%) !important;background-image: -o-linear-gradient(rgba(0,0,0,0.4) 0%,rgba(0,0,0,0.4) 100%) !important;background-image: linear-gradient(rgba(0,0,0,0.4) 0%,rgba(0,0,0,0.4) 100%) !important;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#66000000,endColorstr=#66000000) !important;}.s-opacity-50 .s-opacity-foreground{opacity: 0.5;filter: alpha(opacity=50);}.s-opacity-50 .s-opacity-max{opacity: 0.4;filter: alpha(opacity=40);}.s-opacity-50 .s-opacity-bottommoremenu{background: none !important;background-image: -webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,0.45))) !important;background-image: -moz-linear-gradient(rgba(0,0,0,0) 0%,rgba(0,0,0,0.45) 100%) !important;background-image: -ms-linear-gradient(rgba(0,0,0,0) 0%,rgba(0,0,0,0.45) 100%) !important;background-image: -o-linear-gradient(rgba(0,0,0,0) 0%,rgba(0,0,0,0.45) 100%) !important;background-image: linear-gradient(rgba(0,0,0,0) 0%,rgba(0,0,0,0.45) 100%) !important;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr=#72000000) !important;}.s-opacity-50 .s-opacity-topmoremenu{background: none !important;background-image: -webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0.45)),to(rgba(0,0,0,0))) !important;background-image: -moz-linear-gradient(rgba(0,0,0,0.45) 0%,rgba(0,0,0,0) 100%) !important;background-image: -ms-linear-gradient(rgba(0,0,0,0.45) 0%,rgba(0,0,0,0) 100%) !important;background-image: -o-linear-gradient(rgba(0,0,0,0.45) 0%,rgba(0,0,0,0) 100%) !important;background-image: linear-gradient(rgba(0,0,0,0.45) 0%,rgba(0,0,0,0) 100%) !important;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#72000000,endColorstr=#00000000) !important;}");
    }
    var bingBgLink=document.createElement("a");
    bingBgLink.innerHTML="<span class='title'>Bing图</span>";
    var riliLink=document.createElement("a"),date=new Date();
    var icons=document.querySelector("#s_icons");
    if(!icons){
        icons=document.querySelector("#u1");
        bingBgLink.classList.add("s-top-right-text","c-font-normal","mnav","c-color-t");
        riliLink.classList.add("s-top-right-text","c-font-normal","mnav","c-color-t");
    }
    if(icons)icons.insertBefore(bingBgLink,icons.children[1]||icons.firstChild);
    var iframe=document.createElement("iframe");
    iframe.src="/s?wd=%E6%97%A5%E5%8E%86";
    iframe.setAttribute("scrolling","no");
    iframe.style.display="none";
    iframe.style.top="30px";
    iframe.style.left="0px";
    iframe.style.position="fixed";
    iframe.style.zIndex="99";
    iframe.style.borderRadius="16px";
    iframe.name="pagetual-iframe";
    iframe.style.border="none";
    var sUpfuncMenus=document.querySelector("#s_upfunc_menus");
    if(!sUpfuncMenus){
        sUpfuncMenus=document.querySelector(".head_wrapper");
        iframe.style.top="50px";
        iframe.style.left="";
        iframe.style.right="30px";
    }
    if(sUpfuncMenus){
        sUpfuncMenus.appendChild(iframe);
    }
    var dateDay=date.getDate(),dateMonth=date.getMonth()+1;
    if(dateDay<10)dateDay="0"+dateDay;
    if(dateMonth<10)dateMonth="0"+dateMonth;
    var week=["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"];
    var riliurl=GM_getValue("riliurl")||"https://www.rili.com.cn/";
    riliLink.innerHTML="<span class='title' style='cursor: pointer; border-bottom: solid 1px; padding: 2px 0;'>"+date.getFullYear()+"-"+dateMonth+"-"+dateDay+" \u661f\u671f"+week[date.getDay()]+"</span>";
    riliLink.onclick=function(){
        window.open(riliurl);
    };
    riliLink.oncontextmenu=function(e){
        let newRiliurl=prompt("自定义 url", riliurl);
        if(newRiliurl){
            riliurl=newRiliurl;
            GM_setValue("riliurl", newRiliurl);
        }
        e.preventDefault();
    };
    if(icons)icons.insertBefore(riliLink,icons.children[1]||icons.firstChild);
    iframe.onload=function(){
        var contentHead=iframe.contentDocument.querySelector("#head");
        if(contentHead && contentHead.parentNode)contentHead.parentNode.removeChild(contentHead);
        var $=unsafeWindow.$;
        var iframeDoc=$(iframe.contentDocument);
        var rili=$("div.op-calendar-new,div.op-calendar-pc,div.result-op.c-container.xpath-log.new-pmd>div",iframe.contentDocument);
        rili.after("<br/><br/>");
        $("#head,.head_nums_cont_outer,#searchTag",iframe.contentDocument).hide();
        iframe.setAttribute("scrolling","no");
        var t;
        //riliLink.innerHTML="<span class='title' style='text-decoration:overline;cursor:crosshair'>"+$(".op-calendar-new-right-date,.op-calendar-pc-right-date",iframe.contentDocument).html()+"</span>";
        riliLink.onmouseenter=function(){
            clearTimeout(t);
                $(iframe).show(200);
                iframeDoc.scrollTop(137);
                iframeDoc.scrollLeft(134);
                iframe.width=592;
                iframe.height=665;
        };
        riliLink.onmouseleave=function(){
            clearTimeout(t);
            t=setTimeout(function(){
                $(iframe).hide(500);
            },300);
        };
        iframe.onmouseenter=function(){
            clearTimeout(t);
        };
        iframe.onmouseleave=function(){
            clearTimeout(t);
            t=setTimeout(function(){
                $(iframe).hide(500);
            },100);
        };
        var holiday=$('.cos-search-link,.sc-search-link',iframe.contentDocument)[0];
        if(holiday){
            var title=holiday.innerText.slice(0, -1);
            riliLink.innerHTML+=title?" <font color='#FFFF66' style='background-color:#e02d2d;font-weight:bold;border-radius: 8px; padding: 3px; border: solid 1px #e02d2d;'>"+title+"</font>":"";
            riliLink.title=title;
        }
    };
    var skinContainer=document.querySelector(".s-skin-container");
    if(!skinContainer){
        skinContainer=document.getElementsByTagName("body")[0];
        GM_addStyle(".s-news-rank-content{max-height: 180px; width: 99%; overflow-y: auto; overflow-x: hidden;}.s-top-right .ai-entry-right-nologin,.s-top-right .operate-wrapper-nologin{right:362px;}.hot-refresh{padding-bottom:7px;}.hot-title>div,.hot-refresh{border-radius: 3px 3px 0 0}.s-hotsearch-content{position: absolute; background-color: #f0f8ff95; border-radius: 0 0 5px 5px;padding-right: 2px;}.s_ipt{margin:0!important;}.s_ipt_wr{border-radius: 10px 4px 4px 10px;border-radius: 10px 0 0 10px;background: #fff!important;}#qrcodeCon{display:none}body{position:fixed;_position:absolute;top:0;left:0;height:100%;width:100%;min-width:1000px;z-index:-10;background-position:center 0;background-repeat:no-repeat;background-size:cover;-webkit-background-size:cover;-o-background-size:cover;zoom:1;}");
        var inputsu=document.querySelector("input#su");
        var clickHandler=e=>{
            if(skinContainer)skinContainer.style.backgroundImage="";
            else inputsu.removeEventListener("click",clickHandler);
        };
        inputsu.addEventListener("click",clickHandler);
    }
    var bingImgObj=GM_getValue("bingImgObj");
    if(bingImgObj){
        skinContainer.style.backgroundImage = "url(\""+bingImgObj.base64+"\")";
    }
    var logo=document.querySelector("#s_lg_img_new");
    if(logo)logo.parentNode.removeChild(logo);
    logo=document.querySelector("#s_lg_img");
    var whiteData= "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhwAAAECCAMAAACCFP44AAACPVBMVEUAAAAGAgIFAgIEAAAEAAAEAAAEAAAEAQEGAgIEAAAEAAAEAQEEAQH+/v4EAAAEAAAEAAAEAAAEAAD29vb7+/v9/f3m5ub7+/vi4uLq6urw8PD+/v78/PzFxMTLysr9/f3////Y19f6+vr9/f3////19fXw8PDx8fH9/f319fXh4OD////+/v79/f3////r6+v///+ioaH6+vr9/f3+/v7n5+f////6+vq8u7v+/v6lpKT6+vr4+Pji4eH+/v76+vr19fX////u7u77+/uUkpK/vr7w8PD09PT7+/vv7+/////////////v7+/9/f339/f19fV5d3f+/v5WU1P+/v729vb9/f3z8/Pb2tr6+vrMy8v29vbm5uZkYmKEgoLg39/7+/v6+vrX1tb5+fn+/v7+/v79/f339/fr6+vn5+fj4uLg39/R0ND7+/vu7u7a2d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4QKU/zn4H81eCSuWv577b0GxINjPQ3DWRTPYqSHjArt0fvD1V9UfwO6b44v1A0r4FGq0AHhcEHC0efa0tPJlEVnBb9Lk//bgQAAAAABAkL/1IFcAAAAAAAAAAAAAAAAAAAAAMBKuxN5t6w9gAQAAAABJRU5ErkJggg==";
    if(logo && logo.src){
        if(/\/pcindex\_|bd\_logo1|img\/PCtm/.test(logo.src)){
            logo.src=whiteData;
            logo.style.display="initial";
        }
    }else{
        logo=document.querySelector(".index-logo-srcnew");
        if(logo)logo.parentNode.removeChild(logo);
        logo=document.querySelector("#lg>img");
        if(logo && logo.src && /.*\/img\/pcindex\_|bd\_logo1|img\/PCtm/.test(logo.src)){
            logo.src=whiteData;
            logo.style.display="initial";
        }
    }
    var input=document.querySelector("#kw");
    var headWrapper=document.querySelector("#head_wrapper");
    let inputHandler = e => {
        setTimeout(() => {
            if(headWrapper.children[0].id=="ent_sug"){
                if(skinContainer)skinContainer.style.backgroundImage="";
                skinContainer=null;
                input.removeEventListener('input', inputHandler);
            }
        }, 0);
    };
    input.addEventListener('input', inputHandler);
    GM_xmlhttpRequest({
        method: 'GET',
        url: "https://global.bing.com/HPImageArchive.aspx?format=js&idx=0&pid=hp&video=1&n=1",
        onload: function(result) {
            var jsonData=null;
            try {
                jsonData=JSON.parse(result.responseText);
                var bgUrl=jsonData.images[0].url;
                if(!/^https?:\/\//.test(bgUrl)){
                    bgUrl="https://global.bing.com"+bgUrl;
                }
                bingBgLink.title=jsonData.images[0].copyright;
                bingBgLink.href=bgUrl;
                if(bingImgObj && bingImgObj.url==bgUrl)return;
                if(skinContainer && !bingImgObj)skinContainer.style.backgroundImage="url(\""+bgUrl+"\")";
                GM_xmlhttpRequest({
                    method: 'GET',
                    url: bgUrl,
                    responseType: "blob",
                    onload: function(r) {
                        var blob=r.response;
                        var fr=new FileReader();
                        fr.readAsDataURL(blob);
                        fr.onload=function (e) {
                            var base64ImgData=e.target.result;
                            GM_setValue("bingImgObj",{url: bgUrl, base64: base64ImgData});
                        };
                    }
                });
            }catch (e) {
                console.log(e);
            }
        }
    });
})();