百度去广告,blur(毛玻璃)搜索框,美化

百度搜索框背景模糊,去广告,美化

目前为 2021-01-24 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name 百度去广告,blur(毛玻璃)搜索框,美化
  3. // @version 21.01.25.02
  4. // @description 百度搜索框背景模糊,去广告,美化
  5. // @author L
  6. // @include *://www.baidu.com/
  7. // @include *://www.baidu.com/?tn*
  8. // @include *://www.baidu.com/s?*
  9. // @include *://www.baidu.com/*wd*
  10. // @include *://www.baidu.com/search/*
  11. // @include *://baidu.com/
  12. // @include *://baidu.com/s?*
  13. // @include *://baidu.com/*wd*
  14. // @include *://baidu.com/search/*
  15. // @grant none
  16. // @namespace L-BaiduBlur
  17. // @homepage https://www.ihawo.com
  18. // @run-at document-start
  19. // ==/UserScript==
  20. (function() {
  21. class Blur {
  22. constructor() {
  23. var _this = this;
  24. this.updata = 1;
  25. this.attrNum = 1;
  26. this.initStatus = 1;
  27. this.right = localStorage.getItem('blur-right');
  28. this.beautify = localStorage.getItem('blur-beautify');
  29. this.tab = localStorage.getItem('blur-tab');
  30. this.indexHide = localStorage.getItem('blur-index-hide');
  31. this.indexAutoHideNews = localStorage.getItem('blur-index-auto-hide-news');
  32. this.indexAutoHideHot = localStorage.getItem('blur-index-auto-hide-hot');
  33. this.inMiddle = localStorage.getItem('blur-in-middle');
  34. this.hideBaijia = localStorage.getItem('blur-hide-baijia');
  35. this.bg = localStorage.getItem('blur-bg');
  36. this.browser = myBrowser();
  37. this.css = 0;
  38. this.showSetting = 0;
  39. this.removeAdTimer = '';
  40. this.tabTimer = '';
  41. this.removeAdTimes = 0;
  42. this.init = function () {
  43. _this.addBaseStyle();
  44. window.onload = function () {
  45. $.fn.resizeEnd = function (callback, timeout) {
  46. $(this).resize(function () {
  47. var $this = $(this);
  48. if ($this.data('resizeTimeout')) {
  49. clearTimeout($this.data('resizeTimeout'));
  50. }
  51. $this.data('resizeTimeout', setTimeout(callback, timeout));
  52. });
  53. };
  54. $(window).resizeEnd(_this.doInMiddle, 200)
  55. if (_this.browser == 'Chrome') {
  56. var version = getChromeVersion();
  57. if (version >= 76) {
  58. _this.css = 1;
  59. }
  60. }
  61. else if (_this.browser == 'Safari') {
  62. _this.css = 1;
  63. }
  64. $('#form').submit(function(){
  65. if (_this.hideBaijia == 1) {
  66. var searchStr = $("#kw").val();
  67. if (searchStr.indexOf('-baijia') == -1) {
  68. $("#kw").val($("#kw").val() + ' -baijia');
  69. $('#form').submit();
  70. return false;
  71. }
  72. }
  73. })
  74. $('#kw').bind("input propertychange",function(event){
  75. _this.doBg();
  76. });
  77. _this.addSettingDiv();
  78. _this.initTab();
  79. _this.initBlur();
  80. _this.initShowRight();
  81. _this.initBeautify();
  82. _this.initIndexHide();
  83. _this.initIndexAutoHideNews();
  84. _this.initIndexAutoHideHot();
  85. _this.initInMiddle();
  86. _this.removeAd();
  87. _this.initHideBaijia();
  88. _this.initBg();
  89. _this.initStatus = 0;
  90. $("html").fadeIn(300);
  91. var rbl = $("#content_right").css('border-left-width');
  92. rbl = rbl ? rbl : '';
  93. rbl = parseInt(rbl.replace('px', ''));
  94. if (rbl == 0) {
  95. // $(".page-inner a").each(function(){
  96. // var href = $(this).attr('href');
  97. // $(this).data('href', href).attr('href', '#');
  98. //
  99. // })
  100. // $(".page-inner a").mousemove(function(){
  101. // $(".page-inner a").unbind('mouseover')
  102. // })
  103. // $(".page-inner a").click(function(){
  104. // // $("html").hide();
  105. // // var href = $(this).data('href');
  106. // // setTimeout(function(){
  107. // // //window.location.href = href
  108. // // }, 100)
  109. // })
  110. }
  111.  
  112. };
  113. };
  114. this.addSettingDiv = function () {
  115. $('html').append('<div style="width:300px;height:500px;background:white;position: fixed;z-index: 999999999999999999999;top:15%;left:0;right:0;margin-right: auto;margin-left:auto;box-shadow:0px 0px 10px 2px #ccc;border-radius: 10px;display:none;padding: 10px;" id="bsetting"><div style="font-size:18px;padding: 15px;">blur插件设置</div></div>');
  116. var option = '<span class="c-gap-left showBsetting"><label><span>显示插件设置</span></label></span>';
  117. $(".search_tool_conter").append(option);
  118. var indexOption = '<a class="showBsetting" href="javaScript:;">插件设置</a>';
  119. $("#s-user-setting-menu").append(indexOption);
  120. setTimeout(function(){
  121. $(".bdpfmenu").append(indexOption);
  122. }, 2000)
  123.  
  124. $("html").on('click', '.showBsetting', function () {
  125. $("#bsetting").fadeIn(300);
  126. $("#wrapper").css("filter", 'blur(15px)');
  127. $("#blur-search-bg").css("filter", 'blur(15px)');
  128. $("#wrapper *").css("pointer-events", 'none');
  129. setTimeout(function () {
  130. _this.showSetting = 1;
  131. }, 500);
  132. });
  133. $("html").on('click', '#wrapper', function () {
  134. if (_this.showSetting) {
  135. $("#bsetting").fadeOut(300);
  136. $("#wrapper").css("filter", '');
  137. $("#blur-search-bg").css("filter", '');
  138. $("#wrapper *").css("pointer-events", 'auto');
  139. _this.showSetting = 0;
  140. }
  141. });
  142. };
  143. this.addBaseStyle = function () {
  144. var style = document.createElement('style');
  145. style.type = 'text/css';
  146. style.innerHTML = ".result,.c-container,.result div,.c-container div,#t_tab,#head,#u,.s_form,#content_right,.container_l{transition:all 0.3s ease} #content_right>div{display:none}.soutu-btn{background: url(https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/soutu/img/camera_new_5606e8f.png) no-repeat;}#pageBulrBg{pointer-events:none}.wrapper_new #u{margin: 15px 0 0;}";
  147. document.getElementsByTagName('html').item(0).appendChild(style);
  148. if (_this.beautify == 1 || _this.beautify == null) {
  149. var style = document.createElement('style');
  150. style.type = 'text/css';
  151. style.className = 'mainStyle';
  152. style.innerHTML = "document,html,body,.c-table th,#page,.wrapper_new #form .bdsug-new{background:#eee} #page .fk,a .fk,.qrcodeCon{display:none} #s_tab{height:47px} em{ color: #ce4343;} .result a,.c-container a,.result-op a,.result em,.c-container em,.result-op em,#u a{text-decoration:none!important;} a{color:#4879BD} #rs{background:none;padding:20px} #rs a{text-decoration:none} #page a, #page strong{height:auto;background:none;border:none} #page .pc,#page .n{border: 1px solid #eee;} #s_tab{background:none} .c-border{border: none; box-shadow: none;} #foot,#help{background:none}#u{margin-top:30px} #s_tab{padding-top:86px } .c-border{padding:0;background:none}.result-op>tbody>tr>td{padding:20px!important}@media screen and (max-width: 1216px){.result,.c-container,.result-op,.result-op>tbody>tr>td{padding:15px;}}";
  153. if (document.URL.indexOf('wd=') != -1) {
  154. style.innerHTML = "document,html,body,.c-table th,#page{background:#eee} #page .fk,a .fk,.qrcodeCon{display:none} #s_tab{height:47px} #content_left>.result:hover,#content_left>.c-container:hover,.result-op:not(.xpath-log):hover{box-shadow: 5px 5px 7px #ccc;} .result>div,.c-container>div,.result-op>div{margin:10px 0} .result,.c-container,.result-op{background:#fafafa;padding:20px;border-radius: 5px;box-shadow: 5px 5px 7px #ddd;transition:all 0.3s;margin: 0 15px 25px 0!important;} em{ color: #ce4343;} .result a,.c-container a,.result-op a,.result em,.c-container em,.result-op em,#u a{text-decoration:none!important;} a{color:#4879BD} #rs{background:none;padding:20px} #rs a{text-decoration:none} #page a, #page strong{height:auto;background:none;border:none} #page .pc,#page .n{border: 1px solid #eee;} #s_tab{background:none} .c-border{border: none; box-shadow: none;} #foot,#help{background:none}#u{margin-top:30px} #s_tab{padding-top:86px }body,#head{background:#eee}#head{height: 86px;top:0} .c-border{padding:0;background:none}.result-op>tbody>tr>td{padding:20px!important}@media screen and (max-width: 1216px){.result,.c-container,.result-op>tbody>tr>td{padding:15px;}}";
  155. }
  156. document.getElementsByTagName('html').item(0).appendChild(style);
  157. }
  158. };
  159. this.initShowRight = function () {
  160. if (_this.right == undefined || _this.right == null) {
  161. _this.right = 1;
  162. localStorage.setItem('blur-right', 1);
  163. }
  164. _this.isShowRight();
  165. $(function () {
  166. _this.addShowRightTool();
  167. });
  168. };
  169. this.initBeautify = function () {
  170. if (_this.beautify == undefined || _this.beautify == null || _this.beautify == 1) {
  171. _this.beautify = 1;
  172. localStorage.setItem('blur-beautify', 1);
  173. }
  174. _this.doBeautify();
  175. $(function () {
  176. _this.addBeautifyTool();
  177. _this.doBeautify();
  178. $(".head_wrapper").on('DOMNodeInserted', function (e) {
  179. if (e.target.id == 'ent_sug') {
  180. setTimeout(function () {
  181. _this.doBeautify();
  182. }, 100);
  183. }
  184. });
  185. $(document).ajaxSuccess(function (_e, _xhr, opt) {
  186. var url = opt.url;
  187. if (url.indexOf('submit/setuskin') != -1) {
  188. _this.doBeautify();
  189. }
  190. });
  191. $('#kw').on('change', function () {
  192. if ($('.s-skin-container').length > 0) {
  193. setTimeout(function () {
  194. _this.doBeautify();
  195. }, 50);
  196. }
  197. });
  198. });
  199. };
  200. this.initBlur = function () {
  201. if (_this.css) {
  202. $(function () {
  203. _this.blur();
  204. });
  205. }
  206. else {
  207. $('html').append('<style></style>');
  208. $(function () {
  209. $(window).scroll(function () {
  210. var top = $(window).scrollTop();
  211. $("#headerBulrBg").css('top', -top + "px");
  212. });
  213. $(document).ajaxSend(function (_e, _xhr, opt) {
  214. var url = opt.url;
  215. if (url.indexOf('/s?') != -1 && (url.indexOf('&wd=') != -1 || url.indexOf('?wd=') != -1) && url.indexOf('&_ck=') == -1) {
  216. $(".headBgDiv").remove();
  217. }
  218. });
  219. _this.blur();
  220. });
  221. }
  222. $(function () {
  223. $(document).ajaxSuccess(function (_e, _xhr, opt) {
  224. var url = opt.url;
  225. if (url.indexOf('/s?') != -1 && (url.indexOf('&wd=') != -1 || url.indexOf('?wd=') != -1) && url.indexOf('&_ck=') == -1) {
  226. setTimeout(function () {
  227. _this.addShowRightTool();
  228. _this.addBeautifyTool();
  229. _this.addTabTool();
  230. _this.addIndexHideTool();
  231. _this.addInMiddleTool();
  232. _this.doBeautify();
  233. $("#bIndexHide").remove();
  234. $("#s_upfunc_menus,#u_sp,#s_upfunc_menus *,#u_sp *").unbind('mouseover').unbind('mouseout');
  235. setTimeout(function () {
  236. _this.removeAd();
  237. }, 2300);
  238. _this.removeAd();
  239. _this.blur();
  240. _this.doInMiddle();
  241. }, 100);
  242. }
  243.  
  244. if (url.indexOf('data/mancardwater') != -1) {
  245. _this.removeAd();
  246. }
  247. });
  248. $("#wrapper_wrapper").on('DOMNodeInserted', function (e) {
  249. if (e.target.id == "container" && e.target.class == undefined) {
  250. setTimeout(function () {
  251. _this.addShowRightTool();
  252. _this.addBeautifyTool();
  253. _this.addTabTool();
  254. _this.addIndexHideTool();
  255. _this.addInMiddleTool();
  256. _this.doBeautify();
  257. _this.removeAd();
  258. _this.blur();
  259. _this.doInMiddle();
  260. $("#bIndexHide").remove();
  261. $("#s_upfunc_menus,#u_sp,#s_upfunc_menus *,#u_sp *").unbind('mouseover').unbind('mouseout');
  262. }, 100);
  263. }
  264. });
  265. });
  266. };
  267. this.initTab = function () {
  268. if (_this.tab == undefined || _this.tab == null) {
  269. _this.tab = 0;
  270. localStorage.setItem('blur-tab', 0);
  271. }
  272. _this.setTab();
  273. $(function () {
  274. _this.addTabTool();
  275. });
  276. };
  277. this.addShowRightTool = function () {
  278. if ($('.blur-right').length == 0) {
  279. var checked = 'checked';
  280. if (_this.right == 0) {
  281. checked = '';
  282. }
  283. var option = '<div class="c-gap-left" style="font-size:14px;padding: 5px 0;"><label><input type="checkbox" class="blur-right" style="margin-top:3px;vertical-align:middle; " ' + checked + ' ><span style="vertical-align:middle;cursor: pointer;">显示右侧</span></label></div>';
  284. $("#bsetting").append(option);
  285. setTimeout(function () {
  286. $(".blur-right").change(_this.toggleRight);
  287. }, 50);
  288. }
  289. };
  290. this.isShowRight = function () {
  291. if (_this.right == 0) {
  292. $('html').append("<style class='bright'>#content_right{opacity:0} </style>");
  293. setTimeout(function () {
  294. if (_this.right == 0) {
  295. $(".bright").text('#content_right{display:none}');
  296. }
  297. }, 500);
  298. }
  299. else {
  300. $('.css-blur-right').remove()
  301. $(".bright").text('#content_right{opacity:0}');
  302. setTimeout(function () {
  303. if (_this.right == 1) {
  304. $(".bright").text('#content_right{opacity:1}');
  305. }
  306. }, 100);
  307. setTimeout(function () {
  308. if (_this.right == 1) {
  309. $(".bright").remove();
  310. }
  311. }, 500);
  312. }
  313. _this.setTab();
  314. };
  315. this.toggleRight = function () {
  316. if (this.checked) {
  317. _this.right = 1;
  318. localStorage.setItem('blur-right', 1);
  319. }
  320. else {
  321. _this.right = 0;
  322. localStorage.setItem('blur-right', 0);
  323. }
  324. _this.isShowRight();
  325. _this.doInMiddle(true);
  326. };
  327. this.beautifyLogo = function () {
  328. if (_this.isNotHaveBackGround()) {
  329. if (_this.beautify != 0) {
  330. $("#lg img,#result_logo img").attr('src', 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuWbvuWxgl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgMTAxIDMzIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxMDEgMzM7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojNDg3OUJEO30KCS5zdDF7ZmlsbDojREQ0NDM2O30KCS5zdDJ7ZmlsbDojRkZGRkZGO30KPC9zdHlsZT4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTUwLjQsMTUuM2MtMy44LDAuMy00LDIuNi01LjcsNC43Yy0xLjgsMi4yLTUuNSw0LjEtNiw2LjdjLTAuNiwzLjMsMS4zLDUuMSwzLDUuN2MxLjksMC42LDYuMi0wLjUsOC40LTAuNWgwLjIKCWgwLjJjMi4yLDAsN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LjktMS44LDIuMlYyNWMwLjEsMi4xLTAuNCw0LjQtMS4xLDYuN2wxLjksMC42CglDODcuOSwyOS45LDg4LjMsMjcuNiw4OC4zLDI1LjJ6Ii8+CjxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik00Ni4zLDI0LjJjMC42LDAsMS4yLDAuMSwxLjcsMC40djMuNGMwLDAuMy0wLjYsMS0xLjksMWMtMS41LDAtMS44LTAuNi0xLjgtMi4xdi0wLjYKCUM0NC4yLDI0LjgsNDQuNywyNC4yLDQ2LjMsMjQuMnogTTQ5LjIsMjAuN0g0OHYyLjVDNDcuNiwyMy4xLDQ3LDIzLDQ2LjMsMjNjLTIuNywwLTMuMywxLTMuMywzLjV2MC4zYzAsMi40LDAuOSwzLjMsMy4yLDMuMwoJYzAuOCwwLDEuMy0wLjEsMS44LTAuNWwwLjEsMC42aDEuMUw0OS4yLDIwLjdMNDkuMiwyMC43eiIvPgo8cGF0aCBjbGFzcz0ic3QyIiBkPSJNNTYuNywyM2gtMS4ydjUuMmMtMC42LDAuNC0xLjcsMC42LTIuNCwwLjZjLTAuOCwwLTEtMC40LTEtMS4zdi00LjZoLTEuMXY0LjhjMCwxLjYsMC41LDIuMywyLjEsMi4zCgljMSwwLDIuMS0wLjMsMi42LTAuNmwwLjEsMC42aDEuMVYyM3oiLz4KPHBhdGggY2xhc3M9InN0MSIgZD0iTTkyLjcsMTUuN2MwLTAuNywwLjYtMS4zLDEuMi0xLjNjMC42LDAsMS4yLDAuNiwxLjIsMS4zUzk0LjUsMTcsOTMuOSwxN0M5My4zLDE2LjksOTIuNywxNi4zLDkyLjcsMTUuN3oiLz4KPC9zdmc+Cg==');
  331. }
  332. else {
  333. $("#lg img,#result_logo img").attr('src', '//www.baidu.com/img/bd_logo1.png?where=super');
  334. }
  335. }
  336. };
  337. this.addBeautifyTool = function () {
  338. var checked = 'checked';
  339. if (_this.beautify == 0) {
  340. checked = '';
  341. }
  342. if ($('.blur-beautify').length == 0) {
  343. var option = '<div class="c-gap-left" style="font-size:14px;padding: 5px 0;"><label><input type="checkbox" class="blur-beautify" style="margin-top:3px;vertical-align:middle;" ' + checked + ' ><span style="vertical-align:middle;cursor: pointer;">美化</span></label></div>';
  344. $("#bsetting").append(option);
  345. setTimeout(function () {
  346. $(".blur-beautify").change(_this.toggleBeautify);
  347. }, 50);
  348. }
  349. };
  350. this.toggleBeautify = function () {
  351. if (this.checked) {
  352. _this.beautify = 1;
  353. localStorage.setItem('blur-beautify', 1);
  354. }
  355. else {
  356. _this.beautify = 0;
  357. localStorage.setItem('blur-beautify', 0);
  358. }
  359. _this.doBeautify();
  360. };
  361. this.doBeautify = function () {
  362. $(".headBgDiv").remove();
  363. if (_this.beautify == 1 || _this.beautify == null) {
  364. _this.beautifyLogo();
  365. $(function () {
  366. _this.beautifyLogo();
  367. });
  368. var style = "<style class='mainStyle'>document,html,body,.c-table th,#page,#s_top_wrap,.wrapper_new #form .bdsug-new{background:#eee} #page .fk,a .fk,.qrcodeCon{display:none} #s_tab{height:47px} em{color: #ce4343;} .result a,.c-container a,.result-op a,.result em,.c-container em,.result-op em,#u a{text-decoration:none!important;} a{color:#4879BD} #rs{background:none;padding:20px} #rs a{text-decoration:none} #page a, #page strong{height:auto;background:none;border:none} #page .pc,#page .n{border: 1px solid #eee;} #s_tab{background:none} .c-border{border: none; box-shadow: none;} #foot,#help{background:none}.wrapper_new .fix-head #u{margin-top:12px} #s_tab{padding-top:86px } .c-border{padding:0;background:none}.result-op>tbody>tr>td{padding:20px!important}@media screen and (max-width: 1216px){.result,.c-container,.result-op,.result-op>tbody>tr>td{}} #s_kw_wrap,#bottom_layer{background:#eee!important} #head .new-ipt-focus{background:#eee} .s_ipt_wr,.s_ipt_wr.bg{background: rgba(255,255,255,0.75)}";
  369. if (_this.isNotHaveBackGround() && (_this.initStatus == 0 || document.URL.indexOf('wd=') != -1 || document.URL.indexOf('word=') != -1)) {
  370. style += 'body,#head{background:#eee} .s_form{padding-top: 13px}#s_kw_wrap,#s_top_wrap,#bottom_layer{background:none!important}';
  371. }
  372. if (_this.isNotHaveBackGround()) {
  373. style += '#head_wrapper .soutu-env-nomac #form #kw{background:rgba(0,0,0,0)}#head_wrapper.s-down .soutu-env-nomac #form #kw{background:white}#head_wrapper .ipt_rec, #head_wrapper .soutu-btn{background-color:rgba(0,0,0,0)}';
  374. }
  375. if (!_this.isNotHaveBackGround()) {
  376. style += '#s_top_wrap{background:rgba(0,0,0,.2)!important}#bottom_layer{background:#eee!important}#s_kw_wrap{background:none!important}';
  377. }
  378. if ($('.tab-wrapper b').text() == '资讯') {
  379. style += '#head .bdsug{top: 59px;}';
  380. }
  381. if (_this.css) {
  382. //style += '#head .new-ipt-focus{background: rgba(255,255,255,0.75)} #head #form .bdsug-new{background: rgba(255,255,255,0.75);backdrop-filter: blur(15px)}';
  383. }
  384. var url = window.location.href;
  385. if (url.indexOf('wd=') != -1) {
  386. style += '#head{height: 86px;top:0}.result:hover,.c-container:hover,.result-op:not(.xpath-log):hover{box-shadow: 5px 5px 7px #ccc;}.result>div,.c-container>div,.result-op>div{margin:10px 0} #content_left>.result,#content_left>.c-container,#content_left>.result-op,#content_left>#unsafe_content>.result,#content_left>#unsafe_content>.c-container,#content_left>#unsafe_content>.result-op{background:#fafafa;padding:20px;border-radius: 5px;transition:all 0.3s;margin: 0 15px 25px 0!important;width:560px}.wrapper_new #result_logo{margin-top: 10px;}';
  387.  
  388. }
  389. if ( url.indexOf('word=') != -1) {
  390. style += '#head{height: 86px;top:0}.result:hover,.c-container:hover,.result-op:not(.xpath-log):hover{box-shadow: 5px 5px 7px #ccc;}.result>div,.c-container>div,.result-op>div{margin:10px 0} #content_left>div>.c-container,#content_left>.result,#content_left>.c-container,#content_left>.result-op,#content_left>#unsafe_content>.result,#content_left>#unsafe_content>.c-container,#content_left>#unsafe_content>.result-op{background:#fafafa;padding:20px;border-radius: 5px;transition:all 0.3s;margin: 0 15px 25px 0!important;width:560px}.wrapper_new #result_logo{margin-top: 10px;}';
  391. style += '#gotoPage{padding: 10px 35px;}'
  392. }
  393. style += '.wrapper_new #head.fix-head #result_logo,.wrapper_new #head.fix-head .fm{margin-top: 7px;}.wrapper_new .fm{margin-top: 10px;}.wrapper_new #s_tab{ padding-top: 80px;}.new-pmd .c-border{box-shadow:none}';
  394. style += '</style>';
  395. $(".mainStyle").remove();
  396. $("html").append(style);
  397. }
  398. else {
  399. $(".mainStyle").remove();
  400. }
  401. setTimeout(function () {
  402. _this.setTab();
  403. _this.blur();
  404. }, 350);
  405. };
  406. this.isNotHaveBackGround = function () {
  407. return ($('.s-skin-container').length == 0 || $('.s-skin-container').attr('style') == null || $('.s-skin-container').attr('style').indexOf('background-image') == -1);
  408. };
  409. this.removeAd = function () {
  410. if ($('.tab-wrapper b').text() != '资讯') {
  411. $('#content_left>div:not(.c-container):not(#unsafe_content):not(#super_se_tip):not(.video_list_container):not(.result)').remove();
  412. }
  413. if (_this.removeAdTimer) {
  414. clearInterval(_this.removeAdTimer);
  415. _this.removeAdTimes = 0;
  416. }
  417. _this.removeAdTimer = setInterval(function(){
  418. $(".c-container>.f13").each(function () {
  419. var text = $(this).text();
  420. if (text.indexOf('广告') != -1) {
  421. $(this).parents('.c-container').remove();
  422. }
  423. });
  424. $(".c-span-last span").each(function () {
  425. var text = $(this).text();
  426. if (text.indexOf('广告') != -1) {
  427. $(this).parents('.c-container').remove();
  428. }
  429. });
  430. _this.removeAdTimes++;
  431. if ( _this.removeAdTimes > 50) {
  432. clearInterval(_this.removeAdTimer);
  433. _this.removeAdTimes = 0;
  434. }
  435. }, 300)
  436.  
  437. $(".c-container>.f13").each(function () {
  438. var text = $(this).text();
  439. if (text.indexOf('广告') != -1) {
  440. $(this).parents('.c-container').remove();
  441. }
  442. });
  443.  
  444. $(".ad-icon").parents('.s-news-item').remove();
  445. $("#ecomScript").remove();
  446. $("#m").remove();
  447. $("#s_lm_wrap").remove();
  448. $('#content_right>div').remove();
  449. $("#con-ar").next().remove();
  450. $(".t>a").unbind('click').click(function () { window.open($(this).attr('href')); return false; });
  451. };
  452. this.blur = function () {
  453. if (_this.css) {
  454. if (_this.isNotHaveBackGround() && ((!$("#u_sp").length || $("#u_sp").is(':hidden')) && (!$("#u1").length || $("#u1").is(':hidden')))) {
  455. if ((document.URL.indexOf('wd=') != -1 || document.URL.indexOf('word=') != -1)) {
  456. $('#head').css({ 'backdrop-filter': 'blur(15px)' });
  457. }
  458.  
  459. if (_this.tab == 1 && _this.beautify) {
  460. console.log(_this.tab)
  461. $('#page').css({ 'backdrop-filter': 'blur(15px)', 'background': 'rgba(238, 238, 238, 0.5)', 'z-index': '1000' });
  462. }
  463. }
  464. setTimeout(function () {
  465. $('#head').css({ 'background': 'rgba(0,0,0,0)' });
  466. _this.doBg();
  467. }, 1000);
  468. $("#s_kw_wrap").css({ 'background': 'rgba(255,255,255,0.8)' });
  469. _this.removeAd();
  470. _this.doBg();
  471. }
  472. else {
  473. var top = -$(window).scrollTop();
  474. var subHeight = $('#head').outerHeight();
  475. var headBgDiv = '<div style="height:' + subHeight + 'px;width:100%;overflow:hidden;position: absolute;top:0;z-index:-1;display: inline-block;left:0" id="headBgDiv" class="headBgDiv"><div style="position: absolute;top: ' + top + 'px;left: 0;width:100%;filter: blur(13px);z-index: -1" class="bulrBg" id="headerBulrBg"></div>';
  476. if (_this.isNotHaveBackGround() && ((!$("#u_sp").length || $("#u_sp").is(':hidden')) && (!$("#u1").length || $("#u1").is(':hidden')))) {
  477. $(".headBgDiv").remove();
  478. $('#head').prepend(headBgDiv);
  479. }
  480. else {
  481. $(".headBgDiv").remove();
  482. }
  483. $('#wrapper_wrapper #container').addClass('container_l');
  484. _this.removeAd();
  485. $(".bulrBg").append($('#s_tab').clone());
  486. $(".bulrBg").append($('#wrapper_wrapper').clone());
  487. $(".headBgDiv #c-tips-container").remove();
  488. }
  489. };
  490. this.addTabTool = function () {
  491. var checked = 'checked';
  492. if (_this.tab == 0) {
  493. checked = '';
  494. }
  495. if ($('.blur-tab').length == 0) {
  496. var option = '<div class="c-gap-left" style="font-size:14px;padding: 5px 0;"><label><input type="checkbox" class="blur-tab" style="margin-top:3px;vertical-align:middle;" ' + checked + ' ><span style="vertical-align:middle;cursor: pointer;">多列显示(只对大屏幕有效)</span></label></div>';
  497. $("#bsetting").append(option);
  498. setTimeout(function () {
  499. $(".blur-tab").change(_this.toggleTab);
  500. }, 50);
  501. }
  502. };
  503. this.toggleTab = function () {
  504. if (this.checked) {
  505. _this.tab = 1;
  506. localStorage.setItem('blur-tab', 1);
  507. }
  508. else {
  509. _this.tab = 0;
  510. localStorage.setItem('blur-tab', 0);
  511. }
  512. _this.setTab();
  513. _this.doInMiddle(true);
  514. };
  515. this.setTab = function () {
  516. $("#bTab").remove();
  517. if ($('.s_tab_inner b').text() == '视频') {
  518. return;
  519. }
  520. if (_this.tab == 1) {
  521. var column = _this.right == 1 ? 2 : 3;
  522. if ($('.tab-wrapper b').text() == '资讯') {
  523. column = 3;
  524. }
  525. var style = '<style id="bTab"> @media screen and (max-width: 1800px){#s_tab{padding-left: 20px!important;}#container{margin-left: 20px!important;}}@media screen and (min-width: 1635px){#content_left,#container.sam_newgrid #content_left,#rs_top_new{width:1205px;}.cr-offset{padding-left: 35px;}';
  526. if (column == 3) {
  527. style = '<style id="bTab">@media screen and (min-width: 1635px){#content_left,#container.sam_newgrid #content_left,#rs_top_new{width:95%;}';
  528. }
  529. if (_this.isNotHaveBackGround() && ((!$("#u_sp").length || $("#u_sp").is(':hidden')) && (!$("#u1").length || $("#u1").is(':hidden')))) {
  530. style += 'html{padding-bottom:50px}';
  531. }
  532. if (_this.beautify == 1) {
  533. style += '#page{position: fixed;bottom: 0;width: 100%;padding: 15px 0;text-align: center;margin: 0;}#foot{margin-top:10px}html #page .pc, #page .n{border-color:rgba(0,0,0,0.35);text-shadow: 0 0 17px #666;}#page a{ color: rgba(30,30,30,0.75);}#page strong{background: rgba(51,136,255,0.7)!important;color: white;}#page .n:hover, #page a:hover .pc{background: rgba(51,136,255,0.7)!important;color: white;border-color: rgba(51,136,255,0.5)!important;}.wrapper_new .container_new~#page strong, .wrapper_new .container_new~#page a{background-color: rgba(255,255,255,0.75);}';
  534. }
  535. if (column == 3) {
  536. style += '.wrapper_new #content_left,.wrapper_new #s_tab{padding-left:20px}#container.sam_newgrid{margin-left:20px} #content_left,#container.sam_newgrid #content_left, #rs_top_new{width:100%}.wrapper_new .search_tool_conter, .wrapper_new .nums, .wrapper_new #rs, .wrapper_new .hint_common_restop{margin-left:20px}'
  537. }
  538. var w = '1617px';
  539. var rbl = $("#content_right").css('border-left-width');
  540. rbl = rbl ? rbl : '';
  541. rbl = parseInt(rbl.replace('px', ''));
  542. if (rbl != 0) {
  543. w = '1800px';
  544. }
  545. if (column == 3) {
  546. w = '95%';
  547. }
  548. style += '#container.sam_newgrid,#container{width:' + w + '}#content_left{column-count: ' + column + ';column-width:560px}.result,.c-container{-moz-page-break-inside:avoid;-webkit-column-break-inside:avoid;break-inside:avoid;margin:15px}}</style>';
  549. $('html').append(style);
  550. }
  551. };
  552. this.initIndexHide = function () {
  553. if (_this.indexHide == undefined || _this.indexHide == null) {
  554. _this.indexHide = 0;
  555. localStorage.setItem('blur-index-hide', 0);
  556. }
  557. _this.doIndexHide();
  558. $(function () {
  559. _this.addIndexHideTool();
  560. });
  561. };
  562. this.addIndexHideTool = function () {
  563. if ($('.blur-index-hide').length == 0) {
  564. var checked = 'checked';
  565. if (_this.indexHide == 0) {
  566. checked = '';
  567. }
  568. var option = '<div class="c-gap-left" style="font-size:14px;padding: 5px 0;"><label><input type="checkbox" class="blur-index-hide" style="margin-top:3px;vertical-align:middle; " ' + checked + ' ><span style="vertical-align:middle;cursor: pointer;">首页简化</span></label></div>';
  569. $("#bsetting").append(option);
  570. setTimeout(function () {
  571. $(".blur-index-hide").change(_this.toggleIndexHide);
  572. }, 50);
  573. }
  574. };
  575. this.doIndexHide = function () {
  576. $("#bIndexHide").remove();
  577. $("#s_upfunc_menus,#u_sp,#s_upfunc_menus *,#u_sp *").unbind('mouseover').unbind('mouseout');
  578. if (_this.indexHide == 1 && !(document.URL.indexOf('wd=') != -1 || document.URL.indexOf('word=') != -1)) {
  579. var style = "<style id='bIndexHide'>#s_btn_wr .s_btn{background:#3385ff;color:#fff}#s_kw_wrap{background:rgba(255, 255, 255, 0.3)!important}#kw{background:none!important}#s_upfunc_menus,#u_sp,#bottom_layer,.soutu-btn,#lg,#s_top_wrap,#u1,#s-top-left{opacity: 0; transition: all 0.3s}#s_upfunc_menus:hover,#u_sp:hover,#bottom_layer:hover,.soutu-btn:hover,#lg:hover,#u1:hover,#s-top-left:hover{opacity: 1;}#s_upfunc_menus:hover #s_top_wrap{opacity: 1;}#u_sp:hover #s_top_wrap{opacity: 1;}</style>";
  580. $("#s_upfunc_menus,#u_sp,#s_upfunc_menus *,#u_sp *").mouseover(function () { $("#s_top_wrap").css("opacity", 1); });
  581. $("#s_upfunc_menus,#u_sp,#s_upfunc_menus *,#u_sp *").mouseout(function () { $("#s_top_wrap").css("opacity", 0); });
  582. $('html').append(style);
  583. }
  584. };
  585. this.toggleIndexHide = function () {
  586. if (this.checked) {
  587. _this.indexHide = 1;
  588. localStorage.setItem('blur-index-hide', 1);
  589. }
  590. else {
  591. _this.indexHide = 0;
  592. localStorage.setItem('blur-index-hide', 0);
  593. }
  594. _this.doIndexHide();
  595. };
  596. this.initIndexAutoHideNews = function () {
  597. if (_this.indexAutoHideNews == undefined || _this.indexAutoHideNews == null) {
  598. _this.indexAutoHideNews = 0;
  599. localStorage.setItem('blur-index-auto-hide-news', 0);
  600. }
  601. _this.doIndexAutoHideNews();
  602. $(function () {
  603. _this.addIndexAutoHideNewsTool();
  604. });
  605. };
  606. this.addIndexAutoHideNewsTool = function () {
  607. if ($('.blur-index-auto-hide-news').length == 0) {
  608. var checked = 'checked';
  609. if (_this.indexAutoHideNews == 0) {
  610. checked = '';
  611. }
  612. var option = '<div class="c-gap-left" style="font-size:14px;padding: 5px 0;"><label><input type="checkbox" class="blur-index-auto-hide-news" style="margin-top:3px;vertical-align:middle; " ' + checked + ' ><span style="vertical-align:middle;cursor: pointer;">自动隐藏首页资讯(已登录(不可用))</span></label></div>';
  613. $("#bsetting").append(option);
  614. setTimeout(function () {
  615. $(".blur-index-auto-hide-news").change(_this.toggleIndexAutoHideNews);
  616. }, 50);
  617. }
  618. };
  619. this.doIndexAutoHideNews = function () {
  620. if (_this.indexAutoHideNews == 1 && !(document.URL.indexOf('wd=') != -1 || document.URL.indexOf('word=') != -1)) {
  621. $("#s_main").hide()
  622. setTimeout(function(){
  623. $('.hide-feed').click();
  624. }, 500);
  625. $('.show-feed').click(function(){
  626. localStorage.setItem('blur-index-auto-hide-news', 0);
  627. })
  628. }
  629. if (_this.indexAutoHideNews == 0) {
  630. $('.show-feed').click();
  631. }
  632. };
  633. this.toggleIndexAutoHideNews = function () {
  634. if (this.checked) {
  635. _this.indexAutoHideNews = 1;
  636. localStorage.setItem('blur-index-auto-hide-news', 1);
  637. }
  638. else {
  639. _this.indexAutoHideNews = 0;
  640. localStorage.setItem('blur-index-auto-hide-news', 0);
  641. }
  642. _this.doIndexAutoHideNews();
  643. };
  644. this.initIndexAutoHideHot = function () {
  645. if (_this.indexAutoHideHot == undefined || _this.indexAutoHideHot == null) {
  646. _this.indexAutoHideHot = 0;
  647. localStorage.setItem('blur-index-auto-hide-hot', 0);
  648. }
  649. _this.doIndexAutoHideHot();
  650. $(function () {
  651. _this.addIndexAutoHideHotTool();
  652. });
  653. };
  654. this.addIndexAutoHideHotTool = function () {
  655. if ($('.blur-index-auto-hide-hot').length == 0) {
  656. var checked = 'checked';
  657. if (_this.indexAutoHideHot == 0) {
  658. checked = '';
  659. }
  660. var option = '<div class="c-gap-left" style="font-size:14px;padding: 5px 0;"><label><input type="checkbox" class="blur-index-auto-hide-hot" style="margin-top:3px;vertical-align:middle; " ' + checked + ' ><span style="vertical-align:middle;cursor: pointer;">自动隐藏首页热榜(未登录(不可用))</span></label></div>';
  661. $("#bsetting").append(option);
  662. setTimeout(function () {
  663. $(".blur-index-auto-hide-hot").change(_this.toggleIndexAutoHideHot);
  664. }, 50);
  665. }
  666. };
  667. this.doIndexAutoHideHot = function () {
  668. if (_this.indexAutoHideHot == 1 && !(document.URL.indexOf('wd=') != -1 || document.URL.indexOf('word=') != -1)) {
  669. setTimeout(function(){
  670. $('.set-hide').click();
  671. }, 500);
  672. $('.set-show').click(function(){
  673. localStorage.setItem('blur-index-auto-hide-hot', 0);
  674. });
  675. }
  676. if (_this.indexAutoHideHot == 0) {
  677. $('.set-show').click();
  678. }
  679. };
  680. this.toggleIndexAutoHideHot = function () {
  681. if (this.checked) {
  682. _this.indexAutoHideHot = 1;
  683. localStorage.setItem('blur-index-auto-hide-hot', 1);
  684. }
  685. else {
  686. _this.indexAutoHideHot = 0;
  687. localStorage.setItem('blur-index-auto-hide-hot', 0);
  688. }
  689. _this.doIndexAutoHideHot();
  690. };
  691. this.initInMiddle = function () {
  692. if (_this.inMiddle == undefined || _this.inMiddle == null) {
  693. _this.inMiddle = 0;
  694. localStorage.setItem('blur-in-middle', 0);
  695. }
  696. _this.doInMiddle();
  697. $(function () {
  698. _this.addInMiddleTool();
  699. });
  700. };
  701. this.addInMiddleTool = function () {
  702. if ($('.blur-in-middle').length == 0) {
  703. var checked = 'checked';
  704. if (_this.inMiddle == 0) {
  705. checked = '';
  706. }
  707. var option = '<div class="c-gap-left" style="font-size:14px;padding: 5px 0;"><label><input type="checkbox" class="blur-in-middle" style="margin-top:3px;vertical-align:middle; " ' + checked + ' ><span style="vertical-align:middle;cursor: pointer;">结果居中</span></label></div>';
  708. $("#bsetting").append(option);
  709. setTimeout(function () {
  710. $(".blur-in-middle").change(_this.toggleInMiddle);
  711. }, 50);
  712. }
  713. };
  714. this.doInMiddle = function (force) {
  715. if (_this.inMiddle == 1 && (document.URL.indexOf('wd=') != -1 || document.URL.indexOf('word=') != -1)) {
  716. $('#container').css('margin', 'auto');
  717. if ($('.css-blue-inMiddle').length && !force) {
  718. return;
  719. }
  720. $('.css-blue-inMiddle').remove();
  721. $('.css-blur-right').remove();
  722. setTimeout(function () {
  723. $('.css-blue-inMiddle').remove();
  724. $('.css-blur-right').remove();
  725. var stab = $("#s_tab").css('padding-left');
  726. var plStab = parseInt(stab.replace('px', ''));
  727. var cl = $("#container")[0].offsetLeft;
  728. var sForm = $(".s_form").css('padding-left');
  729. var plSForm = parseInt(sForm.replace('px', ''));
  730. var spi = $(".page-inner").css('padding-left');
  731. var plSpi = parseInt(spi.replace('px', ''));
  732. var rw = 0;
  733. if (_this.right == 0 && _this.tab == 0) {
  734. rw = parseInt($("#content_right").css('width').replace('px', ''));
  735. var css = '<style class="css-blur-right">';
  736. if ($(".container_l").css('width') != undefined) {
  737. var cw = parseInt($(".container_l").css('width').replace('px', ''));
  738. css += '.container_l{width:' + (cw - rw) + 'px!important}';
  739. }
  740. if ($(".container_s").css('width') != undefined) {
  741. rw = rw / 4;
  742. var csw = parseInt($(".container_s").css('width').replace('px', ''));
  743. css += '.container_s{width:' + (csw - rw) + 'px!important}';
  744. }
  745. rw = rw / 2;
  746. css += '</style>';
  747. $('html').append(css)
  748. }
  749. var logoW = $("#result_logo").width()
  750. var rbl = $("#content_right").css('border-left-width');
  751. rbl = rbl ? rbl : '';
  752. rbl = parseInt(rbl.replace('px', ''));
  753. if (rbl == 0) {
  754. plStab = 0;
  755. plSForm = 0 - logoW - 15;
  756. plSpi -= 132;
  757. }
  758.  
  759. var css = '<style class="css-blue-inMiddle">#container{margin: auto}#s_tab{padding-left: ' + (cl + plStab + rw) + 'px!important}.s_form{padding-left: ' + (cl + plSForm + rw) + 'px!important}.page-inner{padding-left: ' + (cl + plSpi + rw) + 'px!important}</style>';
  760.  
  761. $("html").append(css);
  762. }, 500)
  763.  
  764. }
  765. else {
  766. $('#container').attr('style', '');
  767. $('.css-blue-inMiddle').remove();
  768. $('.css-blur-right').remove();
  769. }
  770. };
  771. this.toggleInMiddle = function () {
  772. if (this.checked) {
  773. _this.inMiddle = 1;
  774. localStorage.setItem('blur-in-middle', 1);
  775. }
  776. else {
  777. _this.inMiddle = 0;
  778. localStorage.setItem('blur-in-middle', 0);
  779. }
  780. _this.doInMiddle();
  781. };
  782. this.initHideBaijia = function () {
  783. if (_this.hideBaijia == undefined || _this.hideBaijia == null) {
  784. _this.hideBaijia = 0;
  785. localStorage.setItem('blur-hide-baijia', 0);
  786. }
  787. $(function () {
  788. _this.addHideBaijiaTool();
  789. });
  790. setTimeout(function () {
  791. _this.doHideBaijia();
  792. }, 100)
  793.  
  794. };
  795. this.addHideBaijiaTool = function () {
  796. if ($('.blur-hide-baijia').length == 0) {
  797. var checked = 'checked';
  798. if (_this.hideBaijia == 0) {
  799. checked = '';
  800. }
  801. var option = '<div class="c-gap-left" style="font-size:14px;padding: 5px 0;"><label><input type="checkbox" class="blur-hide-baijia" style="margin-top:3px;vertical-align:middle; " ' + checked + ' ><span style="vertical-align:middle;cursor: pointer;">隐藏百家号结果(会自动加上-baijia)</span></label></div>';
  802. $("#bsetting").append(option);
  803. setTimeout(function () {
  804. $(".blur-hide-baijia").change(_this.toggleHideBaijia);
  805. }, 50);
  806. }
  807. };
  808. this.doHideBaijia = function () {
  809. if (_this.hideBaijia == 1 && (document.URL.indexOf('wd=') != -1 || document.URL.indexOf('word=') != -1)) {
  810. var searchStr = $("#kw").val();
  811. if (searchStr.indexOf('-baijia') == -1) {
  812. setTimeout(function () {
  813. $("#kw").val($("#kw").val() + ' -baijia');
  814. $('#form').submit();
  815. }, 150)
  816.  
  817. }
  818. }
  819. };
  820. this.toggleHideBaijia = function () {
  821. if (this.checked) {
  822. _this.hideBaijia = 1;
  823. localStorage.setItem('blur-hide-baijia', 1);
  824. }
  825. else {
  826. _this.hideBaijia = 0;
  827. localStorage.setItem('blur-hide-baijia', 0);
  828. }
  829. _this.doHideBaijia();
  830. };
  831. this.initBg = function () {
  832. if (_this.bg == undefined || _this.bg == null) {
  833. _this.bg = {'on': false, 'url': '', 'onlyIndex': true};
  834. localStorage.setItem('blur-bg', JSON.stringify(_this.bg));
  835. }
  836. if (typeof _this.bg == 'string') {
  837. try {
  838. _this.bg = JSON.parse(_this.bg);
  839. } catch (e) {
  840. _this.bg = {'on': false, 'url': '', 'onlyIndex': true};
  841. }
  842. }
  843. $(function () {
  844. _this.addBgTool();
  845. });
  846. setTimeout(function () {
  847. _this.doBg();
  848. }, 100)
  849.  
  850. };
  851. this.addBgTool = function () {
  852. if ($('.blur-bg').length == 0) {
  853. var checked = 'checked';
  854. var disabled = '';
  855. if (_this.bg.on == false) {
  856. checked = '';
  857. disabled = 'disabled="disabled"';
  858. }
  859. var option = '<div class="c-gap-left" style="font-size:14px;padding: 5px 0;"><label><input type="checkbox" class="blur-bg" style="margin-top:3px;vertical-align:middle; " ' + checked + ' ><span style="vertical-align:middle;cursor: pointer;">自定义背景(需要登录(不可用)百度账号,不指定URL默认随机近七日bing图片)</span></label></div>';
  860.  
  861. option += '<div class="c-gap-left" style="font-size:14px;padding: 5px 0;padding-left: 15px">URL:<input type="text" ' + disabled + ' class="blur-bg-setting blur-bg-url" data-field="url" value="' + _this.bg.url + '"><button type="button" style="margin-left: 10px" onclick="$(\'.blur-bg-url\').val(\'\').change()">清空</button></div>'
  862. option += '<div class="c-gap-left" style="font-size:14px;padding: 5px 0;padding-left: 15px">本地文件(不要太大,会覆盖URL里的内容,请注意备份):<input type="file" ' + disabled + ' class="blur-bg-setting" id="blur-bg-local-image" accept="image/*"></div>'
  863.  
  864. var onlyIndexChecked = 'checked';
  865. if (_this.bg.onlyIndex == false) {
  866. onlyIndexChecked = '';
  867. }
  868. option += '<div class="c-gap-left" style="font-size:14px;padding: 5px 0;padding-left: 15px;"><label><input type="checkbox" class="blur-bg-setting" data-field="onlyIndex" style="margin-top:3px;vertical-align:middle; " ' + onlyIndexChecked + ' ' + disabled + ' ><span style="vertical-align:middle;cursor: pointer;" >只设置首页</span></label></div>';
  869. $("#bsetting").append(option);
  870. setTimeout(function () {
  871. $(".blur-bg").change(_this.toggleBg);
  872. $(".blur-bg-setting").change(_this.setBg);
  873. $("#blur-bg-local-image").change(_this.setLocalImage)
  874. }, 50);
  875. }
  876. };
  877. this.doBg = function () {
  878. $(".blur-bg-css").remove();
  879. $("#blur-search-bg").remove();
  880. $(".blur-search-bg").remove();
  881. if (_this.bg.on) {
  882. var url = _this.bg.url ? _this.bg.url : 'https://roll.ihawo.com/bg.php';
  883. $("#head").addClass('s-skin-hasbg').addClass('white-logo');
  884. $(".s-skin-container").css('background', 'url(' + url + ')');
  885. $(".s-skin-container").css('background-size', 'cover');
  886. var style = '<style class="blur-bg-css">#s_top_wrap{background:rgba(0,0,0,.2)!important} #s_kw_wrap{background:rgba(255, 255, 255, 0)!important;} #head_wrapper .soutu-env-nomac #form #kw{/* background: rgba(255, 255, 255, 0.8)!important;*/}#bottom_layer{background:rgba(0, 0, 0, 0.2)!important}#bottom_layer .lh,#bottom_layer .lh a{color:white!important}#head_wrapper .ipt_rec, #head_wrapper .soutu-btn{background-color: rgba(0,0,0,0)} #blur-search-bg{position: fixed;top: 0;left: 0;height: 100%;width: 100%;z-index: -10;}</style>';
  887. $('html').append(style);
  888. if (!_this.bg.onlyIndex && document.URL.indexOf('wd=') != -1 && !$("#blur-search-bg").length && _this.css) {
  889. var div = '<div id="blur-search-bg" style="background:url(\'' + url + '\') 0% 0% / cover"></div>';
  890. var style = '<style class="blur-bg-css">body,.wrapper_new #foot #help{background: none} .wrapper_new #foot,#help{background-color: unset} .wrapper_new #s_tab .s-tab-item:before{color: #75777d} .s_down{background: rgba(255,255,255,0.7)!important;} .nums_text,.search_tool,.search_tool_conter span{text-shadow: 0 0 10px black;color: #eee} #rs,#s_tab,.blur-search-bg,#content_right{background: rgba(255,255,255,0.7)!important; backdrop-filter:blur(15px)!important;} #rs{width: 560px;border-radius: 5px} #content_right{padding: 0 15px!important;border-radius: 5px}.blur-search-bg{position:absolute;top: -10px;left: 0;z-index: -1;width: 5000px;height: 5000px}#content_left>.result,.result-op,.op-vmp-zxenterprise{background: none!important;position:relative;overflow: hidden}.result:hover,.c-container:hover,.result-op:not(.xpath-log):hover{box-shadow: none;}#content_left .result:hover,#content_left .c-container:hover,#content_left .result-op:not(.xpath-log):hover,#rs:hover,#content_right:hover{background: white!important;} #content_left>.result, #content_left>.c-container, #content_left>.result-op, #content_left>#unsafe_content>.result, #content_left>#unsafe_content>.c-container, #content_left>#unsafe_content>.result-op{padding: 20px; border-radius: 5px; margin: 0 15px 25px 0!important;}</style>'
  891. $("#content_left .result,#content_left .result-op").append('<div class="blur-search-bg"></div>');
  892. $('#page').css({ 'backdrop-filter': 'blur(15px)', 'background': 'rgba(238, 238, 238, 0.5)', 'z-index': '1000' });
  893. if (_this.tab == 0) {
  894. $('#foot').css({ 'backdrop-filter': 'blur(15px)', 'background': 'rgba(238, 238, 238, 0.5)', 'z-index': '1000' });
  895. }
  896. if (_this.beautify == 0) {
  897. style += '<style class="blur-bg-css">html{padding-bottom: 0} .blur-search-bg{top: 0} #rs{padding: 20px} #content_right{padding-top: 15px!important;}</style>';
  898. }
  899. $('html').append(div).append(style);
  900. }
  901.  
  902. } else {
  903. var url = _this.bg.url ? _this.bg.url : 'https://roll.ihawo.com/bg.php';
  904. $(".blur-bg-css").remove();
  905. if ($(".s-skin-container").css('background') && $(".s-skin-container").css('background').search(url) != -1) {
  906. location.reload()
  907. }
  908. }
  909. };
  910. this.toggleBg = function () {
  911. if (this.checked) {
  912. _this.bg.on = true;
  913. $(".blur-bg-setting").removeAttr('disabled')
  914. localStorage.setItem('blur-bg', JSON.stringify(_this.bg));
  915. }
  916. else {
  917. _this.bg.on = false;
  918. $(".blur-bg-setting").attr('disabled', 'disabled')
  919. localStorage.setItem('blur-bg', JSON.stringify(_this.bg));
  920. }
  921. _this.doBg();
  922. };
  923. this.setBg = function () {
  924. var field = $(this).data('field');
  925. switch (field) {
  926. case 'url':
  927. var value = $(this).val();
  928. _this.bg.url = value;
  929. break;
  930. case 'onlyIndex':
  931. var value = this.checked;
  932. if (!_this.css && !value) {
  933. _this.bg.onlyIndex = true;
  934. alert('浏览器不支持');
  935. $(this).prop('checked', true)
  936. return false;
  937. }
  938. _this.bg.onlyIndex = value;
  939. break;
  940. }
  941. localStorage.setItem('blur-bg', JSON.stringify(_this.bg));
  942. _this.doBg();
  943. };
  944. this.setLocalImage = function () {
  945. var imgFile = new FileReader();
  946. imgFile.readAsDataURL($('#blur-bg-local-image')[0].files[0]);
  947.  
  948. imgFile.onload = function () {
  949. var imgData = this.result; //base64数据
  950. _this.bg.url = imgData;
  951. $(".blur-bg-url").val(imgData);
  952. localStorage.setItem('blur-bg', JSON.stringify(_this.bg));
  953. _this.doBg();
  954. }
  955. };
  956. }
  957. }
  958. document.getElementsByTagName('html')[0].style.display="none";
  959. Blur = new Blur,Blur.init();
  960.  
  961. function myBrowser(){
  962. var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
  963. var isOpera = userAgent.indexOf("Opera") > -1;
  964. if (isOpera) {
  965. return "Opera"
  966. }; //判断是否Opera浏览器
  967. if (userAgent.indexOf("Firefox") > -1) {
  968. return "FF";
  969. } //判断是否Firefox浏览器
  970. if (userAgent.indexOf("Chrome") > -1){
  971. return "Chrome";
  972. }
  973. if (userAgent.indexOf("Safari") > -1) {
  974. return "Safari";
  975. } //判断是否Safari浏览器
  976. if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
  977. return "IE";
  978. }; //判断是否IE浏览器
  979. }
  980.  
  981. function getChromeVersion() {
  982. var arr = navigator.userAgent.split(' ');
  983. var chromeVersion = '';
  984. for(var i=0;i < arr.length;i++){
  985. if(/chrome/i.test(arr[i]))
  986. chromeVersion = arr[i]
  987. }
  988. if(chromeVersion){
  989. return Number(chromeVersion.split('/')[1].split('.')[0]);
  990. } else {
  991. return false;
  992. }
  993. }
  994. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址