Greasy Fork is available in English.

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

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

Versión del día 22/07/2020. Echa un vistazo a la versión más reciente.

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