Greasy Fork 支持简体中文。

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

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

目前為 2020-07-22 提交的版本,檢視 最新版本

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