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

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

目前为 2023-05-30 提交的版本。查看 最新版本

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

QingJ © 2025

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