阅读全文、自动展开全文、自动移除万恶弹框

【非自动关注】【自用,长期维护】【功能有】1. 阅读全文网站支持:CSDN、github.io、xz577.com、iteye.com、720ui.com、cloud.tencent.com、新浪、头条、网易新闻、腾讯新闻、51CTO、知乎、果壳科技(移动版)、awesomes.cn、javascriptcn.com、人民日报(移动版)、凤凰网、虎扑移动版、百度经验、360文档(个人图书馆)、乐居买房(移动版)、电子发烧友网(PC、移动版)、悟空问答(PC、移动版)、百家号、百度文章、简书移动版、搜狐移动版、goodreads(PC、移动版)、百度文库(移动、PC版)、36氪移动版、弟弟快看<br>备注: 反馈问题的小伙伴们请附加上有问题的网址链接哈

  1. // ==UserScript==
  2. // @name 阅读全文、自动展开全文、自动移除万恶弹框
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.18.2
  5. // @require https://gf.qytechs.cn/scripts/415668-zmquery3-5-1/code/zmQuery351.js?version=866815
  6. // @description 【非自动关注】【自用,长期维护】【功能有】1. 阅读全文网站支持:CSDN、github.io、xz577.com、iteye.com、720ui.com、cloud.tencent.com、新浪、头条、网易新闻、腾讯新闻、51CTO、知乎、果壳科技(移动版)、awesomes.cn、javascriptcn.com、人民日报(移动版)、凤凰网、虎扑移动版、百度经验、360文档(个人图书馆)、乐居买房(移动版)、电子发烧友网(PC、移动版)、悟空问答(PC、移动版)、百家号、百度文章、简书移动版、搜狐移动版、goodreads(PC、移动版)、百度文库(移动、PC版)、36氪移动版、弟弟快看<br>备注: 反馈问题的小伙伴们请附加上有问题的网址链接哈
  7. // @author zhengmingliang
  8. // @match https://*.csdn.net/*
  9. // @match *://*.github.io/*
  10. // @match *://www.iocoder.cn/*
  11. // @match *://*.jianshu.com/p/*
  12. // @match *://m.sohu.com/a/*
  13. // @match *://*.xz577.com/*
  14. // @match *://*.javascriptcn.com/*
  15. // @match *://*.baidu.com/*
  16. // @exclude https://www.baidu.com/*
  17. // @exclude *://tieba.baidu.com/*
  18. // @exclude *://pan.baidu.com/*
  19. // @exclude *://wen.baidu.com/*
  20. // @match *://*.iteye.com/*
  21. // @match *://*.720ui.com/*
  22. // @match *://*.goodreads.com/book/show/*
  23. // @match *://www.wukong.com/question/*
  24. // @match *://cloud.tencent.com/developer/article/*
  25. // @match *://m.leju.com/*
  26. // @match *://*.didispace.com/*
  27. // @match *://*.sina.cn/*
  28. // @match *://*.toutiao.com/*
  29. // @match *://weibo.com/ttarticle/p/show*
  30. // @match *://card.weibo.com/article/m/show/id/*
  31. // @match *://3g.163.com/*
  32. // @match *://*.*.163.com/news/*
  33. // @match *://*.inews.qq.com/*
  34. // @match *://*.36kr.com/p/*
  35. // @match *://*.elecfans.com/*
  36. // @match *://inews.qq.com/*
  37. // @match *://xw.qq.com/*
  38. // @match *://blog.51cto.com/*
  39. // @match *://*.zhihu.com/question/*
  40. // @match *://*.guokr.com/*
  41. // @match *://*.awesomes.cn/*
  42. // @match *://*.javazhiyin.com/*
  43. // @match *://m.hupu.com/bbs/*
  44. // @match *://bugstack.cn/md/*
  45. // @match *://wap.peopleapp.com/article/*
  46. // @match *://jingyan.baidu.com/article/*
  47. // @match *://*.ifeng.com/c/*
  48. // @match *://*.360doc.com/content/*
  49. // @match *://www.hi-linux.com/posts/*
  50. // @match *://www.ddkk.com/zhuanlan/*
  51. // @match *://ddkk.com/zhuanlan/*
  52. // @match *://www.tapd.cn/*
  53. // @grant none
  54. // ==/UserScript==
  55.  
  56. (function () {
  57. 'use strict';
  58.  
  59. /**
  60. * 阅读全文 规则1(openwrite.cn 插件规则)
  61. * @param readMoreSelector
  62. * @param contentSelector
  63. */
  64. function readAllRule1(readMoreSelector, contentSelector,isCurrent) {
  65. if ($$$(readMoreSelector).length > 0) {
  66. console.log("检测到有阅读全文关注限制。。。。")
  67. // 移除阅读全文
  68. if(isCurrent){
  69. $$$(readMoreSelector).remove();
  70. }else {
  71. $$$(readMoreSelector).parent().remove();
  72. }
  73. // 使滚动条可见
  74. // $$$("#article_content").css('overflow','auto')
  75. // 优化后:直接将style置为空
  76. console.log("style:%s", $$$(contentSelector).prop('style'))
  77. $$$(contentSelector).prop('style', '')
  78. $$$(contentSelector).attr('style', '')
  79. $$$(contentSelector).css('max-height', 'none')
  80. $$$(contentSelector).css('height', 'auto')
  81. $$$(contentSelector).css('overflow', 'visible')
  82. console.log("已解除阅读全文关注限制。。。。")
  83. }
  84. }
  85.  
  86. /**
  87. * 阅读全文 规则1(openwrite.cn 插件规则)
  88. * @param readMoreSelector
  89. * @param contentSelector
  90. */
  91. function readAllRule1ByOrigin(readMoreSelector, contentSelector,removeCurrent) {
  92. var dom;
  93. var parentElement, contentElement;
  94. if (readMoreSelector.startsWith("#")) {
  95. dom = document.getElementById(readMoreSelector.substring(1))
  96. parentElement = removeCurrent ? dom : dom.parentElement;
  97. } else if (readMoreSelector.startsWith(".")) {
  98. dom = document.getElementsByClassName(readMoreSelector.substring(1))
  99. if (dom.length > 0) {
  100. parentElement = removeCurrent ? dom : dom[0].parentElement;
  101. }
  102.  
  103.  
  104. } else {
  105. dom = document.getElementsByTagName(readMoreSelector)
  106. parentElement = document.getElementsByClassName(readMoreSelector)[0].parentElement;
  107. }
  108.  
  109. if (contentSelector.startsWith("#")) {
  110. contentElement = document.getElementById(contentSelector.substring(1))
  111. contentElement.style = ''
  112. } else if (contentSelector.startsWith(".")) {
  113. contentElement = document.getElementsByClassName(contentSelector.substring(1))
  114. contentElement[0].style = ''
  115.  
  116. } else {
  117. contentElement = document.getElementsByTagName(contentSelector)
  118. contentElement[0].style = ''
  119. }
  120. console.log(111)
  121. parentElement.parentElement.removeChild(parentElement);
  122. }
  123.  
  124. /**
  125. * 规则2:移除指定标签的某个class样式
  126. * @param readMoreSelector
  127. * @param removeSelector
  128. * @param removeClass
  129. */
  130. function readAllRule2(readMoreSelector, removeSelector, removeClass) {
  131. if ($$$(readMoreSelector).length > 0) {
  132. console.log("检测到有阅读全文关注限制。。。。")
  133. // 移除阅读全文
  134. $$$(readMoreSelector).remove();
  135. // 使滚动条可见
  136. // $$$("#article_content").css('overflow','auto')
  137. }
  138.  
  139. if($$$(removeSelector).length > 0){
  140. // 优化后:直接将style置为空
  141. $$$(removeSelector).removeClass(removeClass)
  142. console.log("已解除阅读全文关注限制。。。。")
  143. }
  144. }
  145.  
  146. /**
  147. * 直接点击展开
  148. * @param clickSelector
  149. */
  150. function readAllRule3(clickSelector) {
  151. var selector = $$$(clickSelector);
  152. if (!selector) {
  153. selector = jQuery(clickSelector);
  154. }
  155. if (selector.length > 0) {
  156. console.log("检测到有阅读全文关注限制。。。。")
  157. // 点击展开
  158. selector.trigger("click")
  159. console.log("已解除阅读全文关注限制。。。。")
  160. }
  161. }
  162.  
  163. /**
  164. * 使用openwrite.cn策略的个人博客或其他使用类似的规则
  165. */
  166. function readAllRule4(removeSelector) {
  167. console.log("检测到有阅读全文关注限制。。。。")
  168. // 移除阅读全文
  169. $$$(removeSelector).parent().remove();
  170. var zIndexArray = [];
  171. var parentSelector = "div[style]"
  172. if ($$$("article[style]").length > 0) {
  173. parentSelector = "article[style]"
  174. }
  175. var flag = false
  176. //存放只有height属性的节点
  177. let heightArray = [];
  178. findElements();
  179. if (flag) {
  180. console.log("已解除阅读全文关注限制。。。")
  181. } else {
  182.  
  183. if (parentSelector == "div[style]" && heightArray.length == 1) {
  184. heightArray[0].prop("style", "")
  185. console.log("已解除阅读全文关注限制。。。。")
  186. } else {
  187. parentSelector = "div[style]"
  188. heightArray = [];
  189. findElements();
  190. if (heightArray.length == 1) {
  191. heightArray[0].prop("style", "")
  192. console.log("已解除阅读全文关注限制。。。。。")
  193. }
  194. }
  195. }
  196.  
  197. function findElements() {
  198. $$$(parentSelector).each(function (index) {
  199. var attr = $$$(this).attr('style');
  200. if (attr.indexOf("overflow") != -1 && attr.indexOf("height") != -1) {
  201. var overflow = $$$(this).css("overflow");
  202. if ('hidden' == overflow) {
  203. $$$(this).prop("style", "")
  204. flag = true
  205. }
  206. } else if (attr.indexOf("height") != -1) {
  207. console.log("index:", index, $$$(this))
  208. heightArray.push($$$(this))
  209. }
  210. let text = $$$(this).text();
  211. if (attr.indexOf("z-index") != -1 && (text.indexOf("首次访问") != -1 || text.indexOf("人机检测") != -1)) {
  212. let zIndex = $$$(this).css("z-index");
  213. console.log("zIndex:", zIndex)
  214. let lastDiv = $$$("div[style]").filter(function () {
  215. return $$$(this).attr('style').indexOf("z-index") != -1 && $$$(this).css("z-index") == zIndex - 1
  216. })
  217. console.log("lastDiv:", lastDiv)
  218. if (lastDiv && lastDiv.length > 0) {
  219. lastDiv.remove();
  220. }
  221. }
  222.  
  223. })
  224. }
  225. }
  226.  
  227. /**
  228. * java学习 javazhiyin.com
  229. */
  230. function removeFirstLayer() {
  231. if ($$$(".layui-layer-page").length > 0) {
  232. var text = $$$(".layui-layer-page").text();
  233. if (text.indexOf('首次访问') != -1 || text.indexOf('人机识别')) {
  234.  
  235. }
  236.  
  237. $$$(".layui-layer-page").remove();
  238. $$$(".layui-layer-shade").remove();
  239. }
  240. $$$("div[index]")
  241.  
  242. }
  243.  
  244. /**
  245. * 对layui或layer 样式进行重写,使其弹框进行隐藏
  246. */
  247. function addLayerCssStyle() {
  248. $$$("style").get(0).append(".layui-layer-shade{display:none !important} .layui-layer-page{display:none !important}")
  249.  
  250. }
  251. function addLayerCssStyle2() {
  252. $$$("style").get(0).append(".layer-main{display:none !important}")
  253.  
  254. }
  255.  
  256. /**
  257. * 对class 样式进行重写,使滚动条显示
  258. */
  259. function addOverflowCssStyle(cssSelector) {
  260. console.log("style:%s", $$$(cssSelector).prop('style'))
  261. $$$(cssSelector).prop('style', '')
  262. $$$(cssSelector).attr('style', '')
  263. $$$(cssSelector).css('max-height', 'none')
  264. $$$(cssSelector).css('height', 'auto')
  265. $$$(cssSelector).css('overflow', 'visible')
  266. }
  267.  
  268. /**
  269. * 对class 样式进行重写
  270. */
  271. function addDisplayStyle(cssSelector) {
  272. $$$(cssSelector).css("display","none");
  273. $$$(cssSelector).attr("style","display:none");
  274. }
  275.  
  276. function addDisplayCssStyle() {
  277. $$$("style").get(0).append("article{opacity: 1 !important;display: block !important;}" +
  278. "#menu li{opacity: 1;display: block;}")
  279.  
  280. }
  281.  
  282. function removeAlertRule1() {
  283. $$$("div[style]").each(function (index) {
  284. let attr = $$$(this).attr('style');
  285. let text = $$$(this).text();
  286. if (attr.indexOf("z-index") != -1 && (text.indexOf("首次访问") != -1 || text.indexOf("人机检测") != -1)) {
  287. let zIndex = $$$(this).css("z-index");
  288. console.log("zIndex:", zIndex)
  289. let lastDiv = $$$("div[style]").filter(function () {
  290. return $$$(this).attr('style').indexOf("z-index") != -1 && $$$(this).css("z-index") == zIndex - 1
  291. })
  292. console.log("lastDiv:", lastDiv)
  293. if (lastDiv && lastDiv.length > 0) {
  294. lastDiv.remove();
  295. }
  296. $$$(this).remove();
  297. $$$('body').css("overflow", 'auto');
  298. }
  299.  
  300. })
  301.  
  302. readAllRule1("#locker",".lock",true)
  303. }
  304.  
  305. /**
  306. * 公共阅读全文规则1: 查找当前页面所有div接单,判断其style属性是否包含特征值
  307. */
  308. function commonReadAllRule1() {
  309. $$$("div").each(function (index) {
  310. let attr = $$$(this).attr('style');
  311. if(attr){
  312. if (attr.indexOf("height") != -1 && attr.indexOf("overflow") != -1 && attr.indexOf("hidden") != -1) {
  313. let id = $$$(this).attr('id');
  314. let cls = $$$(this).attr('class');
  315. let founded = false;
  316. if(id){
  317. console.log("检测到隐藏了全文的id:%s",id)
  318. founded = true
  319. }
  320. if(cls){
  321. console.log("检测到隐藏了全文的class:%s",cls)
  322. founded = true
  323. }
  324.  
  325. if(founded){
  326. $$$(this).prop('style','')
  327. $$$(this).attr('style','')
  328. }
  329.  
  330. }
  331. }
  332.  
  333. })
  334. }
  335.  
  336. /**
  337. * 公共移除dom节点
  338. */
  339. function commonRemoveRules1(selectors,isRemoveParent) {
  340. if ('string' == typeof (selectors)) {
  341. return commonRemoveRule1(selectors,isRemoveParent)
  342. }else {
  343. for (let index in selectors) {
  344. commonRemoveRule1(selectors[index],isRemoveParent)
  345. }
  346. }
  347.  
  348. }
  349.  
  350. /**
  351. * 公共查找节点名称
  352. */
  353. function commonFindRules1(keys) {
  354. let split = keys.split(",");
  355. let selector = $$$("div").filter(function (){
  356. let text = $$$(this).text();
  357. let flag = false;
  358. for (let i in split) {
  359. flag = text.indexOf(split[i]) && flag ;
  360. }
  361. return flag && $$$(this).children().length == 0
  362. })
  363. let id = selector.attr("id");
  364. if(id){
  365. return "#"+id;
  366. }
  367. let cls = selector.attr("class");
  368. if(cls){
  369. return "."+cls;
  370. }
  371. return selector;
  372. }
  373.  
  374. function commonRemoveRule1(selector,isRemoveParent) {
  375. var $selector = $$$(selector);
  376. if($selector.length > 0){
  377. if(isRemoveParent){
  378. $selector.parent().remove();
  379. }else {
  380. $selector.remove();
  381. }
  382. }
  383.  
  384. }
  385.  
  386. /**
  387. * 公共隐藏
  388. * @param selectors
  389. * @param isRemoveParent
  390. */
  391. function commonHideRule1(selectors) {
  392. var selectorArray = selectors.split(",");
  393. for (let index in selectorArray) {
  394. if ($$$("style").length > 0) {
  395. $$$("style").get(0).append(selectorArray[index] + "{display:none !important}");
  396. }else {
  397. $$$("header").append("<style></style>");
  398. $$$("style").get(0).append(selectorArray[index] + "{display:none !important}");
  399. }
  400. }
  401.  
  402.  
  403.  
  404.  
  405. }
  406. var $$$ = $ || window._$ || zmQuery;
  407. var href = window.location.href
  408.  
  409. function intervalReadAllRule2(checkSelector, removeSelector, removeClass) {
  410. let interval = setInterval(function () {
  411. console.log("轮训检测...")
  412. if ($$$(checkSelector).length > 0) {
  413. readAllRule2(checkSelector, removeSelector, removeClass)
  414. clearInterval(interval)
  415. }
  416.  
  417. }, 1000)
  418. }
  419.  
  420. // csdn
  421. if (href.indexOf('csdn') != -1) {
  422. console.log("检测到CSDN。。。。")
  423. // 已登录(不可用)
  424. readAllRule1("#btn-readmore-zk", "#article_content")
  425. // 未登录(不可用)
  426. readAllRule1(".btn-readmore", "#article_content")
  427. // 移动端处理
  428. readAllRule1(".btn_mod", ".article_content")
  429. $$$("style").get(0).append(".passport-login-container{display:none !important} \r\n .login-mark{display:none !important}");
  430.  
  431. // 处理未登录(不可用)时不能复制代码的问题
  432. if ($$$('.hljs-button').attr('data-title') == '登录(不可用)后复制') {
  433. $$$('.hljs-button').attr('data-title','复制(当前未登录(不可用))')
  434. // 将复制 按钮 的点击事件更换为copyCode
  435. $$$('code').attr('onclick','mdcp.copyCode(event)')
  436. }
  437.  
  438. // 修改csdn 登陆按钮跳转逻辑 从 弹框改为 跳转到登录(不可用)页
  439. $$$(".toolbar-btn-login").on('click',function (){
  440. window.location.href='https://passport.csdn.net/account/login'
  441. })
  442. } else if (href.indexOf('github.io') != -1) { //hoxis.github.io
  443. console.log("检测到github.io。。。。")
  444. readAllRule1("#read-more-btn", "#container")
  445. addDisplayCssStyle();
  446. } else if (href.indexOf('jianshu.com') != -1) { //jianshu.com
  447. console.log("检测到jianshu.com。。。。")
  448. commonHideRule1(".download-app-guidance,.call-app-btn,#jianshu-header")
  449. readAllRule1(".close-collapse-btn", ".collapse-free-content",)
  450. } else if (href.indexOf('m.sohu.com') != -1) { //m.sohu.com
  451. console.log("m.sohu.com。。。。")
  452. commonHideRule1(".lookall-box")
  453. readAllRule2("#artLookAll", ".hidden-content","hide")
  454. $$$(".content-image").each(function () {
  455. var src = $$$(this).data("src");
  456. $$$(this).attr("src",src);
  457. $$$(this).attr("data-lazy-load-completed","1");
  458.  
  459. })
  460. } else if (href.indexOf('jingyan.baidu.com') != -1) { //百度经验
  461. console.log("检测到百度经验。。。。")
  462. readAllRule2(".read-whole-mask", ".exp-content-container.fold","fold")
  463.  
  464. } else if (href.indexOf('xz577') != -1) { //www.xz577.com
  465. console.log("检测到xz577。。。。")
  466. readAllRule1(".m-zk", "#mewsmian")
  467. // Your code here...
  468. } else if (href.indexOf('cloud.tencent.com') != -1) { //cloud.tencent.com
  469. console.log("检测到tencent。。。。")
  470. let interval = setInterval(function () {
  471. if ($$$(".cdc-expand-area__toggle").length > 0) {
  472. readAllRule1(".cdc-expand-area__toggle", ".cdc-expand-area__main", true)
  473. // readAllRule2(".com-markdown-collpase-toggle", ".com-markdown-collpase-hide", "com-markdown-collpase-hide")
  474. clearInterval(interval)
  475. }
  476. }, 1000)
  477. // Your code here...
  478. } else if (href.indexOf('bugstack.cn') != -1) { //虫洞栈
  479. console.log("检测到bugstack.cn。。。。")
  480. var count = 0;
  481. let interval = setInterval(function () {
  482. if ($$$("#read-more-mask").length > 0) {
  483. readAllRule1("#read-more-mask", ".theme-default-content")
  484. clearInterval(interval)
  485. }
  486. count ++;
  487. if(count > 50){
  488. clearInterval(interval)
  489. }
  490. }, 1000)
  491. // Your code here...
  492. } else if (href.indexOf('iteye.com') != -1) { //iteye.com
  493. console.log("检测到iteye.com。。。。")
  494. readAllRule3("#btn-readmore")
  495. // Your code here...
  496. } else if (href.indexOf('720ui.com') != -1) { // 720ui.com
  497. console.log("检测到720ui.com。。。。")
  498. readAllRule1("#read-more-btn", "#main")
  499. } else if (href.indexOf('360doc.com') != -1) { // 360doc
  500. console.log("检测到360doc.com。。。。")
  501. addOverflowCssStyle(".article_container")
  502. addDisplayStyle(".article_showall")
  503. } else if (href.indexOf('m.leju.com') != -1) { // 360doc
  504. console.log("检测到m.leju.com。。。。")
  505. let interval = setInterval(function () {
  506. console.log("轮训检测...")
  507. if ($$$(".ztt_more").length > 0) {
  508. readAllRule1(".ztt_more", ".ztt_outer",true)
  509. clearInterval(interval)
  510. }
  511. }, 1000)
  512. }else if (href.indexOf('tapd.cn') != -1) { // tapd
  513. console.log("检测到tapd.cn。。。。")
  514. let interval = setInterval(function () {
  515. console.log("轮训检测...")
  516. if ($$$(".company-renew-dialog").length > 0) {
  517. readAllRule1(".company-renew-dialog", ".company-renew-dialog",true)
  518. readAllRule1(".v-modal", ".v-modal",true)
  519. clearInterval(interval)
  520. }
  521. }, 1000)
  522. } else if (href.indexOf('card.weibo.com') != -1) { // 微博
  523. console.log("检测到weibo.com。。。。")
  524. let interval = setInterval(function () {
  525. console.log("轮训检测...")
  526. if ($$$(".f-art-opt").length > 0) {
  527. readAllRule1(".f-art-opt", ".f-art",true)
  528. clearInterval(interval)
  529. }
  530. }, 1000)
  531. } else if (href.indexOf('weibo.com') != -1) { // 微博
  532. console.log("检测到weibo.com。。。。")
  533. let interval = setInterval(function () {
  534. console.log("轮训检测...")
  535. if ($$$(".artical_add_box").length > 0) {
  536. readAllRule1(".artical_add_box", ".WB_editor_iframe_new",true)
  537. clearInterval(interval)
  538. }
  539. }, 1000)
  540. } else if (href.indexOf('sina.cn') != -1) { // k.sina.cn
  541. console.log("检测到sina.cn。。。。")
  542. let interval = setInterval(function () {
  543. console.log("轮训检测...")
  544. if ($$$(".unfold-btn1").length > 0) {
  545. readAllRule1ByOrigin(".unfold-btn1", ".main-body")
  546. clearInterval(interval)
  547. }else if ($$$(".ztt_more").length > 0) {
  548. readAllRule1ByOrigin(".ztt_more", ".ztt_outer",true)
  549. clearInterval(interval)
  550. }else if ($$$(".look_more_a").length > 0) {
  551. readAllRule1ByOrigin("#artFoldBox", ".s_card z_c1",true)
  552. clearInterval(interval)
  553. }
  554. commonRemoveRules1(".callApp_fl_btn")
  555. }, 1000)
  556. } else if (href.indexOf('toutiao') != -1) { // toutiao.com
  557. console.log("检测到toutiao。。。。")
  558. // 循环检测
  559. intervalReadAllRule2(".fold-btn", ".fold-btn-content", "fold-btn-content-fold");
  560. // document.removeEventListener('click',getEventListeners($$$(document).get(0)).click[0].listener)
  561.  
  562.  
  563. } else if (href.indexOf('3g.163.com') != -1) { // 3g.163.com
  564. console.log("检测到163.com。。。。")
  565. // 循环检测
  566. let interval = setInterval(function () {
  567. console.log("轮训检测...")
  568. if ($$$(".expand_more").length > 0) {
  569. readAllRule1(".expand_more", "article")
  570. clearInterval(interval)
  571. }
  572. $$$(".article_comment").css("display","block")
  573. }, 1000)
  574.  
  575. } else if (href.indexOf('baijiahao') != -1|| href.indexOf('mbd.baidu.com') != -1) { // 百度文章
  576. console.log("检测到百家号。。。。")
  577. // 循环检测
  578. let interval = setInterval(function () {
  579. console.log("轮训检测...")
  580. if ($$$(".oPadding").length > 0) {
  581. readAllRule1(".oPadding", ".mainContent",true)
  582. $$$(".scrollHide").removeClass("scrollHide");
  583. clearInterval(interval)
  584. }
  585. if ($$$(".height-fold").length > 0) {
  586. readAllRule1(".height-fold", ".dynamic-item",true)
  587. $$$(".scrollHide").removeClass("scrollHide");
  588. clearInterval(interval)
  589. }
  590. }, 1000)
  591. addLayerCssStyle2();
  592. } else if (href.indexOf('wenku.baidu.com') != -1) { // 百度文库PC版
  593. console.log("检测到百度文库。。。。")
  594. // 循环检测
  595. let interval = setInterval(function () {
  596. console.log("轮训检测...")
  597. if ($$$("#reader-container").length > 0) {
  598. $$$("#reader-container").css("height","fit-content");
  599. commonHideRule1(".try-end-fold-page")
  600. clearInterval(interval)
  601. }
  602. }, 1000)
  603. } else if (href.indexOf('wk.baidu.com') != -1) { // 百度文库移动版
  604. console.log("检测到百度文库。。。。")
  605. // 循环检测
  606. let interval = setInterval(function () {
  607. console.log("轮训检测...")
  608. if ($$$(".fold-pager").length > 0) {
  609. $$$("#reader-container").css("height","fit-content");
  610. commonHideRule1(".fold-pager")
  611. $$$(".reader-wrap").css('height', 'auto')
  612. $$$("#view-app").css('max-height', '')
  613. $$$(".try-end-fold-page").css('display', 'block')
  614. clearInterval(interval)
  615. }
  616. }, 1000)
  617. } else if (href.indexOf('www.elecfans.com') != -1) { // elecfans.com
  618. console.log("检测到电子发烧友。。。。")
  619. // 循环检测
  620. let interval = setInterval(function () {
  621. console.log("轮训检测...")
  622. if ($$$(".seeHide").length > 0) {
  623. readAllRule1(".seeHide", ".simditor-body", true)
  624. clearInterval(interval)
  625. }
  626. }, 1000)
  627.  
  628. } else if (href.indexOf('m.elecfans.com') != -1) { // elecfans.com
  629. console.log("检测到电子发烧友。。。。")
  630. // 循环检测
  631. let
  632. interval = setInterval(function () {
  633. console.log("轮训检测...")
  634. if ($$$(".see_more_arc").length > 0) {
  635. readAllRule2(".see_more_arc", ".limit_height", "limit_height")
  636. clearInterval(interval)
  637. commonRemoveRule1(".open_app",false)
  638. commonRemoveRule1(".open_app_arc",false)
  639. commonRemoveRule1(".open_app_btn",false)
  640.  
  641. }
  642. }, 1000)
  643.  
  644.  
  645. } else if (href.indexOf('wukong.com') != -1) { // elecfans.com
  646. console.log("检测到悟空问答。。。。")
  647. // 循环检测
  648. let
  649. interval = setInterval(function () {
  650. console.log("轮训检测...")
  651. if ($$$(".fold").length > 0) {
  652. readAllRule2(".expand-bottom", ".fold", "fold")
  653.  
  654. }
  655. }, 1000)
  656.  
  657. let interval2 = setInterval(function () {
  658. console.log("轮训检测...")
  659. if ($$$(".read-mask").length > 0) {
  660. readAllRule1(".read-mask", ".content", true)
  661. clearInterval(interval2)
  662. commonRemoveRule1(".btn",false)
  663. commonRemoveRule1(".download",false)
  664.  
  665. }
  666. }, 1000)
  667.  
  668.  
  669. } else if (href.indexOf('peopleapp.com') != -1) { // peopleapp.com
  670. console.log("检测到人民日報。。。。")
  671. let count = 0;
  672. // 循环检测
  673. let interval = setInterval(function () {
  674. console.log("轮训检测...")
  675. if ($$$(".read-more-mask").length > 0) {
  676. readAllRule1(".read-more-mask", ".has-more-high",)
  677. $$$("#header").remove()
  678. if(count++ > 10){
  679. clearInterval(interval)
  680. }
  681. }
  682. }, 1000)
  683.  
  684. } else if (href.indexOf('ifeng.com') != -1) { // ifeng.com
  685. console.log("检测到鳳凰网。。。。")
  686. // 循环检测
  687. let interval = setInterval(function () {
  688. console.log("轮训检测...")
  689. if ($$$("div[class^=tip-]").length > 0) {
  690. // readAllRule4(, "div[class^=main_content-]")
  691. commonRemoveRules1(["div[class^=tip-]",".link-1xGgkMtk"])
  692. commonReadAllRule1();
  693. clearInterval(interval)
  694. }
  695. }, 1000)
  696.  
  697. } else if (href.indexOf('awesomes.cn') != -1) { // awesomes.com
  698. console.log("检测到awesomes.cn。。。。")
  699. // 循环检测
  700. if ($$$(".read_more_mask").length > 0) {
  701. readAllRule1(".read_more_mask", ".content")
  702. }
  703.  
  704. } else if (href.indexOf('javascriptcn.com') != -1) { // javascriptcn.com
  705. console.log("检测到javascriptcn.com。。。。")
  706. // 循环检测
  707. if ($$$(".read_more_mask").length > 0) {
  708. readAllRule1(".read_more_mask", ".markdown-body")
  709. }
  710.  
  711. } else if (href.indexOf('hupu.com') != -1) { // hupu.com
  712. console.log("hupu.com。。。。")
  713. // 循环检测
  714. let interval = setInterval(function (){
  715. console.log("轮训检测...")
  716. if ($$$(".open-btn").length > 0) {
  717. readAllRule1(".open-btn", "#bbs-detail-wrap")
  718. clearInterval(interval)
  719. }
  720.  
  721. },1000)
  722.  
  723.  
  724. } else if (href.indexOf('xw.qq.com') != -1) { // xw.qq.com
  725. console.log("检测到xw.qq.com。。。。")
  726. // 循环检测
  727. intervalReadAllRule2("div[aria-label]", "#article_body", "jsx-2375966888");
  728. $$$("#article_body").prop("style","margin:0 0.18rem; position:relative")
  729. } else if (href.indexOf('inews.qq.com') != -1) { // inews.qq.com
  730. console.log("检测到inews.qq.com。。。。")
  731. // 循环检测
  732. let interval = setInterval(function (){
  733. console.log("轮训检测...")
  734. if($$$("._1mAOD6Nkgp2wM7xlGCHeNi").length > 0){
  735. commonRemoveRules1(["._1mAOD6Nkgp2wM7xlGCHeNi","._1GTaS1LTuTrKnZ-oQ6KFRG"],true)
  736. commonReadAllRule1()
  737. clearInterval(interval)
  738. }
  739.  
  740. },1000)
  741.  
  742. } else if (href.indexOf('goodreads.com') != -1) { // goodreads.com
  743. console.log("检测到goodreads.com。。。。")
  744. // 循环检测
  745. let interval = setInterval(function (){
  746. console.log("轮训检测...")
  747.  
  748. if($$$("a[onclick^=swapContent").length > 0){
  749. // PC 版本
  750. $$$(".readable > span:nth-child(2)").attr("style","display:block")
  751. // 移动版本
  752. $$$(".bookReviewBody > span:nth-child(2)").attr("style","display:block")
  753. $$$("a[onclick^=swapContent").attr("style","display:none")
  754. clearInterval(interval)
  755. }
  756.  
  757. },1000)
  758.  
  759. } else if (href.indexOf('51cto.com') != -1) { // blog.51cto.com
  760. console.log("检测到blog.51cto.com。。。。")
  761. // 循环检测
  762. /*$$$(document).scroll(function (){
  763. let count = 0;
  764. console.log("轮训检测")
  765. let interval = setInterval(function (){
  766. if($$$("#login_iframe_mask").length > 0){
  767. console.log("已清理登录(不可用)弹框")
  768. $$$("#login_iframe_mask").remove();
  769. clearInterval(interval)
  770. }
  771. if( count ++ > 10){
  772. count = 0;
  773. clearInterval(interval)
  774. }
  775.  
  776. },1000)
  777. })*/
  778. // modify by zml 2020年10月31日 23:07:07 将原来监听是否有元素方式改为页面中添加css样式的方式来更好的解决弹框不停弹出的问题
  779. $$$("style").get(0).append("#login_iframe_mask{display:none}");
  780.  
  781. } else if (href.indexOf('zhihu.com') != -1 && document.documentElement.clientWidth<768) { // blog.51cto.com
  782. console.log("检测到zhihu.com。。。。")
  783. let count = 0;
  784. let interval = setInterval(function (){
  785. if(".ModalWrap-body".length > 0){
  786. $$$(".ModalWrap-body").prop("style","").removeClass("ModalWrap-body")
  787. }
  788. if(".is-collapsed".length > 0){
  789. $$$(".is-collapsed").removeClass("is-collapsed");
  790. }
  791. if($$$(".RichContent-inner").length > 0){
  792. // $$$(".RichContent-inner").prop("style","").removeClass("RichContent-inner--collapsed")
  793. addOverflowCssStyle(".RichContent-inner--collapsed")
  794. addOverflowCssStyle(".RichContent--unescapable")
  795. addOverflowCssStyle(".is-collapsed")
  796. }
  797. if ($$$(".expandButton").length > 0) {
  798. console.log("移除阅读全文")
  799. // $$$(".expandButton").remove()
  800. addDisplayStyle(".expandButton")
  801. }
  802. if ($$$(".ContentItem-expandButton").length > 0) {
  803. console.log("移除阅读全文")
  804. // $$$(".ContentItem-expandButton").remove()
  805. addDisplayStyle(".ContentItem-expandButton")
  806. }
  807. if(count++ > 100){
  808. clearInterval(interval);
  809. }
  810.  
  811. },100)
  812.  
  813. $$$("style").get(0).append(".ModalWrap{display:none}");
  814.  
  815. } else if (href.indexOf('36kr.com') != -1 && document.documentElement.clientWidth<768) { // 36氪
  816. console.log("检测到36kr.com。。。。")
  817.  
  818. let interval = setInterval(function (){
  819. if($$$(".tips-mask").length > 0){
  820. commonHideRule1(".tips-mask");
  821. commonHideRule1(".tips-content");
  822. commonHideRule1(".swiper-wrapper");
  823. $$$("#body-content").removeClass(" no-open")
  824. $$$("body").attr("style","")
  825. commonHideRule1(".article-goapp");
  826. clearInterval(interval);
  827. }
  828.  
  829.  
  830. },100)
  831.  
  832.  
  833. } else if (href.indexOf('m.guokr.com') != -1) { // m.guokr.com
  834. console.log("检测到m.guokr.com。。。。")
  835. //let height = $$$(".styled__ArticleContent-sc0ctyfcr-4").position().top-$$$(".styled__ArticleContent-sc0ctyfcr-4").children().position().top
  836. //$$$(".styled__ArticleContent-sc0ctyfcr-4").css("height",height);
  837. $$$(".jYkhp").css("max-height","100%");
  838. $$$(".jYkhp").css("overflow","auto");
  839. $$$(".styled__Button-sc-1ctyfcr-7").parent().remove()
  840. $$$(".gJghO").css("display","none")// 移除底部APP横幅广告
  841. } else if ($$$("#read-more-btn").length > 0) {
  842. console.log("检测到可能使用了openwrite推广工具。。。。")
  843. readAllRule4("#read-more-btn");
  844. } else if ($$$(".mask").length > 0 && $$$(".info").length > 0) { // cmsblogs.com
  845. console.log("检测到%s。。。。", href)
  846. readAllRule4(".info");
  847. } else if (href.indexOf("iocoder") != -1) {
  848. setInterval(removeAlertRule1(), 10000);
  849. } else if (href.indexOf("javazhiyin") != -1) {
  850. addLayerCssStyle();
  851. // 每隔10s移除弹出的关注检测弹框
  852. setInterval(removeFirstLayer(), 10000)
  853. } else if (href.indexOf("ddkh") != -1) {
  854. readAllRule1("#locker", ".row-content", true)
  855. } else {
  856.  
  857.  
  858. }
  859. })();

QingJ © 2025

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