// ==UserScript== // @name 界面优化 // @namespace http://tampermonkey.net/ // @version 1.0.1.1 // @description 各种奇奇怪怪的界面优化 // @author YiJie // @license GPL-3.0-only // @create 2020-04-05 // @match https://www.baidu.com/ // @require https://cdn.jsdelivr.net/npm/notiflix@2.1.2/dist/AIO/notiflix-aio-2.1.2.min.js // @require https://greasyfork.org/scripts/399868-loadednode/code/loadedNode.js?version=789297 // @require https://greasyfork.org/scripts/399879-%E5%BC%B9%E7%AA%97/code/%E5%BC%B9%E7%AA%97.js?version=789809 // @grant GM_info // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @downloadURL none // ==/UserScript== (function() { 'use strict'; var scriptInfo = { "name":GM_info.script.name, "description":GM_info.script.description, "author":GM_info.script.author, "create":"2020-04-05", "version":GM_info.script.version, "greasyforkURL":GM_info.script.downloadURL, }; GM.setValue = GM_setValue; GM.getValue = GM_getValue; GM.deleteValue = GM_deleteValue; GM.registerMenuCommand = GM_registerMenuCommand; GM.unregisterMenuCommand = GM_unregisterMenuCommand; setTimeout(function(){ console.clear(); console.log("百度界面优化"); },1000); // 油猴菜单注册 (function(){ var showFloatWindow = GM.getValue("showFloatWindow"); if(typeof(showFloatWindow) == "undefined"){ GM.setValue("showFloatWindow",true); } function unregisterMenu(){ var commandId = GM.getValue("commandId"); if(commandId == "undefined"){ alert("出现了未知错误"); return; } GM.unregisterMenuCommand(commandId); } function setCommandEnd(commandName){ GM.setValue("commandId",GM.registerMenuCommand(commandName,function(){ unregisterMenu(); if(commandName==="关闭悬浮窗"){ setCommandEnd("开启悬浮窗"); $("#floatingWindow").css("display","none"); } else{ setCommandEnd("关闭悬浮窗"); $("#floatingWindow").css("display","block"); } })); } if(showFloatWindow){ setCommandEnd("关闭悬浮窗"); }else{ setCommandEnd("开启悬浮窗"); } })(); Notiflix.Notify.Init({ closeButton:true,position:"left-top", }); document.head.appendChild($('')[0]); var imgSrcList = [ "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/109102/10/11602/2078533/5e8a9efcE3dbd7188/f4c30be2b0d2fd61.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/102530/22/17587/2796415/5e8a9efcE07c76b38/d2e94e8cd4dba640.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/91101/7/17655/2626528/5e8a9efbE14b37c06/ec878e5182323a50.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/91573/35/17576/2626528/5e8a9ef8E090470a0/9418db7571d6fddc.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/103814/25/17682/1865827/5e8a9ef7E65128b8e/34ac83b5e3772619.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/92305/24/17542/1438179/5e8a9ee5Eca43e7be/0217fbe2fab829a0.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/113577/10/320/713889/5e8a9ee0Ef93dd670/cf6076544d62c0eb.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/107786/37/11536/2796415/5e8a9ed7E497a313e/f3ce2bcbc49151a8.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/86018/6/17661/153897/5e8a9ecbE7f31abaa/f6cbb785b6b306bf.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/117711/29/324/104293/5e8a9ecbEe5c94d72/1960887762a2aa02.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/103095/22/17494/66801/5e8a9ecbE6cf0b002/2b6388e6d2b852f4.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/118269/1/317/63110/5e8a9ecbEbab3dbbf/9b097034074b0060.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/103080/35/17809/99071/5e8a9ecbE95f6c668/a4a062afdb3111bb.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/104403/1/17693/147417/5e8a9eb2E8a061189/47beea29667b5bd2.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/95499/6/17443/34291/5e8a9eb2E79247a4a/0813bd831a7e85df.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/118015/10/300/45845/5e8a9eb2E6bc07770/57e9d05ef376dc53.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/102437/22/17591/15670/5e8a9eb2E9a658687/84be209b78df203a.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/115099/20/325/629657/5e8a9eacEff90dd1f/8f74e726a706ce0a.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/110280/11/11417/702510/5e8a9eacE9a89eb37/9ec88bb10b15dbe5.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/103205/7/17627/812191/5e8a9eaaE0702bc58/4f05e9316945cf9b.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/115295/4/300/147417/5e8a9ea9E90184eb4/c821f2221ce5b497.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/118785/33/334/15670/5e8a9ea9E1d565703/0b0256027bc932a1.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/113674/11/318/281618/5e8a9ea9Ebcdef47e/43f7be9e2c23bffd.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/104223/34/17685/249588/5e8a9ea8Ecde05776/c1121ed237189ad3.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/105674/39/17727/53831/5e8a9ea8E4e60c1de/1b8a6826b0805248.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/91664/25/17755/68840/5e8a9ea7Ef7dae624/0d2fb6ca6c1a4732.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/102693/22/17678/1779953/5e8a9e97E217b9546/16b7cf0ea0c5b5f3.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/108490/35/11410/333281/5e8a9e95Eddd3f5c4/fad2606b9da8178e.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/88457/4/17755/1287282/5e8a9e95Ebc9d0d4c/c74e4df955dc46b8.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/118299/7/326/447471/5e8a9e91E575de5b7/70ee62b95f1afa6e.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/111757/14/341/544550/5e8a9e91E56780dce/c9adc1b70807a6df.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/93430/19/17563/1130907/5e8a9e8dE0b9d134f/72e32660c5935dda.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/89026/15/17758/175077/5e8a9e8cEec0fcda9/0c52ce1c30be678e.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/118880/14/300/568586/5e8a9e80E3dad5259/6b163e35a8d2b303.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/86604/31/17775/297714/5e8a9e81E371684e7/136956f7c934e322.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/102023/3/17594/202898/5e8a9e80Ee91c806b/4be20cef9afbc3d0.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/109704/19/11336/775162/5e8a9e80Ea8f77dbc/ec40433f038c7956.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/110646/32/11370/240222/5e8a9e7fEa9acd589/419fca8df166e8e6.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/107848/5/11437/1544441/5e8a9e76Eeca8572e/a1a37e014f9cdd9d.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/110558/40/11415/1589360/5e8a9e71E86965664/da5ef120a92b77b0.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/115350/5/314/923177/5e8a9e72E9e132027/31b0c5b192344687.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/99655/2/17811/254165/5e8a9e6dE1c878aca/3a41a47f4bef952f.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/111025/31/304/172268/5e8a9e6dE7a71acd9/0b9f54c136f52dc3.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/95933/15/17601/38389/5e8a9e6cEe692a70d/41706e826461a5b5.png", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/114006/23/304/723677/5e8a9e41E09398de3/b22a91f83477496a.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/109114/35/11663/594932/5e8a9e40E462d7898/de65ecc5db87ff70.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/108198/34/11468/495367/5e8a9e40E2227db35/4c0f2aeda4875fef.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/114238/16/286/169306/5e8a9e3fE602e00be/6904942d600283f3.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/94542/36/17592/218647/5e8a9e3fEac9e2a7a/dec9fc15610c8d98.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/99527/18/17731/653576/5e8a9e3dEeab19a42/a8dcb493113649c1.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/115486/14/308/818657/5e8a9e3dEe6034e2f/a339485b0cb3f939.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/113305/2/302/1081556/5e8a9e3bEa3e26431/b1fb97c5a8ba34bf.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/96375/12/17699/1058704/5e8a9e3bE5ad6068d/aa0302ef55b427b4.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/98301/3/17662/815892/5e8a9e3aEe6479dfa/2668d7cd8646be16.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/107596/33/11450/347320/5e8a9e39E06e82889/7885bde76aa2334a.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/96869/6/17684/280168/5e8a9e36Eecff3347/3eb8b01cb1f61d3f.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/84824/12/17662/839301/5e8a9e32E69ed08a8/d905f11856d1941b.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/115730/34/289/1391978/5e8a9e31E3acef28d/f749d388681c4de8.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/106186/29/17674/661489/5e8a9e2fEb9961c83/fb8e14b6c81fe062.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/113194/13/333/517912/5e8a9e2dEc2f38da0/5b60b344976386e2.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/100946/7/17811/386801/5e8a9e2dEf8b89329/beb3a2ce2eacdc26.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/112174/24/319/398750/5e8a9e2cE41fe3020/c060b944deaa652d.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/110644/26/11381/763549/5e8a9e2bEf667531d/715133e6f511b0bd.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/116153/4/311/876780/5e8a9e03E3e855c4d/5805404fc92c06da.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/88909/2/17709/1316174/5e8a9e02Eebb4cb1e/effc944ae31cb874.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/112937/16/303/739530/5e8a9e00E653b6d13/24150a64618c43d4.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/102551/23/17871/419252/5e8a9dffE4555e57d/7bf7689f2bfde226.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/99376/32/17529/179156/5e8a9dffE170fefb8/2e864def2c747252.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/95116/35/17793/1022960/5e8a9dfbEaeca7c38/4908a39856afebc1.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/90503/27/17542/1242939/5e8a9dfaE83b8fdef/467603d2f878be9a.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/116600/7/308/171667/5e8a9df9Ee406ed6a/6bcd7f413cc163eb.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/95731/5/17694/553691/5e8a9df7E4335ea66/ddbf5e05fee7ab73.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/90230/18/17759/144999/5e8a9df7Ea5bdf75a/39b6459218adef7f.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/117320/28/292/162979/5e8a9df6E247cc04b/8afd11737ca4e10d.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/113220/7/312/137925/5e8a9df5E3679d6b2/9795beadc4e8b311.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/115870/16/276/674524/5e8a9deaE8105dd75/539e58808ed03402.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/91741/39/17634/153019/5e8a9deaEdf46abaa/fdbc7bb06003fb71.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/115440/22/318/1146940/5e8a9deaE46fb8bdb/8e9b73ea16b7a8af.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/107829/29/11361/145834/5e8a9de8E01a43804/f29e16f3e075cab5.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/106995/5/17679/144591/5e8a9de8Ed9c45741/4f5a3ba928fbcd16.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/97074/29/17770/148587/5e8a9de8E3fc25809/4746633125dae44a.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/88341/9/17550/146991/5e8a9de8Ec0225b66/1c3fa0cb5f80bd37.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/104749/35/17749/1182198/5e8a9ddaEd1dd7d90/7ab73b72cc1be049.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/86029/16/17861/1076106/5e8a9dd8E9c74b7a2/d323d86be464f851.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/111285/40/308/150995/5e8a9dd8E933d36ad/87eca568b36266bc.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/119009/25/326/228697/5e8a9dd7E918a05a0/2a3bea3086570618.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/97641/31/17547/173117/5e8a9dd7E6be1144c/0afa1a77911de727.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/90494/3/17700/70674/5e8a9dd7E374695ac/60427eb5e2ed0ad6.jpg", "http://free-cn-01.cdn.bilnn.com/ddimg/jfs/t1/115002/26/317/46614/5e8a9dd6Eed20bcfd/bbe9da2e9833cba2.jpg", ]; function cssToObj(css) { var regex = /([\w-]*)\s*:\s*([^;]*)/g; var match, properties={}; while(match=regex.exec(css)) properties[match[1]] = match[2].trim(); return properties; } function shareToQQ() { var p = { url: scriptInfo.greasyforkURL, showcount: '1', title: '我在油猴看到了一个超棒的脚本', desc: '这个脚本能帮助你美化PC端的百度界面,你也可以来试试 点击下载'+scriptInfo.greasyforkURL, style: '202', width: 105, height: 31 }; var s = []; for (var i in p) { s.push(i + '=' + encodeURIComponent(p[i] || '')); } $(['分享'].join(''))[0].click(); } function copyText(text){ let input = document.createElement('input'); input.setAttribute('readonly', 'readonly'); input.setAttribute('value', text); document.body.appendChild(input); input.setSelectionRange(0, 9999); input.select(); if (document.execCommand('copy')) { document.execCommand('copy'); } document.body.removeChild(input); Notiflix.Notify.Success('复制成功'); } function uuid() { var s = []; var hexDigits = "0123456789abcdef"; for (var i = 0; i < 36; i++) { s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); } s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010 s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01 s[8] = s[13] = s[18] = s[23] = "-"; var uuid = s.join(""); return uuid; } function setBackgroundImg(sel){ // 点击了随机按钮 if(sel===-1){ GM.setValue("starIndex",-1); } const starIndex = GM.getValue("starIndex"); function loadImg(src){ let img=new Image(); img.src=imgSrcList[sel]; img.onload=function(){ $('#head').css({ "background-position": "center", "background-color": "black", "background-size": "100%", "background-repeat": "repeat-y", "background-image":"url('"+src+"')", "transition":"1s", }); setTimeout(function(){ $('#head').css({ "background-color": "white", }); },1000); }; } if(typeof(starIndex)==="undefined"||starIndex===-1){ if(sel===-1) sel = Math.round(Math.random()*imgSrcList.length); loadImg(imgSrcList[sel]); GM.setValue("backImgSelect",sel); }else{ const backImgdataList = GM.getValue("backImgdataList"); if(typeof(backImgdataList)==="undefined"){ GM.setValue("backImgdataList",[]); backImgdataList = []; } for (let index = 0; index < backImgdataList.length; index++) { console.log(backImgdataList[index].uuid); if(backImgdataList[index].uuid === starIndex){ loadImg(backImgdataList[index].url); break; } } } } function initBaiduView(){ // 删除不必要的部分 (function(){ $('html').css(cssToObj("overflow:hidden;")); $('#su').css(cssToObj("display: none;")); $('div#u1').css(cssToObj("display: none;")); $('div#bottom_layer.s-bottom-layer').css(cssToObj("display: none;")); $('div#qrcodeCon').css(cssToObj("display: none;")); $('div#s_top_wrap').css(cssToObj("display: none;")); $('div#s_upfunc_menus').css(cssToObj("display: none;")); $('div#u_sp').css(cssToObj("display: none;")); })(); // 设置自定义的logo (function(){ $('#lg').css(cssToObj("display: none;")); $('body').append("\