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

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

目前为 2020-05-12 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name 百度去广告,blur(毛玻璃)搜索框,美化
  3. // @version 20.5.13.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-body
  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.browser = myBrowser();
  32. this.css = 0;
  33. this.showSetting = 0;
  34. this.init = function () {
  35. _this.addBaseStyle();
  36. window.onload = function () {
  37. if (_this.browser == 'Chrome') {
  38. var version = getChromeVersion();
  39. if (version >= 76) {
  40. _this.css = 1;
  41. }
  42. }
  43. else if (_this.browser == 'Safari') {
  44. _this.css = 1;
  45. }
  46. _this.addSettingDiv();
  47. _this.initTab();
  48. _this.initBlur();
  49. _this.initShowRight();
  50. _this.initBeautify();
  51. _this.initIndexHide();
  52. _this.initStatus = 0;
  53. };
  54. };
  55. this.addSettingDiv = function () {
  56. $('html').append('<div style="width:210px;height:200px;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>');
  57. var option = '<span class="c-gap-left" id="showBsetting"><label><span>显示插件设置</span></label></span>';
  58. $(".search_tool_conter").append(option);
  59. $("html").on('click', '#showBsetting', function () {
  60. $("#bsetting").fadeIn(300);
  61. $("#wrapper").css("filter", 'blur(15px)');
  62. $("#wrapper *").css("pointer-events", 'none');
  63. setTimeout(function () {
  64. _this.showSetting = 1;
  65. }, 500);
  66. });
  67. $("html").on('click', '#wrapper', function () {
  68. if (_this.showSetting) {
  69. $("#bsetting").fadeOut(300);
  70. $("#wrapper").css("filter", '');
  71. $("#wrapper *").css("pointer-events", 'auto');
  72. _this.showSetting = 0;
  73. }
  74. });
  75. };
  76. this.addBaseStyle = function () {
  77. var style = document.createElement('style');
  78. style.type = 'text/css';
  79. style.innerHTML = ".result,.c-container,.result div,.c-container div,#t_tab,#head,#u,.s_form,#content_right{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}";
  80. document.getElementsByTagName('body').item(0).appendChild(style);
  81. if (_this.beautify == 1 || _this.beautify == null) {
  82. var style = document.createElement('style');
  83. style.type = 'text/css';
  84. style.className = 'mainStyle';
  85. 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 } .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;}}";
  86. if (document.URL.indexOf('wd=') != -1) {
  87. 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;}}";
  88. }
  89. document.getElementsByTagName('body').item(0).appendChild(style);
  90. }
  91. };
  92. this.initShowRight = function () {
  93. if (_this.right == undefined || _this.right == null) {
  94. _this.right = 1;
  95. localStorage.setItem('blur-right', 1);
  96. }
  97. _this.isShowRight();
  98. $(function () {
  99. _this.addShowRightTool();
  100. });
  101. };
  102. this.initBeautify = function () {
  103. if (_this.beautify == undefined || _this.beautify == null || _this.beautify == 1) {
  104. _this.beautify = 1;
  105. localStorage.setItem('blur-beautify', 1);
  106. }
  107. _this.doBeautify();
  108. $(function () {
  109. _this.addBeautifyTool();
  110. _this.doBeautify();
  111. $(".head_wrapper").on('DOMNodeInserted', function (e) {
  112. if (e.target.id == 'ent_sug') {
  113. setTimeout(function () {
  114. _this.doBeautify();
  115. }, 100);
  116. }
  117. });
  118. $(document).ajaxSuccess(function (_e, _xhr, opt) {
  119. var url = opt.url;
  120. if (url.indexOf('submit/setuskin') != -1) {
  121. _this.doBeautify();
  122. }
  123. });
  124. $('#kw').on('change', function () {
  125. if ($('.s-skin-container').length > 0) {
  126. setTimeout(function () {
  127. _this.doBeautify();
  128. }, 50);
  129. }
  130. });
  131. });
  132. };
  133. this.initBlur = function () {
  134. if (_this.css) {
  135. $(function () {
  136. _this.blur();
  137. });
  138. }
  139. else {
  140. $('html').append('<style></style>');
  141. $(function () {
  142. $(window).scroll(function () {
  143. var top = $(window).scrollTop();
  144. $("#headerBulrBg").css('top', -top + "px");
  145. });
  146. $(document).ajaxSend(function (_e, _xhr, opt) {
  147. var url = opt.url;
  148. if (url.indexOf('/s?') != -1 && (url.indexOf('&wd=') != -1 || url.indexOf('?wd=') != -1) && url.indexOf('&_ck=') == -1) {
  149. $(".headBgDiv").remove();
  150. }
  151. });
  152. _this.blur();
  153. });
  154. }
  155. $(function () {
  156. $(document).ajaxSuccess(function (_e, _xhr, opt) {
  157. var url = opt.url;
  158. if (url.indexOf('/s?') != -1 && (url.indexOf('&wd=') != -1 || url.indexOf('?wd=') != -1) && url.indexOf('&_ck=') == -1) {
  159. setTimeout(function () {
  160. _this.addSettingDiv();
  161. _this.addShowRightTool();
  162. _this.addBeautifyTool();
  163. _this.addTabTool();
  164. _this.addIndexHideTool();
  165. _this.doBeautify();
  166. $("#bIndexHide").remove();
  167. $("#s_upfunc_menus,#u_sp,#s_upfunc_menus *,#u_sp *").unbind('mouseover').unbind('mouseout');
  168. setTimeout(function () {
  169. _this.removeAd();
  170. }, 2300);
  171. _this.removeAd();
  172. _this.blur();
  173. }, 100);
  174. }
  175. });
  176. $("#wrapper_wrapper").on('DOMNodeInserted', function (e) {
  177. if (e.target.id == "container" && e.target.class == undefined) {
  178. setTimeout(function () {
  179. _this.addShowRightTool();
  180. _this.addBeautifyTool();
  181. _this.addTabTool();
  182. _this.addIndexHideTool();
  183. _this.doBeautify();
  184. _this.removeAd();
  185. _this.blur();
  186. $("#bIndexHide").remove();
  187. $("#s_upfunc_menus,#u_sp,#s_upfunc_menus *,#u_sp *").unbind('mouseover').unbind('mouseout');
  188. }, 100);
  189. }
  190. });
  191. });
  192. };
  193. this.initTab = function () {
  194. if (_this.tab == undefined || _this.tab == null) {
  195. _this.tab = 0;
  196. localStorage.setItem('blur-tab', 0);
  197. }
  198. _this.setTab();
  199. $(function () {
  200. _this.addTabTool();
  201. });
  202. };
  203. this.addShowRightTool = function () {
  204. if ($('.blur-right').length == 0) {
  205. var checked = 'checked';
  206. if (_this.right == 0) {
  207. checked = '';
  208. }
  209. 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>';
  210. $("#bsetting").append(option);
  211. setTimeout(function () {
  212. $(".blur-right").change(_this.toggleRight);
  213. }, 50);
  214. }
  215. };
  216. this.isShowRight = function () {
  217. if (_this.right == 0) {
  218. $('html').append("<style class='bright'>#content_right{opacity:0} </style>");
  219. setTimeout(function () {
  220. if (_this.right == 0) {
  221. $(".bright").text('#content_right{display:none}');
  222. }
  223. }, 500);
  224. }
  225. else {
  226. $(".bright").text('#content_right{opacity:0}');
  227. setTimeout(function () {
  228. if (_this.right == 1) {
  229. $(".bright").text('#content_right{opacity:1}');
  230. }
  231. }, 100);
  232. setTimeout(function () {
  233. if (_this.right == 1) {
  234. $(".bright").remove();
  235. }
  236. }, 500);
  237. }
  238. _this.setTab();
  239. };
  240. this.toggleRight = function () {
  241. if (this.checked) {
  242. _this.right = 1;
  243. localStorage.setItem('blur-right', 1);
  244. }
  245. else {
  246. _this.right = 0;
  247. localStorage.setItem('blur-right', 0);
  248. }
  249. _this.isShowRight();
  250. };
  251. this.beautifyLogo = function () {
  252. if (_this.isNotHaveBackGround()) {
  253. if (_this.beautify != 0) {
  254. $("#lg img,#result_logo img").attr('src', 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IuWbvuWxgl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgMTAxIDMzIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxMDEgMzM7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojNDg3OUJEO30KCS5zdDF7ZmlsbDojREQ0NDM2O30KCS5zdDJ7ZmlsbDojRkZGRkZGO30KPC9zdHlsZT4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTUwLjQsMTUuM2MtMy44LDAuMy00LDIuNi01LjcsNC43Yy0xLjgsMi4yLTUuNSw0LjEtNiw2LjdjLTAuNiwzLjMsMS4zLDUuMSwzLDUuN2MxLjksMC42LDYuMi0wLjUsOC40LTAuNWgwLjIKCWgwLjJjMi4yLDAsNi40LDEuMSw4LjQsMC41YzEuOC0wLjYsMy41LTMuMiwzLTUuN2MtMC40LTIuMS00LjQtNC41LTYuMi02LjdDNTQuMiwxOCw1NC4zLDE1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6Ii8+CjxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik00Ni4zLDI0LjJjMC42LDAsMS4yLDAuMSwxLjcsMC40djMuNGMwLDAuMy0wLjYsMS0xLjksMWMtMS41LDAtMS44LTAuNi0xLjgtMi4xdi0wLjYKCUM0NC4yLDI0LjgsNDQuNywyNC4yLDQ2LjMsMjQuMnogTTQ5LjIsMjAuN0g0OHYyLjVDNDcuNiwyMy4xLDQ3LDIzLDQ2LjMsMjNjLTIuNywwLTMuMywxLTMuMywzLjV2MC4zYzAsMi40LDAuOSwzLjMsMy4yLDMuMwoJYzAuOCwwLDEuMy0wLjEsMS44LTAuNWwwLjEsMC42aDEuMUw0OS4yLDIwLjdMNDkuMiwyMC43eiIvPgo8cGF0aCBjbGFzcz0ic3QyIiBkPSJNNTYuNywyM2gtMS4ydjUuMmMtMC42LDAuNC0xLjcsMC42LTIuNCwwLjZjLTAuOCwwLTEtMC40LTEtMS4zdi00LjZoLTEuMXY0LjhjMCwxLjYsMC41LDIuMywyLjEsMi4zCgljMSwwLDIuMS0wLjMsMi42LTAuNmwwLjEsMC42aDEuMVYyM3oiLz4KPHBhdGggY2xhc3M9InN0MSIgZD0iTTkyLjcsMTUuN2MwLTAuNywwLjYtMS4zLDEuMi0xLjNjMC42LDAsMS4yLDAuNiwxLjIsMS4zUzk0LjUsMTcsOTMuOSwxN0M5My4zLDE2LjksOTIuNywxNi4zLDkyLjcsMTUuN3oiLz4KPC9zdmc+Cg==');
  255. }
  256. else {
  257. $("#lg img,#result_logo img").attr('src', '//www.baidu.com/img/bd_logo1.png?where=super');
  258. }
  259. }
  260. };
  261. this.addBeautifyTool = function () {
  262. var checked = 'checked';
  263. if (_this.beautify == 0) {
  264. checked = '';
  265. }
  266. if ($('.blur-beautify').length == 0) {
  267. 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>';
  268. $("#bsetting").append(option);
  269. setTimeout(function () {
  270. $(".blur-beautify").change(_this.toggleBeautify);
  271. }, 50);
  272. }
  273. };
  274. this.toggleBeautify = function () {
  275. if (this.checked) {
  276. _this.beautify = 1;
  277. localStorage.setItem('blur-beautify', 1);
  278. }
  279. else {
  280. _this.beautify = 0;
  281. localStorage.setItem('blur-beautify', 0);
  282. }
  283. _this.doBeautify();
  284. };
  285. this.doBeautify = function () {
  286. $(".headBgDiv").remove();
  287. if (_this.beautify == 1 || _this.beautify == null) {
  288. _this.beautifyLogo();
  289. $(function () {
  290. _this.beautifyLogo();
  291. });
  292. 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} .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 } .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;!important}} #s_kw_wrap,#bottom_layer{background:#eee!important}";
  293. if (_this.isNotHaveBackGround() && (_this.initStatus == 0 || document.URL.indexOf('wd=') != -1 || document.URL.indexOf('word=') != -1)) {
  294. style += 'body,#head{background:#eee} .s_form{padding-top: 15px}#s_kw_wrap,#s_top_wrap,#bottom_layer{background:none!important}';
  295. }
  296. if (!_this.isNotHaveBackGround()) {
  297. style += '#s_top_wrap,#bottom_layer,#s_kw_wrap{background:none!important}';
  298. }
  299. if ((!$("#u_sp").length || $("#u_sp").is(':hidden')) && (!$("#u1").length || $("#u1").is(':hidden'))) {
  300. style += '#head{height: 86px;top:0}';
  301. }
  302. style += '</style>';
  303. $(".mainStyle").remove();
  304. $("html").append(style);
  305. }
  306. else {
  307. $(".mainStyle").remove();
  308. }
  309. setTimeout(function () {
  310. _this.setTab();
  311. _this.blur();
  312. }, 350);
  313. };
  314. this.isNotHaveBackGround = function () {
  315. return ($('.s-skin-container').length == 0 || $('.s-skin-container').attr('style') == null || $('.s-skin-container').attr('style').indexOf('background-image') == -1);
  316. };
  317. this.removeAd = function () {
  318. if ($('.tab-wrapper b').text() != '资讯') {
  319. $('#content_left>div:not(.c-container):not(#super_se_tip):not(.video_list_container):not(.result)').remove();
  320. }
  321. $(".c-container>.f13").each(function () {
  322. var text = $(this).text();
  323. if (text.indexOf('广告') != -1) {
  324. $(this).parents('.c-container').remove();
  325. }
  326. });
  327. $("#ecomScript").remove();
  328. $('#content_right>div').remove();
  329. $("#con-ar").next().remove();
  330. $(".t>a").unbind('click').click(function () { window.open($(this).attr('href')); return false; });
  331. };
  332. this.blur = function () {
  333. if (_this.css) {
  334. if (_this.isNotHaveBackGround() && ((!$("#u_sp").length || $("#u_sp").is(':hidden')) && (!$("#u1").length || $("#u1").is(':hidden')))) {
  335. $('#head').css({ 'backdrop-filter': 'blur(15px)' });
  336. if (_this.tab && _this.beautify) {
  337. $('#page').css({ 'backdrop-filter': 'blur(15px)', 'background': 'rgba(0, 0, 0, 0)' });
  338. }
  339. }
  340. setTimeout(function () {
  341. $('#head').css({ 'background': 'rgba(0,0,0,0)' });
  342. }, 1000);
  343. $("#s_kw_wrap").css({ 'background': 'rgba(255,255,255,0.8)' });
  344. }
  345. else {
  346. var top = -$(window).scrollTop();
  347. var subHeight = $('#head').outerHeight();
  348. 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>';
  349. if (_this.isNotHaveBackGround() && ((!$("#u_sp").length || $("#u_sp").is(':hidden')) && (!$("#u1").length || $("#u1").is(':hidden')))) {
  350. $(".headBgDiv").remove();
  351. $('#head').prepend(headBgDiv);
  352. }
  353. else {
  354. $(".headBgDiv").remove();
  355. }
  356. $('#wrapper_wrapper #container').addClass('container_l');
  357. _this.removeAd();
  358. $(".bulrBg").append($('#s_tab').clone());
  359. $(".bulrBg").append($('#wrapper_wrapper').clone());
  360. $(".headBgDiv #c-tips-container").remove();
  361. }
  362. };
  363. this.addTabTool = function () {
  364. var checked = 'checked';
  365. if (_this.tab == 0) {
  366. checked = '';
  367. }
  368. if ($('.blur-tab').length == 0) {
  369. 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>';
  370. $("#bsetting").append(option);
  371. setTimeout(function () {
  372. $(".blur-tab").change(_this.toggleTab);
  373. }, 50);
  374. }
  375. };
  376. this.toggleTab = function () {
  377. if (this.checked) {
  378. _this.tab = 1;
  379. localStorage.setItem('blur-tab', 1);
  380. }
  381. else {
  382. _this.tab = 0;
  383. localStorage.setItem('blur-tab', 0);
  384. }
  385. _this.setTab();
  386. };
  387. this.setTab = function () {
  388. $("#bTab").remove();
  389. if ($('.s_tab_inner b').text() == '视频') {
  390. return;
  391. }
  392. if (_this.tab == 1) {
  393. var column = _this.right == 1 ? 2 : 3;
  394. if ($('.tab-wrapper b').text() == '资讯') {
  395. column = 3;
  396. }
  397. var style = '<style id="bTab">@media screen and (min-width: 1216px){#content_left,#rs_top_new{width:1215px;}.cr-offset{padding-left: 35px;}';
  398. if (column == 3) {
  399. var style = '<style id="bTab">@media screen and (min-width: 1216px){.result, .c-container{padding:15px}#content_left,#rs_top_new{width:1750px;}';
  400. }
  401. if (_this.isNotHaveBackGround() && ((!$("#u_sp").length || $("#u_sp").is(':hidden')) && (!$("#u1").length || $("#u1").is(':hidden')))) {
  402. style += 'html{padding-bottom:50px}';
  403. }
  404. if (_this.beautify == 1) {
  405. style += '#page{position: fixed;bottom: 0;width: 100%;padding: 15px 0;text-align: center;margin: 0;}html #page .pc, #page .n{border-color:rgba(200,200,200,0.55);}#page a{ color: rgba(100,100,100,0.95);}#page strong{background: rgba(51,136,255,0.7)!important;color: white;}';
  406. }
  407. style += '#container{width:1775px}#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>';
  408. $('html').append(style);
  409. }
  410. };
  411. this.initIndexHide = function () {
  412. if (_this.indexHide == undefined || _this.indexHide == null) {
  413. _this.indexHide = 0;
  414. localStorage.setItem('blur-index-hide', 0);
  415. }
  416. _this.doIndexHide();
  417. $(function () {
  418. _this.addIndexHideTool();
  419. });
  420. };
  421. this.addIndexHideTool = function () {
  422. if ($('.blur-index-hide').length == 0) {
  423. var checked = 'checked';
  424. if (_this.indexHide == 0) {
  425. checked = '';
  426. }
  427. 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>';
  428. $("#bsetting").append(option);
  429. setTimeout(function () {
  430. $(".blur-index-hide").change(_this.toggleIndexHide);
  431. }, 50);
  432. }
  433. };
  434. this.doIndexHide = function () {
  435. $("#bIndexHide").remove();
  436. $("#s_upfunc_menus,#u_sp,#s_upfunc_menus *,#u_sp *").unbind('mouseover').unbind('mouseout');
  437. if (_this.indexHide == 1 && !(document.URL.indexOf('wd=') != -1 || document.URL.indexOf('word=') != -1)) {
  438. 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>";
  439. $("#s_upfunc_menus,#u_sp,#s_upfunc_menus *,#u_sp *").mouseover(function () { $("#s_top_wrap").css("opacity", 1); });
  440. $("#s_upfunc_menus,#u_sp,#s_upfunc_menus *,#u_sp *").mouseout(function () { $("#s_top_wrap").css("opacity", 0); });
  441. $('html').append(style);
  442. }
  443. };
  444. this.toggleIndexHide = function () {
  445. if (this.checked) {
  446. _this.indexHide = 1;
  447. localStorage.setItem('blur-index-hide', 1);
  448. }
  449. else {
  450. _this.indexHide = 0;
  451. localStorage.setItem('blur-index-hide', 0);
  452. }
  453. _this.doIndexHide();
  454. };
  455. }
  456. }
  457.  
  458. Blur = new Blur,Blur.init();
  459.  
  460. function myBrowser(){
  461. var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
  462. var isOpera = userAgent.indexOf("Opera") > -1;
  463. if (isOpera) {
  464. return "Opera"
  465. }; //判断是否Opera浏览器
  466. if (userAgent.indexOf("Firefox") > -1) {
  467. return "FF";
  468. } //判断是否Firefox浏览器
  469. if (userAgent.indexOf("Chrome") > -1){
  470. return "Chrome";
  471. }
  472. if (userAgent.indexOf("Safari") > -1) {
  473. return "Safari";
  474. } //判断是否Safari浏览器
  475. if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
  476. return "IE";
  477. }; //判断是否IE浏览器
  478. }
  479.  
  480. function getChromeVersion() {
  481. var arr = navigator.userAgent.split(' ');
  482. var chromeVersion = '';
  483. for(var i=0;i < arr.length;i++){
  484. if(/chrome/i.test(arr[i]))
  485. chromeVersion = arr[i]
  486. }
  487. if(chromeVersion){
  488. return Number(chromeVersion.split('/')[1].split('.')[0]);
  489. } else {
  490. return false;
  491. }
  492. }
  493. })();