🏠 Home 

自动展开全文阅读更多

自动展开网站全文内容而无需点击,去掉一些烦人广告,去掉需要打开app的提示,站外链直达(支持鼠标左右键和拖拽打开),避免网址重定向浪费时间,支持免登陆复制文字,兼容手机和电脑端。 -- 【目前已支持上百个网站】


安装此脚本?
  1. // ==UserScript==
  2. // @name 自动展开全文阅读更多
  3. // @version 1.169.0
  4. // @author baster
  5. // @description 自动展开网站全文内容而无需点击,去掉一些烦人广告,去掉需要打开app的提示,站外链直达(支持鼠标左右键和拖拽打开),避免网址重定向浪费时间,支持免登陆复制文字,兼容手机和电脑端。 -- 【目前已支持上百个网站】
  6. // @supportURL https://greasyfork.org/zh-CN/users/306433
  7. // @homepageURL https://greasyfork.org/zh-CN/users/306433
  8. // @namespace https://greasyfork.org/zh-CN/users/306433
  9. // @icon https://img.icons8.com/stickers/100/000000/double-down.png
  10. // @match *://theqoo.net/*
  11. // @match *://m.36kr.com/*
  12. // @match *://ext.baidu.com/api/comment/*
  13. // @match *://www.xz577.com/*
  14. // @match *://*.huanqiu.com/*
  15. // @match *://iknow.lenovo.com.cn/*
  16. // @match *://g.pconline.com.cn/*
  17. // @match *://www.it1352.com/*
  18. // @match *://www.jianshu.com/p/*
  19. // @match *://*.csdn.net/*
  20. // @match *://jingyan.baidu.com/article/*
  21. // @match *://baijiahao.baidu.com/s*
  22. // @match *://haokan.baidu.com/v*
  23. // @match *://zhidao.baidu.com/question/*
  24. // @match *://m.21jingji.com/article/*
  25. // @match *://www.bjtzdbzz.com/*
  26. // @match *://chejiahao.m.autohome.com.cn/info/*
  27. // @match *://www.bandbbs.cn/threads/*
  28. // @match *://*.elecfans.com/*
  29. // @match *://yiidian.com/*
  30. // @match *://*.yiidian.com/*
  31. // @match *://m.jb51.cc/*
  32. // @match *://www.jb51.cc/*
  33. // @match *://baike.baidu.com/item/*
  34. // @match *://wap.peopleapp.com/article/*
  35. // @match *://blog.51cto.com/*
  36. // @match *://xuedingmiao.com/*
  37. // @match *://xw.qq.com/*
  38. // @match *://mbd.baidu.com/newspage/*
  39. // @match *://ailegal.baidu.com/*
  40. // @match *://www.cnbeta.com/articles/*
  41. // @match *://www.zhihu.com/question/*
  42. // @match *://zhuanlan.zhihu.com/p/*
  43. // @match *://*.imooc.com/*
  44. // @match *://*.py.cn/code/*
  45. // @match *://*.sina.com.cn/*
  46. // @match *://juejin.cn/post/*
  47. // @match *://www.oschina.net/*
  48. // @match *://iswbm.com/*
  49. // @match *://m.so.com/s?q=*
  50. // @match *://wap.sogou.com/web/*
  51. // @match *://*.douban.com/*
  52. // @match *://www.wxnmh.com/*
  53. // @match *://www.chinaz.com/*
  54. // @match *://gitee.com/*
  55. // @match *://www.tianyancha.com/*
  56. // @match *://www.shaduizi.com/*
  57. // @match *://show.bookmarkearth.com/view/*
  58. // @match *://www.423down.com/*
  59. // @match *://www.itdaan.com/*
  60. // @match *://www.iteye.com/blog/*
  61. // @match *://www.360doc.com/*
  62. // @match *://www.360doc.cn/*
  63. // @match *://developer.aliyun.com/*
  64. // @match *://cloud.tencent.com/*
  65. // @match *://mail.qq.com/*
  66. // @match *://tieba.baidu.com/*
  67. // @match *://www.tieba.com/*
  68. // @match *://*.ifeng.com/*
  69. // @match *://*.ximalaya.com/*
  70. // @match *://www.sanzhima.com/*
  71. // @match *://m.meishichina.com/*
  72. // @match *://www.logonews.cn/*
  73. // @match *://segmentfault.com/*
  74. // @match *://ld246.com/*
  75. // @match *://*.bilibili.com/*
  76. // @match *://*.toutiao.com/*
  77. // @match *://www.itbaoku.cn/*
  78. // @match *://support.qq.com/*
  79. // @match *://m.downxia.com/*
  80. // @match *://*.sohu.com/*
  81. // @match *://m.weibo.cn/u/*
  82. // @match *://card.weibo.com/*
  83. // @match *://www.yunqishi.net/*
  84. // @match *://stackoom.com/*
  85. // @match *://www.codeprj.com/*
  86. // @match *://m.yezicc.com/*
  87. // @match *://*.ali213.net/*
  88. // @match *://itpcb.com/*
  89. // @match *://*.vovososo.com/*
  90. // @match *://www.lishixinzhi.com/*
  91. // @match *://www.anquanke.com/*
  92. // @match *://m.hexun.com/*
  93. // @match *://www.javascriptcn.com/*
  94. // @match *://*.zol.com.cn/*
  95. // @match *://www.5axxw.com/*
  96. // @match *://3g.163.com/*
  97. // @match *://*.js-code.com/*
  98. // @match *://*.wenda.so.com/*
  99. // @match *://wenda.so.com/*
  100. // @match *://*.dxy.cn/*
  101. // @match *://*heidong.com/*
  102. // @match *://www.tofacebook.com/*
  103. // @match *://www.ngui.cc/*
  104. // @match *://ddrv.cn/*
  105. // @match *://www.qcc.com/*
  106. // @match *://*.cnr.cn/*
  107. // @match *://*tinymind.net.cn/*
  108. // @match *://view.inews.qq.com/*
  109. // @match *://*gamersky.com/*
  110. // @match *://*.bugscaner.com/*
  111. // @match *://*.dgrt.cn/*
  112. // @match *://devnote.pro/*
  113. // @match *://betheme.net/*
  114. // @match *://*.rstk.cn/*
  115. // @match *://*.taodudu.cc/*
  116. // @match *://weibo.com/ttarticle/p/show*
  117. // @match *://weibo.com/cmbchina*
  118. // @match *://weibo.com/u/*
  119. // @match *://www.ctfiot.com/*
  120. // @match *://www.takefoto.cn/*
  121. // @match *://www.autohotkey.com/*
  122. // @match *://www.95pm.com/*
  123. // @match *://*.betheme.net/*
  124. // @match *://*.zoukankan.com/*
  125. // @match *://*.hexun.com/*
  126. // @match *://*.xjx100.cn/*
  127. // @match *://*.yii666.com/*
  128. // @match *://*.pianshen.com/*
  129. // @match *://*.knowbaike.com/*
  130. // @match *://pythonjishu.com/*
  131. // @match *://m.freebuf.com/*
  132. // @match *://www.nuomiphp.com/*
  133. // @match *://dhexx.cn/*
  134. // @match *://*.exyb.cn/*
  135. // @match *://ispacesoft.com/*
  136. // @match *://www.3424.cn/*
  137. // @match *://*.cnq.net/*
  138. // @match *://txc.qq.com/*
  139. // @match *://m.bjnews.com.cn/*
  140. // @match *://www.cn-healthcare.com/*
  141. // @match *://www.wevul.com/*
  142. // @match *://*.yuque.com/*
  143. // @match *://*.66law.cn/*
  144. // @match *://*.ssap.com.cn/*
  145. // @match *://*.chinaacc.com/*
  146. // @match *://lvlin.baidu.com/*
  147. // @match *://*.64365.com/*
  148. // @match *://programmercarl.com/*
  149. // @match *://*.qdxiaochuan.com/*
  150. // @match *://*.zjh336.cn/*
  151. // @match *://*.volcengine.com/*
  152. // @match *://*.289.com/*
  153. // @match *://*.hi-linux.com/*
  154. // @match *://*.chusan.com/*
  155. // @match *://*.nowcoder.com/*
  156. // @match *://*.techgrow.cn/*
  157. // @match *://*.gaodun.com/*
  158. // @match *://easylearn.baidu.com/*
  159. // @match *://*.youlai.cn/*
  160. // @match *://*.cndzys.com/*
  161. // @match *://*.jiangzi.com/*
  162. // @match *://*.dazhong.com/*
  163. // @match *://discussions*.apple.com/*
  164. // @match *://www.msn.cn/*
  165. // @match *://*.pcbaby.com.cn/*
  166. // @match *://*.youzan.com/*
  167. // @match *://*.93300.cn/*
  168. // @match *://sspai.com/*
  169. // @match *://*.xjishu.com/*
  170. // @match *://*.eastday.com/*
  171. // @match *://*.tuidc.com/*
  172. // @match *://*.saoniuhuo.com/*
  173. // @match *://*.pingguolv.com/*
  174. // @match *://*.ppmy.cn/*
  175. // @match *://*.ultimate-communications.com/*
  176. // @match *://*.zmtpc.com/*
  177. // @match *://m.eeo.com.cn/*
  178. // @match *://*.sina.cn/*
  179. // @match *://jpom.top/*
  180. // @match *://*.xlxbk.cn/*
  181. // @match *://*.dromara.org/*
  182. // @match *://*.dayi.org.cn/*
  183. // @match *://*.goodreads.com/*
  184. // @match *://*.mic-contest.com/*
  185. // @match *://*.528045.com/*
  186. // @match *://*.xilichi.com/*
  187. // @match *://*.ghxi.com/*
  188. // @match *://*.pixiv.net/*
  189. // @match *://*.dongchedi.com/*
  190. // @match *://*.autohome.com.cn/*
  191. // @match *://*.yicai.com/*
  192. // @match *://*.eastmoney.com/*
  193. // @match *://m.familydoctor.com.cn/*
  194. // @grant GM_addStyle
  195. // @grant GM_openInTab
  196. // @grant unsafeWindow
  197. // @run-at document-start
  198. // ==/UserScript==
  199. (function () {
  200. var websites = [
  201. {
  202. match: ["*://*.pixiv.net/*"],
  203. wait: [
  204. [
  205. "div:contains('浏览更多')", "click"
  206. ],
  207. [
  208. "div[class^='sc-']:contains('查看全部')", "click"
  209. ]
  210. ]
  211. },
  212. {
  213. match: ["*://*.ghxi.com/*"],
  214. js: () => {
  215. if (unsafeWindow.wpopt.module_site_notice_hash) {
  216. unsafeWindow.localStorage.setItem("wpopt_dialog_hash", unsafeWindow.wpopt.module_site_notice_hash);
  217. const e = new Date
  218. , t = e.getFullYear()
  219. , n = String(e.getMonth() + 1).padStart(2, "0")
  220. , r = String(e.getDate()).padStart(2, "0");
  221. let d = `${t}${n}${r}`;
  222. unsafeWindow.localStorage.setItem("wpopt_dialog_open_time", d);
  223. unsafeWindow.localStorage.setItem("wpopt_dialog_open", "true");
  224. }
  225. },
  226. },
  227. {
  228. match: ["*://*.goodreads.com/*"],
  229. wait: [
  230. [
  231. ".Button__labelItem:contains('Show more')",
  232. node => {
  233. let scrollPosition = window.scrollY || document.documentElement.scrollTop
  234. node.click();
  235. window.scrollTo(0, scrollPosition);
  236. return false;
  237. }
  238. ]
  239. ]
  240. },
  241. {
  242. match: ["*://*.dongchedi.com/*"],
  243. wait: [
  244. [
  245. "article[class*='index_article_']",
  246. node => {
  247. node.parentNode.style.height = "auto";
  248. node.parentNode.style.overflow = "auto";
  249. }
  250. ],
  251. [
  252. ".tw-text-color-gray-800.tw-text-10.tw-leading-14.tw-text-center:contains('4亿人用过')",
  253. node => {
  254. node.parentNode.parentNode.parentNode.parentNode.remove();
  255. }
  256. ],
  257. [
  258. "article > [class^='index_folder_']",
  259. node => {
  260. node.remove();
  261. }
  262. ],
  263. [
  264. ".tw-w-full.tw-flex.tw-text-16.tw-items-center.tw-justify-center:contains('打开懂车帝APP,阅读完整内容')",
  265. node => {
  266. node.remove();
  267. }
  268. ]
  269. ],
  270. js: () => {
  271. unsafeWindow.localStorage.setItem("_canUseWebp", 1);
  272. }
  273. },
  274. {
  275. match: ["*://m.familydoctor.com.cn/*"],
  276. hide: [".left"],
  277. expand: [".article-content"],
  278. },
  279. {
  280. match: ["*://*.eastmoney.com/*"],
  281. hide: [".readMoreBox"],
  282. expand: [".newstext"],
  283. },
  284. {
  285. match: ["*://*.yicai.com/*"],
  286. hide: [".textgradient.zhezhao", "#appdownload"],
  287. expand: ["#multi-text"],
  288. },
  289. {
  290. match: ["*://*.autohome.com.cn/*"],
  291. hide: ["#continue_reading", "#oppen_applet"],
  292. expand: ["#topicContentSection"],
  293. },
  294. {
  295. match: ["*://*.xilichi.com/*"],
  296. hide: [".show_more_btn"],
  297. expand: ["#readtxt-content"],
  298. },
  299. {
  300. match: ["*://*.528045.com/*"],
  301. hide: ["#sgui-collapse"],
  302. expand: [".sgui-customer-content"],
  303. },
  304. {
  305. match: ["*://*.mic-contest.com/*"],
  306. hide: ["mip-showmore.linear-gradient:after", ".mip-showmore-btn"],
  307. expand: ["mip-showmore"],
  308. },
  309. {
  310. match: ["*://*.dayi.org.cn/*"],
  311. hide: [".w-full.van-button--plain.van-button--info", ".full-button.flex.flex-col.justify-end.items-center"],
  312. expand: ["#tab-container", ".main-fold.article-module-container-padding"],
  313. },
  314. {
  315. match: ["*://*.xlxbk.cn/*"],
  316. hide: [".read-more"],
  317. expand: ["[data-nav='posts']"],
  318. },
  319. {
  320. match: ["*://jpom.top/*", "*://*.dromara.org/*"],
  321. js: () => {
  322. unsafeWindow.localStorage.isStarJpomRepo = new Date().getTime();
  323. unsafeWindow.localStorage.isStarRepo = new Date().getTime();
  324. },
  325. },
  326. {
  327. match: ["*://*.sina.cn/*"],
  328. hide: [".read-unfold-box", "#article_end + div", "#m-sentiment3"],
  329. expand: [".main-article-body"],
  330. },
  331. {
  332. match: ["*://m.eeo.com.cn/*"],
  333. wait: [
  334. [".a-load",
  335. node => {
  336. node.click();
  337. return false;
  338. },
  339. ],
  340. [".more",
  341. node => {
  342. node.click();
  343. return false;
  344. }
  345. ],
  346. ]
  347. },
  348. {
  349. match: ["*://*.ultimate-communications.com/*"],
  350. hide: [".readall_box"],
  351. expand: [".content-content"],
  352. },
  353. {
  354. match: ["*://*.pingguolv.com/*"],
  355. hide: [".click_more"],
  356. expand: ["mip-showmore"],
  357. },
  358. {
  359. match: ["*://*.zmtpc.com/*"],
  360. hide: [".readall"],
  361. expand: [".article .newstext"],
  362. },
  363. {
  364. match: ["*://*.saoniuhuo.com/*"],
  365. hide: [".mrc-btn-wrap"],
  366. expand: [".mrc-content"],
  367. },
  368. {
  369. match: ["*://*.tuidc.com/*"],
  370. hide: [".bottom_all_text_btn", ".bottom_all_text"],
  371. expand: [".ty_text_box"],
  372. },
  373. {
  374. match: ["*://*.eastday.com/*"],
  375. hide: [".expand-btn"],
  376. expand: [".post-content"],
  377. },
  378. {
  379. match: ["*://*.xjishu.com/*"],
  380. hide: [".gradBox", ".art-download"],
  381. expand: [".con-box"],
  382. },
  383. {
  384. match: ["*://sspai.com/*"],
  385. hide: ["#btn-call-app"],
  386. },
  387. {
  388. match: ["*://easylearn.baidu.com/edu-page/tiangong/*"],
  389. hide: [".bgk-detail .main-bottom", ".bgk-detail .banner", ".vip-banner-cont", ".vip-card-warp", ".business-el-line", ".question-cont .tigan .mask .toogle-btn"],
  390. expand: [".question-cont .tigan"],
  391. wait: [
  392. [".more-text",
  393. node => {
  394. node.click();
  395. return false;
  396. },
  397. ],
  398. [".dan-btn",
  399. node => {
  400. node.click();
  401. return false;
  402. },],
  403. [".exercise-btn-4",
  404. node => {
  405. node.click();
  406. return false;
  407. },],
  408. [".expand-btn",
  409. node => {
  410. node.click();
  411. return false;
  412. },],
  413. ]
  414. },
  415. {
  416. match: ["*://www.msn.cn/*"],
  417. hide: [".article-cont-read-button-container"],
  418. expand: [".article-body"],
  419. start: () => {
  420. Element.prototype._attachShadow = Element.prototype.attachShadow;
  421. Element.prototype.attachShadow = function () {
  422. let css = `
  423. .article-body
  424. {
  425. height: auto !important;
  426. max-height: unset !important;
  427. overflow: unset !important;
  428. -webkit-line-clamp: unset !important;
  429. }
  430. `;
  431. let style = document.createElement("style");
  432. style.type = "text/css";
  433. try {
  434. style.innerHTML = css;
  435. } catch (x) {
  436. style.innerText = css;
  437. }
  438. let shadow = this._attachShadow({ mode: "open" });
  439. shadow.appendChild(style);
  440. return shadow;
  441. };
  442. },
  443. },
  444. {
  445. match: ["*://*.93300.cn/*"],
  446. hide: [".entry-readmore"],
  447. expand: [".entry-content"],
  448. },
  449. {
  450. match: ["*://*.youzan.com/*"],
  451. hide: [".cms-article-lock"],
  452. expand: [".content-content"],
  453. },
  454. {
  455. match: ["*://ailegal.baidu.com/*"],
  456. hide: [".article-content .expand", ".article-content .mask"],
  457. expand: [".article-content .article-text"],
  458. },
  459. {
  460. match: ["*://*.pcbaby.com.cn/*"],
  461. hide: [".mip-showmore-btn"],
  462. expand: ["mip-showmore"],
  463. },
  464. {
  465. match: ["*://discussions*.apple.com/*"],
  466. hide: [".post-content-toggle .post-content-toggle-button"],
  467. expand: [".post-content-toggle", ".post-body.collapsed"],
  468. },
  469. {
  470. match: ["*://*.dazhong.com/*"],
  471. hide: ["#read-more", ".content-more"],
  472. expand: ["#wrap", "#cont"],
  473. },
  474. {
  475. match: ["*://*.jiangzi.com/*"],
  476. hide: [".show_more_btn"],
  477. expand: ["#readtxt-video", ".detailText"],
  478. },
  479. {
  480. match: ["*://*.cndzys.com/*"],
  481. hide: [".content-more"],
  482. expand: ["#cont"],
  483. },
  484. {
  485. match: ["*://*.youlai.cn/*"],
  486. hide: [".mip-showore-btn-bar", "div[class*='showBtn']"],
  487. expand: ["#show-more", "#js-content"],
  488. },
  489. {
  490. match: ["*://*.gaodun.com/*"],
  491. hide: [".view-more"],
  492. expand: [".m-context"],
  493. },
  494. {
  495. match: ["*://*.techgrow.cn/*"],
  496. hide: ["#readmore-wrapper"],
  497. expand: ["#readmore-container"],
  498. },
  499. {
  500. // https://m.nowcoder.com/discuss/607623789546844160
  501. // https://greasyfork.org/zh-CN/scripts/440400-%E8%87%AA%E5%8A%A8%E5%B1%95%E5%BC%80%E5%85%A8%E6%96%87%E9%98%85%E8%AF%BB%E6%9B%B4%E5%A4%9A/discussions/239120
  502. match: ["*://*.nowcoder.com/*"],
  503. hide: [".view-more-btn", ".article-btns-open", "#cyh_banner"],
  504. expand: ["div[id^='data']", ".xle.pop_.cn_"],
  505. js: () => {
  506. $(".continue-btn").click();
  507. let el = document.querySelector(".ncmain.appwithsplit");
  508. if (el) {
  509. el.__vue__.$options.parent.isShowAll = true;
  510. }
  511. nodes = document.querySelectorAll(".wonder-item");
  512. nodes.forEach(item => {
  513. item.__vue__.maxOneLineFontNum = 1000;
  514. item.__vue__.commentDisable = false;
  515. });
  516. $(".wonder-list").parent().parent()[0].__vue__.isShowAllList = true;
  517. nodes = querySelectorIncludesText('span.text-content', 'APP内查看完整回复');
  518. nodes.forEach(item => {
  519. item.remove();
  520. });
  521. },
  522. start: () => {
  523. var post = {};
  524. Object.defineProperty(unsafeWindow, "post", {
  525. get: function () {
  526. return post;
  527. },
  528. set: function (value) {
  529. post = value;
  530. post.isTestCmtGoApp = false;
  531. post.isTestHotTalkGoApp = false;
  532. },
  533. enumerable: true,
  534. configurable: false,
  535. });
  536. },
  537. },
  538. {
  539. match: ["*://*.chusan.com/*"],
  540. hide: [".view-more-btn", ".article-btns-open", "#cyh_banner"],
  541. expand: ["div[id^='data']", ".xle.pop_.cn_"],
  542. },
  543. {
  544. match: ["*://*.hi-linux.com/*"],
  545. hide: ["#read-more-wrap"],
  546. expand: ["#vip-container"],
  547. },
  548. {
  549. match: ["*://*.289.com/*"],
  550. hide: [".f-show-cont"],
  551. expand: [".m-downmain"],
  552. },
  553. {
  554. match: ["*://*.volcengine.com/*"],
  555. hide: ["div[class*='button-AVOE'][class*='volcfe-flex-middle']", "div[class^='cover-']"],
  556. expand: ["div[class^='content-'][class*='hidden-']"],
  557. hookEvent: ["copy"],
  558. },
  559. {
  560. match: ["*://*.zjh336.cn/*"],
  561. hide: [".readnum"],
  562. expand: [".viewall_plugin"],
  563. },
  564. {
  565. match: ["*://*.qdxiaochuan.com/*"],
  566. hide: [".teles, .telesmore"],
  567. expand: [".postcon"],
  568. },
  569. {
  570. match: ["*://programmercarl.com/*"],
  571. hide: ["#readmore-wrapper"],
  572. expand: [".theme-default-content", "#readmore-container"],
  573. },
  574. {
  575. match: ["*://*.64365.com/*"],
  576. hide: [".zs-unfold .unfd-btn-bar"],
  577. expand: [".unfd-ovh"],
  578. },
  579. {
  580. match: ["*://lvlin.baidu.com/*"],
  581. hide: [".check-more.check-fold"],
  582. expand: [".main-content-box"],
  583. },
  584. {
  585. match: ["*://*.chinaacc.com/*"],
  586. hide: [".news-con-mod .news-more-panel"],
  587. expand: [".news-con-mod"],
  588. },
  589. {
  590. match: ["*://*.ssap.com.cn/*"],
  591. hide: [".yueduqi_over"],
  592. expand: [".yueduqi_content"],
  593. },
  594. {
  595. match: ["*://*.yuque.com/*"],
  596. hide: ["div[class^=index-module_bottomAdvertiseWrapper]"],
  597. },
  598. {
  599. match: ["*://www.wevul.com/*"],
  600. directLink: [
  601. "*/go/*",
  602. (node) => {
  603. const regex = /\/go\/([^\/]+)$/;
  604. const base64Str = node.href.match(regex)[1];
  605. const decodedStr = atob(base64Str);
  606. node.href = decodedStr;
  607. node.setAttribute("target", "_blank");
  608. },
  609. ],
  610. },
  611. {
  612. match: ["*://*.66law.cn/*"],
  613. hide: [".det-unfold .unfd-flex-bar .unfd-btn"],
  614. expand: [".unfold-bar .unfd-ovh"],
  615. },
  616. {
  617. match: ["*://www.cn-healthcare.com/*"],
  618. hide: [".mask, .ni_mask", "footer"],
  619. expand: ["#artbody"],
  620. },
  621. {
  622. match: "*://txc.qq.com/*",
  623. directLink: ["*/link-jump?jump=*", "jump"],
  624. },
  625. {
  626. match: ["*://m.bjnews.com.cn/*"],
  627. hide: [".article > .shade"],
  628. expand: [".article"],
  629. },
  630. {
  631. match: ["*://*.cnq.net/*"],
  632. hide: ["#readmore-wrapper"],
  633. expand: ["#readmore-container"],
  634. },
  635. {
  636. match: ["*://www.3424.cn/*"],
  637. hide: [".div-mask>.div-showbtn"],
  638. expand: [".contents article"],
  639. },
  640. {
  641. match: ["*://ispacesoft.com/*"],
  642. hide: [".entry-readmore"],
  643. expand: [".entry-content"],
  644. },
  645. {
  646. // https://theqoo.net/hot/2963319501
  647. match: ["*://theqoo.net/*"],
  648. js: () => {
  649. var nowScroll = $(window).scrollTop();
  650. $(document).ajaxComplete(function (event, xhr, settings) {
  651. if (settings && settings.data && (settings.data.includes('act=dispBoardContentCommentListTheqoo') || settings.data.includes('act=dispTheqooContentCommentListTheqoo'))) {
  652. $(window).scrollTop(nowScroll);
  653. if ($(".show_more:not([style='display: none;'])").length > 0) {
  654. $(".show_more:not([style='display: none;'])").click();
  655. }
  656. }
  657. });
  658. }
  659. },
  660. {
  661. match: ["*://m.freebuf.com/*"],
  662. js: () => {
  663. if (window.innerWidth > 1024) {
  664. location.href = location.href.replace('m.freebuf.com', 'www.freebuf.com');
  665. }
  666. }
  667. },
  668. {
  669. match: ["*://www.nuomiphp.com/*"],
  670. hide: [".question-richtext .read-more"],
  671. expand: [".question-richtext"],
  672. },
  673. {
  674. match: ["*://pythonjishu.com/*"],
  675. hide: [".entry-readmore"],
  676. expand: [".entry-content"],
  677. },
  678. {
  679. match: ["*://*.knowbaike.com/*"],
  680. hide: ["#read-more"],
  681. expand: [".art-txt"],
  682. js: () => {
  683. document.oncontextmenu = function () { return true; };
  684. document.onkeydown = function () { return true; };
  685. }
  686. },
  687. {
  688. // 抄袭站直接跳转到原文即可
  689. match: ["*://*.pianshen.com/*"],
  690. js: () => {
  691. $('head').append('<meta name="referrer" content="never">');
  692. let url = $('#gotosource a').attr('href');
  693. if (url) {
  694. location.href = url;
  695. }
  696. }
  697. },
  698. {
  699. // 抄袭站直接跳转到原文即可
  700. match: ["*://*.yii666.com/*"],
  701. hide: ["#vipReadAll", ".sidebar"],
  702. expand: [".article-content-height"],
  703. js: () => {
  704. $('head').append('<meta name="referrer" content="never">');
  705. let url = $('.OpenToUrl').attr('data-href');
  706. if (url) {
  707. location.href = url;
  708. }
  709. }
  710. },
  711. {
  712. match: ["*://*.xjx100.cn/*", "*://dhexx.cn/*", "*://*.ppmy.cn/*"],
  713. js: () => {
  714. $('head').append('<meta name="referrer" content="never">');
  715. var originalTextMethod = $.fn.text;
  716. $.fn.text = function (value) {
  717. if (arguments.length === 0) {
  718. return originalTextMethod.call(this);
  719. } else {
  720. let re = originalTextMethod.call(this, value);
  721. let text = $('.source_url').text();
  722. if (text && (text.includes("http://") || text.includes("https://"))) {
  723. let regex = /(https?:\/\/[^\s]+)/;
  724. location.href = text.match(regex)[0];
  725. }
  726. return re;
  727. }
  728. };
  729. let text = $('.source_url').text();
  730. if (text && (text.includes("http://") || text.includes("https://"))) {
  731. let regex = /(https?:\/\/[^\s]+)/;
  732. location.href = text.match(regex)[0];
  733. } else {
  734. var test = false;
  735. var scriptTags = $("script");
  736. scriptTags.each(function () {
  737. var src = $(this).attr("src");
  738. if (src && src.includes("?source_url=")) {
  739. let { source_url } = parseUrl(src);
  740. if (source_url) {
  741. test = true;
  742. location.href = source_url;
  743. }
  744. }
  745. });
  746. if (!test) {
  747. let url = $('#vip').find('a').attr('href');
  748. if (url) {
  749. location.href = $('#vip').find('a').attr('href');
  750. }
  751. }
  752. }
  753. }
  754. },
  755. {
  756. match: ["*://*.zoukankan.com/*"],
  757. js: () => {
  758. $('head').append('<meta name="referrer" content="never">');
  759. let nodeList = querySelectorIncludesText('a[href^="http"]', '查看全文');
  760. if (nodeList.length > 0) {
  761. location.href = nodeList[0].href;
  762. }
  763. }
  764. },
  765. {
  766. match: ["*://*.hexun.com/*"],
  767. hide: ["div.showAll", "div.bottomLayer"],
  768. expand: ["div.art_contextBox"],
  769. },
  770. {
  771. match: ["*://*.betheme.net/*"],
  772. hide: ["#vip"],
  773. expand: [".articleHeight"],
  774. },
  775. {
  776. match: ["*://www.95pm.com/*"],
  777. hide: [".readall_box"],
  778. expand: [".readall-body"],
  779. },
  780. {
  781. match: ["*://www.takefoto.cn/*"],
  782. hide: [".content .article .article-text .load"],
  783. expand: [".article-text"]
  784. },
  785. {
  786. expand: [".content .article .article-text"],
  787. match: ["*://www.autohotkey.com/*"],
  788. js: () => {
  789. const items = document.querySelectorAll('.codebox > p > a:first-child + :nth-child(2)');
  790. items.forEach(item => {
  791. expandCode(item);
  792. });
  793. },
  794. },
  795. {
  796. match: ["*://www.ctfiot.com/*"],
  797. directLink: [
  798. "*/go/?url=*",
  799. (node) => {
  800. let { url } = parseUrl(node.href);
  801. if (url) {
  802. node.href = atob(url);
  803. node.setAttribute("target", "_blank");
  804. }
  805. },
  806. ],
  807. },
  808. {
  809. // https://weibo.com/cmbchina
  810. match: ["*://weibo.com/cmbchina*", "*://weibo.com/u/*"],
  811. wait: [
  812. [
  813. "span.expand",
  814. node => {
  815. node.click();
  816. return false;
  817. }
  818. ]
  819. ]
  820. },
  821. {
  822. // https://weibo.com/ttarticle/p/show?id=2309404890441668493647
  823. match: ["*://weibo.com/ttarticle/p/show*"],
  824. hide: [".artical_add_box"],
  825. expand: [".WB_editor_iframe_new"],
  826. },
  827. {
  828. match: ["*://*.rstk.cn/*", "*://*.taodudu.cc/*", "*://*.dgrt.cn/*", "*://*.exyb.cn/*"],
  829. hide: ["div#vip"],
  830. expand: [".article_content"],
  831. },
  832. {
  833. match: ["*://betheme.net/*"],
  834. hide: ["div#vip"],
  835. expand: [".articleHeight"],
  836. },
  837. {
  838. match: ["*://devnote.pro/*"],
  839. hide: [".readmore-box"],
  840. expand: [".post-mask"],
  841. },
  842. {
  843. match: ["*://*.bugscaner.com/*"],
  844. hide: ["#div_qrcode_container", "#top-header"],
  845. },
  846. {
  847. match: ["*://*tinymind.net.cn/*"],
  848. start: () => {
  849. // 或者废掉DOMMouseScroll
  850. unsafeWindow.verify_flag = 1;
  851. unsafeWindow.phone_verify_flag = 1;
  852. Object.defineProperty(unsafeWindow, "verify_flag", {
  853. get: function () {
  854. return 1;
  855. },
  856. enumerable: true,
  857. configurable: false,
  858. });
  859. Object.defineProperty(unsafeWindow, "phone_verify_flag", {
  860. get: function () {
  861. return 1;
  862. },
  863. enumerable: true,
  864. configurable: false,
  865. });
  866. },
  867. },
  868. {
  869. // https://view.inews.qq.com/k/20210608A045BD00
  870. match: ["*://view.inews.qq.com/*"],
  871. hide: ["div[class^=show-more_outer]", "div[class^=slider-top-bar_sliderWrapper]"],
  872. expand: ["div[class^=show-more_height-not-full]"],
  873. },
  874. {
  875. // https://wap.gamersky.com/news/Content-1571244.html
  876. match: ["*://*gamersky.com/*"],
  877. hide: [".gsAreaContextOpen", ".ymwBootDownload"],
  878. expand: ["#gsAreaContext"],
  879. },
  880. {
  881. match: ["*://www.qcc.com/*"],
  882. directLink: ["*://www.qcc.com/web/transfer-link?link=*", "link"],
  883. },
  884. {
  885. match: ["*://*.cnr.cn/*"],
  886. hide: ["#readmore"],
  887. expand: ["#perny-main"],
  888. },
  889. {
  890. match: ["*://www.ngui.cc/*"],
  891. hide: ["#vip"],
  892. expand: ["#contentWraper", ".article_content"],
  893. },
  894. {
  895. match: ["*://ddrv.cn/*"],
  896. hide: ["#read-more-wrap"],
  897. expand: ["#container"],
  898. },
  899. {
  900. match: ["*://*.dxy.cn/*"],
  901. hide: ["div[class^=contentWrapBottom_]"],
  902. expand: ["div[class^=contentWrap_]"],
  903. },
  904. {
  905. match: ["*://www.tofacebook.com/*"],
  906. hide: [".topic .more-box"],
  907. expand: [".topic"],
  908. },
  909. {
  910. // https://wenda.so.com/q/1679797307210735
  911. match: ["*://*wenda.so.com/*"],
  912. hide: ["#show-rest-entry", ".answer-part__has-folder__btn", ".unfold-page.js-unfold-page", "#js-unfold-more"],
  913. expand: ["#det-content", ".answer-part__has-folder", "#js-ans-box-first"],
  914. wait: [[".hide.js-unfold-answer.answer-fold-box", (node) => node.classList.remove("hide")]],
  915. },
  916. {
  917. match: ["*://*.js-code.com/*"],
  918. hide: ["#read-more-wrap"],
  919. expand: ["#codeContent", "#container"],
  920. },
  921. {
  922. match: ["*://*heidong.com/*"],
  923. hide: [".ggbox"],
  924. start: () => {
  925. // 阻止牛皮癣弹框
  926. unsafeWindow.user_login = true;
  927. Object.defineProperty(unsafeWindow, "user_login", {
  928. get: function () {
  929. return true;
  930. },
  931. enumerable: true,
  932. configurable: true,
  933. });
  934. },
  935. },
  936. {
  937. // https://wap.zol.com.cn/ask/x_19257207.html
  938. match: ["*://*.zol.com.cn/*"],
  939. hide: [".unfold-article-btn", ".wap__bottom-app-button"],
  940. expand: [".article-content"],
  941. wait: [
  942. ["div.show-all-reply", "click"]
  943. ]
  944. },
  945. {
  946. match: ["*://3g.163.com/*"],
  947. hide: [".backflow-floating.js-open-app"],
  948. },
  949. {
  950. // 某些采集机翻引流站点
  951. match: ["*://www.5axxw.com/*"],
  952. hide: ["#gzh-mask", "#gzh-modal"],
  953. },
  954. {
  955. match: ["*://m.hexun.com/*"],
  956. hide: [".article-open"],
  957. expand: [".article"],
  958. },
  959. {
  960. // var key = 'read' + (new Date).toJSON().substring(0, 7); localStorage
  961. match: ["*://www.javascriptcn.com/*"],
  962. hide: [".readall_box"],
  963. expand: [".markdown-body"],
  964. },
  965. {
  966. match: ["*://www.anquanke.com/*"],
  967. directLink: ["*://*/outLinkPage/?target=*", "target"],
  968. },
  969. {
  970. match: ["*://*.vovososo.com/*"],
  971. directLink: [
  972. "*/jump.html?url=*",
  973. (node) => {
  974. let { url } = parseUrl(node.href);
  975. if (url) {
  976. node.href = atob(url);
  977. node.setAttribute("target", "_blank");
  978. }
  979. },
  980. ],
  981. },
  982. {
  983. match: ["*://itpcb.com/*"],
  984. hide: ["#read-more-wrap"],
  985. expand: ["#container"],
  986. },
  987. {
  988. match: ["*://www.lishixinzhi.com/*"],
  989. hide: ["#showbtn"],
  990. expand: ["#endtext"],
  991. },
  992. {
  993. match: ["*://*.ali213.net/*"],
  994. hide: [".unfold-field.unfold-field-download", ".read-all-con", ".download-text"],
  995. expand: [".detail_content", "#Content"],
  996. },
  997. {
  998. match: ["*://m.yezicc.com/*"],
  999. hide: [".fulltext-button"],
  1000. expand: ["#article-body > .wrap"],
  1001. },
  1002. {
  1003. match: ["*://stackoom.com/*", "*://www.codeprj.com/*"],
  1004. js: () => {
  1005. if (!$.cookie("openid") || !$.cookie("loginCode")) {
  1006. $.cookie("openid", "1", { expires: 7 });
  1007. $.cookie("loginCode", "1", { expires: 7 });
  1008. }
  1009. },
  1010. },
  1011. {
  1012. match: ["*://www.yunqishi.net/*"],
  1013. hide: [".ckgd"],
  1014. expand: [".tw_contain"],
  1015. },
  1016. {
  1017. match: ["*://card.weibo.com/*", "*://weibo.com/ttarticle/*"],
  1018. hide: [".f-art-opt"],
  1019. expand: [".f-art"],
  1020. },
  1021. {
  1022. match: ["*://m.weibo.cn/u/*"],
  1023. directLink: ["*://weibo.cn/sinaurl?u=*", "u"],
  1024. },
  1025. {
  1026. // https://m.sohu.com/a/442909096_120459022/?pvid=000115_3w_a
  1027. match: "*://*.sohu.com/*",
  1028. hide: [".lookall-box", "#CallAppContainer"],
  1029. css: `
  1030. .hidden-content.hide,.control-hide {
  1031. display: block !important;
  1032. }
  1033. `,
  1034. js: () => {
  1035. $('#artLookAll').click();
  1036. }
  1037. },
  1038. {
  1039. match: "*://m.downxia.com/*",
  1040. hide: ["a.slide-btn"],
  1041. expand: [".chapter-cont"],
  1042. css: `
  1043. .chapter-cont.snbg {
  1044. position: unset !important;
  1045. }
  1046. `,
  1047. },
  1048. {
  1049. match: ["*://support.qq.com/*"],
  1050. directLink: ["*://support.qq.com/*/link-jump?jump=*", "jump"],
  1051. },
  1052. {
  1053. match: ["*://www.itbaoku.cn/*"],
  1054. hide: [".qa-content-more"],
  1055. expand: ["#qa-content"],
  1056. },
  1057. {
  1058. // https://wukong.toutiao.com/question/6712757183118835972/
  1059. match: ["*://*.toutiao.com/*"],
  1060. hide: ["a.j-expand-showfull.expand-bottom", ".m-share-answer .neck .mask", ".float-openapp", ".expand-container .expand-button-wrapper", ".wenda-answer-content .expand-button-wrapper", ".fold-outer-container .fold-button", ".fold-outer-container .fold-mask", ".arco-show-monitor .m-bottom-container", ".fold-content > .arco-show-monitor", ".content.collapsed > .content-shadow", ".m-top-container.m-top-larger.m-top-no-search.news_article", ".m-top-padding"],
  1061. expand: ["div.answer-text-full", "article.content", ".expand-container.folded", ".wenda-answer-content", ".fold-outer-container .fold-container", ".content.collapsed"],
  1062. },
  1063. {
  1064. match: ["*://www.bilibili.com/*"],
  1065. hide: [".h5-download-bar", ".read-article-box .read-more .arrow-cnt", ".video-desc-container .toggle-btn"],
  1066. expand: [".read-article-box.limit", ".video-desc-container .basic-desc-info"],
  1067. js: () => {
  1068. // 去掉复制的时候总是带上的尾巴
  1069. let node = document.getElementById("article-content");
  1070. if (node != null) {
  1071. node.oncopy = function (e) {
  1072. e.clipboardData.setData("text/plain", window.getSelection().toString());
  1073. e.preventDefault();
  1074. e.stopPropagation();
  1075. e.stopImmediatePropagation();
  1076. };
  1077. }
  1078. },
  1079. },
  1080. {
  1081. match: ["*://m.bilibili.com/video/*"],
  1082. hide: [".launch-app-btn.m-nav-openapp"],
  1083. wait: [
  1084. ["div.to-see", "click"]
  1085. ]
  1086. },
  1087. {
  1088. match: ["*://m.bilibili.com/*"],
  1089. hide: [".opus-read-more"],
  1090. expand: [".opus-module-content.limit"],
  1091. },
  1092. {
  1093. match: ["*://ld246.com/*"],
  1094. directLink: ["*://*ld246.com/forward?goto=*", "goto"],
  1095. },
  1096. {
  1097. match: ["*://segmentfault.com/*"],
  1098. directLink: [
  1099. "*://link.segmentfault.com/?enc=*",
  1100. (node) => {
  1101. // segmentfault这东西也去加密了?
  1102. if (/^https?:\/\//.test(node.innerText) && !node.innerText.endsWith("...")) {
  1103. node.href = node.innerText;
  1104. }
  1105. },
  1106. ],
  1107. },
  1108. // 暂时不用这功能
  1109. // {
  1110. // // https://cn.bing.com/search?form=MOZSBR&pc=MOZI&q=GIT_CLEAN_FLAGS
  1111. // match: ["*://cn.bing.com/search?*"],
  1112. // bindClick: [
  1113. // "a[href^=http]",
  1114. // (node, e) => {
  1115. // if (node.target == "_blank" && !node.hostname.includes("bing.com")) {
  1116. // e.stopPropagation();
  1117. // }
  1118. // },
  1119. // ],
  1120. // },
  1121. {
  1122. match: ["*://www.logonews.cn/*"],
  1123. directLink: ["*://link.logonews.cn/?url=*", "url"],
  1124. },
  1125. {
  1126. // https://m.meishichina.com/recipe/69477/
  1127. match: ["*://m.meishichina.com/*"],
  1128. hide: [".showmore_page_a"],
  1129. expand: ["#showmorearticle"],
  1130. },
  1131. {
  1132. match: ["*://www.sanzhima.com/*"],
  1133. directLink: [
  1134. "*://www.sanzhima.com/jump.html?url=*",
  1135. (node) => {
  1136. let { url } = parseUrl(node.href);
  1137. if (url) {
  1138. node.href = atob(url);
  1139. node.setAttribute("target", "_blank");
  1140. }
  1141. },
  1142. ],
  1143. },
  1144. {
  1145. // https://www.ximalaya.com/sound/357093858
  1146. match: ["*://www.ximalaya.com/*", "*://m.ximalaya.com/*"],
  1147. hide: [".more-intro-wrapper.cY_", ".stretch-box .mask.ib_", "a.init-code.schema-link"],
  1148. expand: [".draft._Fc, .sound-intro .intro._Fc", ".stretch-box.ib_", ".album-intro .intro.Q_v"],
  1149. },
  1150. {
  1151. // https://auto.ifeng.com/c/8EK6RQbD5U2
  1152. // https://i.ifeng.com/c/8EJoQhvSkT3
  1153. // https://ihouse.ifeng.com/news/2022_03_12-55263044_0.shtml
  1154. match: "*://*.ifeng.com/*",
  1155. hide: ["section[class^='bottomSlide-']", "header[class^='headerIn-']", "div[class^='callupBtn-']", "div[class^='more-']", "div[class^='tip-']", "div.showall", "div[class^='more-1-']", "div[class^='bottom_box-'] > div[class^='box-']", "div[class^='containerBox-'] > div[class^='shadow-']", "[class^='index_shadow'] > [class^='index_unfoldIcon']", "div[class^='index_tip_']", "div[class^='index_more_I-']", "div[class^='index_link_']"],
  1156. expand: ["div[class^='main_content-']", "section.article", "div[class^='containerBox-']", "div[class^='index_containerBox']", "div[class^='index_main_content_']"],
  1157. css: "#root>div[class^='main-'] {margin-bottom: unset !important;}",
  1158. },
  1159. {
  1160. // https://tieba.baidu.com/p/7412962296
  1161. // https://www.tieba.com/p/7745474371
  1162. match: ["*://tieba.baidu.com/*", "*://www.tieba.com/*"],
  1163. hide: [".appPromote", ".appBottomPromote", ".frs_daoliu_for_app", ".pb_cut_hot_recommend", ".father-cut-daoliu-normal-box", ".father-cut-daoliu-from-toutiao-box"],
  1164. directLink: [
  1165. "*://jump*.bdimg.com/safecheck/index?url=*",
  1166. (node) => {
  1167. if (/^https?:\/\//.test(node.innerText)) {
  1168. node.href = node.innerText;
  1169. }
  1170. },
  1171. ],
  1172. },
  1173. {
  1174. match: "*://mail.qq.com/*",
  1175. bindClick: [
  1176. "a[href^=http]",
  1177. (node, e) => {
  1178. if (node.target == "_blank" && !node.href.includes("mail.qq.com")) {
  1179. e.stopPropagation();
  1180. }
  1181. },
  1182. ],
  1183. },
  1184. {
  1185. // https://cloud.tencent.com/developer/article/1953552
  1186. match: "*://cloud.tencent.com/*",
  1187. hide: [".cdc-expand-area__toggle", ".com-markdown-collpase-hide .com-markdown-collpase-toggle", ".J-headerAdvertising", ".c-nav-advertising"],
  1188. expand: [".cdc-expand-area__main", ".com-markdown-collpase-hide .com-markdown-collpase-main"],
  1189. },
  1190. {
  1191. // https://developer.aliyun.com/article/875173
  1192. match: "*://developer.aliyun.com/*",
  1193. hide: ["#btn-readmore", ".article-hide-box"],
  1194. expand: [".article-hide-content"],
  1195. },
  1196. {
  1197. // http://www.360doc.com/content/20/0805/05/71057272_928578782.shtml
  1198. match: ["*://www.360doc.com/*", "*://www.360doc.cn/*"],
  1199. hide: [".article_showall"],
  1200. expand: ["#articlecontent", ".article_maxh"],
  1201. bindClick: [
  1202. "a[href^=http]",
  1203. (node, e) => {
  1204. if (node.target == "_blank" && !node.hostname.includes("360doc.com")) {
  1205. e.stopPropagation();
  1206. }
  1207. },
  1208. ],
  1209. },
  1210. {
  1211. // https://www.iteye.com/blog/agile-boy-274366
  1212. match: "*://www.iteye.com/blog/*",
  1213. hide: [".hide-article-box"],
  1214. expand: ["#blog_content"],
  1215. },
  1216. {
  1217. match: "*://www.423down.com/*",
  1218. directLink: [
  1219. "*://www.423down.com/go.php?url=*",
  1220. (node) => {
  1221. let { url } = parseUrl(node.href);
  1222. if (url) {
  1223. node.href = atob(url);
  1224. }
  1225. },
  1226. ],
  1227. },
  1228. {
  1229. // https://www.itdaan.com/blog/2019/08/06/1b407ea67c33df1c625ab657443ccd45.html
  1230. match: "*://www.itdaan.com/*",
  1231. js: () => {
  1232. if (!$.cookie("openid") || !$.cookie("loginCode")) {
  1233. $.cookie("openid", "1", { expires: 7 });
  1234. $.cookie("loginCode", "1", { expires: 7 });
  1235. }
  1236. if ($.cookie("vipuser") != "1") {
  1237. $.cookie("vipuser", "1", { expires: 7 });
  1238. }
  1239. },
  1240. directLink: [
  1241. "*://www.itdaan.com/link/*",
  1242. (node) => {
  1243. let url = node.href.split("/link/", 2)[1];
  1244. if (url) {
  1245. node.href = atob(url);
  1246. }
  1247. },
  1248. ],
  1249. },
  1250. {
  1251. match: "*://show.bookmarkearth.com/view/*",
  1252. js: () => {
  1253. let node = document.querySelector("p.link");
  1254. if (node) {
  1255. location.replace(node.innerText);
  1256. }
  1257. },
  1258. },
  1259. {
  1260. match: "*://www.shaduizi.com/*",
  1261. hide: [".content-container-open-btn"],
  1262. expand: [".content-section.content-section-container"],
  1263. },
  1264. {
  1265. match: "*://www.chinaz.com/*",
  1266. hide: [".contentPadding"],
  1267. expand: ["#article-content"],
  1268. },
  1269. {
  1270. match: "*://www.tianyancha.com/*",
  1271. bindClick: [
  1272. "a[href^=http]",
  1273. (node, e) => {
  1274. if (node.target == "_blank") {
  1275. e.stopPropagation();
  1276. }
  1277. },
  1278. ],
  1279. directLink: ["*://www.tianyancha.com/security?target=*", "target"],
  1280. },
  1281. {
  1282. match: "*://gitee.com/*",
  1283. directLink: ["*://gitee.com/link?target=*", "target"],
  1284. },
  1285. // {
  1286. // // 百度搜索移动端,该功能还有bug,免重定向跳转去掉,https://github.com/ViCrack/tempermonkey-script/issues/3#issuecomment-1507357746
  1287. // match: "*://m.baidu.com/*",
  1288. // bindClick: [
  1289. // "div.result",
  1290. // (node) => {
  1291. // if (node.dataset.log) {
  1292. // let link = JSON.parse(node.dataset.log).mu;
  1293. // node.querySelector("article").setAttribute("rl-link-href", link);
  1294. // }
  1295. // },
  1296. // ],
  1297. // },
  1298. {
  1299. match: "*://www.wxnmh.com/*",
  1300. hide: [".hide-article-box"],
  1301. expand: ["#message_content"],
  1302. },
  1303. {
  1304. match: "*://*.douban.com/*",
  1305. directLink: ["*.douban.com/link2/?url=*", "url"],
  1306. hide: [".oia-readall"],
  1307. expand: [".note-content"],
  1308. },
  1309. {
  1310. match: "*://wap.sogou.com/web/*",
  1311. directLink: ["*://wap.sogou.com/web/id=*&url=*", "url"],
  1312. },
  1313. {
  1314. match: "*://m.so.com/s?q=*",
  1315. directLink: ["*.so.com/jump?u=*", "u"],
  1316. },
  1317. {
  1318. match: "*://iswbm.com/*",
  1319. hide: ["#read-more-wrap"],
  1320. expand: ["#container"],
  1321. },
  1322. {
  1323. match: "*://www.oschina.net/*",
  1324. hide: ["div.collapse-bar"],
  1325. expand: ["div.article-detail"],
  1326. directLink: ["*://www.oschina.net/action/GoToLink?url=*", "url"],
  1327. },
  1328. {
  1329. match: "*://juejin.cn/post/*",
  1330. directLink: ["*link.juejin.cn/?target=*", "target"],
  1331. },
  1332. {
  1333. match: "*://www.3h3.com/soft/*",
  1334. hide: ["#showmore"],
  1335. expand: ["#ctext"],
  1336. },
  1337. {
  1338. match: "*://finance.sina.com.cn/*",
  1339. hide: ["#sina-cont000", "#sina-pages-u"],
  1340. },
  1341. {
  1342. // https://iask.sina.com.cn/b/new2COrHbarDpB.html
  1343. match: "*://*.sina.com.cn/*",
  1344. hide: [".detail-text-more", "#floating-image", ".answer-mask-box", ".answer-show-button"],
  1345. expand: [".new-pre-answer-text", ".knowledge-list-switch", ".detail-body"],
  1346. },
  1347. {
  1348. match: "*://*.py.cn/code/*",
  1349. start: () => {
  1350. unsafeWindow.IsLevelDate = 1;
  1351. Object.defineProperty(unsafeWindow, "IsLevelDate", {
  1352. get: function () {
  1353. return 1;
  1354. },
  1355. enumerable: true,
  1356. configurable: true,
  1357. });
  1358. Object.defineProperty(unsafeWindow, "is_login", {
  1359. get: function () {
  1360. return 1;
  1361. },
  1362. enumerable: true,
  1363. configurable: true,
  1364. });
  1365. },
  1366. },
  1367. {
  1368. match: "*://m.36kr.com/*",
  1369. hide: [".kr-mobile-goapp", ".article-goapp", ".float-app-button-wrp", ".article-top-swiper-goapp"],
  1370. expand: ["#body-content"],
  1371. },
  1372. {
  1373. match: ["*://m.imooc.com/*", "*://www.imooc.com/*"],
  1374. hide: [".wenda-more-wrap.js-wenda-more", "#js-appload", ".js-footer-appload", ".detail-content.long-content .showMore", ".hide-articel-box", ".js-show-reply-btn.hide-answer-morebtn"],
  1375. expand: ["#wap_wenda_detail", "#wenda_content", ".detail-content.long-content", "#js-qa-wenda", ".answer-content"],
  1376. },
  1377. {
  1378. match: "*://zhuanlan.zhihu.com/p/*",
  1379. hide: [".OpenInAppButton"],
  1380. css: `
  1381. [class^="css-"][href]{
  1382. display: block !important;
  1383. }
  1384. `,
  1385. directLink: ["*link.zhihu.com/?target=*", "target"],
  1386. },
  1387. {
  1388. match: "*://www.zhihu.com/question/*",
  1389. hide: [".OpenInAppButton", ".openInApp", ".DownloadGuide", ".Pc-feedAd-container", ".MobileAppHeader-downloadLink", ".ContentItem-expandButton", ".AdBelowMoreAnswers", ".MBannerAd"],
  1390. expand: [".RichContent-inner--collapsed", ".RichContent-inner"],
  1391. wait: [
  1392. [".ModalExp-modalShow", (node) => ((node.parentNode.style.display = "none"), document.body.classList.remove("ModalWrap-body"))],
  1393. [
  1394. ".is-collapsed",
  1395. (node) => {
  1396. node.classList.remove("is-collapsed");
  1397. },
  1398. ],
  1399. ],
  1400. directLink: ["*link.zhihu.com/?target=*", "target"],
  1401. css: `
  1402. .RichContent--unescapable.is-collapsed .RichContent-inner {
  1403. -webkit-mask-image: unset !important;
  1404. mask-image: unset !important;
  1405. }
  1406. .RichContent.is-collapsed {
  1407. cursor: unset !important;
  1408. }
  1409. .RichContent-inner {
  1410. margin-bottom: 40px !important;
  1411. }
  1412. `,
  1413. },
  1414. {
  1415. match: "*://www.cnbeta.com/articles/*",
  1416. hide: ["div[style='display:block !important;position:fixed;bottom:0;margin-top:10px;width:100%;background:#c44;color:#fff;font-size:15px;z-index:99999']"],
  1417. },
  1418. {
  1419. match: "*://xw.qq.com/cmsid/*",
  1420. hide: [".collapseWrapper", ".redbag.item"],
  1421. expand: ["#article_body"],
  1422. },
  1423. {
  1424. // https://xw.qq.com/amphtml/20220222A03ZFF00
  1425. match: "*://xw.qq.com/amphtml/*",
  1426. hide: ["div.ct-unfold"],
  1427. expand: [".article-main.fold"],
  1428. },
  1429. {
  1430. match: "*://xuedingmiao.com/*",
  1431. hide: ["#read-more-wrap"],
  1432. expand: ["#main-content"],
  1433. },
  1434. {
  1435. match: "*://blog.51cto.com/*",
  1436. js: () => {
  1437. safeWaitJQuery(() => {
  1438. jQuery(function () {
  1439. $(".copy_btn").removeClass("disable");
  1440. $(".copy_btn").text("免登录复制");
  1441. $(".article-content-wrap").unbind("copy");
  1442. if ("undefined" == typeof unsafeWindow.uid || !unsafeWindow.uid) {
  1443. unsafeWindow.uid = 1;
  1444. }
  1445. $("body")
  1446. .off()
  1447. .on("click", ".copy_btn", function (e) {
  1448. e.stopPropagation();
  1449. e.preventDefault();
  1450. let $this = $(this);
  1451. let text = $(this).parents(".hljs-cto").find("pre").find('[class*="language-"]')[0].textContent;
  1452. copy(text).then(
  1453. () => {
  1454. $this.text("已复制");
  1455. setTimeout(function () {
  1456. $this.text("免登录复制");
  1457. }, 2000);
  1458. },
  1459. (e) => {
  1460. $this.text("复制失败:" + e);
  1461. setTimeout(function () {
  1462. $this.text("免登录复制");
  1463. }, 2000);
  1464. }
  1465. );
  1466. return false;
  1467. });
  1468. });
  1469. });
  1470. },
  1471. },
  1472. {
  1473. match: "*://wap.peopleapp.com/article/*",
  1474. hide: [".read-more"],
  1475. expand: [".article-wrapper.has-more-high"],
  1476. },
  1477. {
  1478. match: "*://baike.baidu.com/item/*",
  1479. wait: [
  1480. [
  1481. // 需要循环?
  1482. ".yx-load-more-inner.J-yx-load-moreContent",
  1483. (node) => {
  1484. node.dispatchEvent(new Event("tap"));
  1485. document.getElementById("ui_refresh_down").style.display = "none";
  1486. return false;
  1487. },
  1488. ],
  1489. ],
  1490. },
  1491. {
  1492. match: ["*://m.jb51.cc/*", "*://www.jb51.cc/*"],
  1493. hide: ["#read-more-wrap"],
  1494. expand: ["#container"],
  1495. },
  1496. {
  1497. match: ["*://www.yiidian.com/*", "*://yiidian.com/*"],
  1498. hide: ["#read-more-wrap"],
  1499. expand: ["#yArticle"],
  1500. },
  1501. {
  1502. match: "*://bbs.elecfans.com/m/*",
  1503. hide: [".conMore", ".login-reg-fixed"],
  1504. expand: [".postListCon"],
  1505. },
  1506. {
  1507. match: ["*://www.elecfans.com/*", "*://m.elecfans.com/*"],
  1508. hide: [".seeHide_new_login", ".open_app.open_app_fixed", ".login-reg-fixed", ".seeHide"],
  1509. expand: [".article_content", ".simditor-body"],
  1510. },
  1511. {
  1512. match: "*://www.bandbbs.cn/threads/*",
  1513. hide: [".bbCodeBlock-expandLink.js-expandLink"],
  1514. wait: [[".js-expandWatch:not(.is-expanded)", (node) => node.classList.add("is-expanded")]],
  1515. },
  1516. {
  1517. match: "*://chejiahao.m.autohome.com.cn/info/*",
  1518. hide: ["#continue_reading"],
  1519. expand: [".major-long-details"],
  1520. wait: [[".pgc-details .fn-hide", (node) => node.classList.remove("fn-hide")]],
  1521. },
  1522. {
  1523. match: "*://www.bjtzdbzz.com/*",
  1524. hide: [".pc-request-btn", ".mb-request-btn"],
  1525. expand: [".detail-content-desc-show"],
  1526. },
  1527. {
  1528. match: "*://m.21jingji.com/article/*",
  1529. hide: [".content .mask"],
  1530. expand: [".txtContent"],
  1531. },
  1532. {
  1533. // https://zhidao.baidu.com/question/423275263.html
  1534. match: "*://zhidao.baidu.com/question/*",
  1535. hide: [".w-detail-display-btn-text", ".wgt-best-mask", ".wgt-answers-mask", ".wgt-question-desc-action", ".w-reply-text .unfold", "div.wgt-target .target-text .wgt-target-mask"],
  1536. expand: [".w-detail-container.w-detail-index", "div[id^=best-content-]", "div[id^=answer-content-]", ".wgt-question-desc-inner", ".w-reply-text", "div.wgt-target .target-text", ".w-detail-container.w-detail-single"],
  1537. wait: [
  1538. ["#show-answer-hide", (node) => {
  1539. if (node.querySelector('span').style.display == 'none') {
  1540. setTimeout(function () {
  1541. node.dispatchEvent(new Event("click"));
  1542. node.dispatchEvent(new Event("tap"));
  1543. console.log('click');
  1544. }, 1000);
  1545. }
  1546. }],
  1547. [".fold-num-feed.show-more-replies", (node) => {
  1548. setTimeout(function () {
  1549. node.dispatchEvent(new Event('click', {
  1550. bubbles: true, // 事件冒泡
  1551. cancelable: false, // 事件是否可以取消
  1552. }));
  1553. node.dispatchEvent(new Event('tap', {
  1554. bubbles: true, // 事件冒泡
  1555. cancelable: false, // 事件是否可以取消
  1556. }));
  1557. console.log('click');
  1558. }, 1000);
  1559. }]
  1560. ],
  1561. },
  1562. {
  1563. match: "*://haokan.baidu.com/v*",
  1564. hide: [".share-origin.wx-share-launch", ".player-pause-code-bottom-text", ".player-pause-code-inner"],
  1565. },
  1566. {
  1567. match: "*://www.xz577.com/*",
  1568. hide: [".article-content-body-more1"],
  1569. expand: [".con2"],
  1570. },
  1571. {
  1572. match: "*://www.it1352.com/*",
  1573. hide: [".arc-body-main-more"],
  1574. expand: [".arc-body-main"],
  1575. js: () => {
  1576. $.cookie("olduser", "1", {
  1577. domain: "it1352.com",
  1578. expires: 1500,
  1579. });
  1580. },
  1581. },
  1582. {
  1583. match: "*://g.pconline.com.cn/*",
  1584. hide: [".btnForAppOpenA", ".btnForAppOpenImg", ".add_artilce_handle", ".WakeUptop"],
  1585. expand: [".art-content"],
  1586. },
  1587. {
  1588. match: "*://3w.huanqiu.com/*",
  1589. hide: ["#more"],
  1590. expand: ["#content"],
  1591. },
  1592. {
  1593. match: ["*://m.huanqiu.com/*"],
  1594. hide: [".unfold-btn"],
  1595. expand: [".article-content", ".article .content"],
  1596. start: () => {
  1597. Element.prototype._attachShadow = Element.prototype.attachShadow;
  1598. Element.prototype.attachShadow = function () {
  1599. let css = `
  1600. .unfold-btn
  1601. {
  1602. display: none !important;
  1603. visibility:hidden !important;
  1604. max-height: 0 !important;
  1605. max-width: 0 !important;
  1606. height: 0 !important;
  1607. width: 0 !important;
  1608. }
  1609. .article-content, .article .content
  1610. {
  1611. height: auto !important;
  1612. max-height: unset !important;
  1613. overflow: unset !important;
  1614. -webkit-line-clamp: unset !important;
  1615. }
  1616. `;
  1617. let style = document.createElement("style");
  1618. style.type = "text/css";
  1619. try {
  1620. style.innerHTML = css;
  1621. } catch (x) {
  1622. style.innerText = css;
  1623. }
  1624. let shadow = this._attachShadow({ mode: "open" });
  1625. shadow.appendChild(style);
  1626. return shadow;
  1627. };
  1628. },
  1629. wait: [
  1630. [
  1631. ".unfold-btn",
  1632. (node) => {
  1633. node.dispatchEvent(new Event("click"));
  1634. node.dispatchEvent(new Event("tap"));
  1635. },
  1636. ],
  1637. ],
  1638. },
  1639. {
  1640. match: "*://iknow.lenovo.com.cn/*",
  1641. hide: [".coverQRCode"],
  1642. js: () => {
  1643. localStorage.setItem("scanQRCode", "1");
  1644. $(document).off("scroll.unable");
  1645. },
  1646. },
  1647. {
  1648. // https://www.jianshu.com/p/e7dc41b6ea54
  1649. match: "*://www.jianshu.com/p/*",
  1650. hide: [".call-app-btn", "#jianshu-header", "#note-show .content .show-content-free .collapse-tips", ".download", ".note-comment-above-ad-wrap", ".close-collapse-btn", ".open-app-btn", ".app-open", "#guangtui", "#fixed-ad-container", ".fubiao-dialog", ".header-wrap #jianshu-header"],
  1651. expand: ["#note-show .content .show-content-free .collapse-free-content"],
  1652. directLink: ["*://link.jianshu.com/?t=*", "t", "*://links.jianshu.com/go?to=*", "to"],
  1653. js: () => {
  1654. sessionStorage.setItem("showGuidance", 1);
  1655. let node = document.querySelector('.download-app-guidance');
  1656. if (node) {
  1657. node.__vue__.closeGuidance();
  1658. }
  1659. },
  1660. },
  1661. {
  1662. // 百度新闻, 百家号
  1663. match: ["*://baijiahao.baidu.com/s*", "*://ext.baidu.com/api/comment/v1/page/list*", "*://mbd.baidu.com/newspage/*", "*://www.baidu.com/#iact=wiseindex/tabs/news/activity/newsdetail=*"],
  1664. hide: [".packupButton", ".oPadding", ".newUnfoldFullBox.contentPadding", ".undefined", ".foldMaskWrapper", "#headDeflectorContainer"],
  1665. expand: [".mainContent", "#mainContentContainer"],
  1666. wait: [
  1667. ["p:contains('百度APP内阅读')", (node) => node.parentNode.parentNode.removeChild(node.parentNode)],
  1668. [".layer-content.layer-content-shown", (node) => node.querySelector(".layer-itemBtn.normal").dispatchEvent(new Event("click"))],
  1669. ],
  1670. },
  1671. {
  1672. match: ["*://download.csdn.net/download/*"],
  1673. js: () => {
  1674. let btn = $(".more-wrap").find(".el-button");
  1675. btn.removeAttr("data-report-click");
  1676. btn.click()
  1677. $("#desc-text").prop("checked", true);
  1678. }
  1679. },
  1680. {
  1681. match: ["*://gitcode.csdn.net/*"],
  1682. hide: [".article-show-more", ".article-detail .user-desc-fix", ".content-ai"],
  1683. expand: [".article-detail .main-content .user-article-hide"],
  1684. },
  1685. {
  1686. match: ["*://wenku.csdn.net/*"],
  1687. hide: [".article-box .cont .open", ".article-box .vip", ".article-box pre code .lowerBox"],
  1688. expand: [".article-box .cont.first-show", ".markdown_views .hljs"],
  1689. },
  1690. {
  1691. // https://huaweicloud.csdn.net/657c0ecddafaf23eeaee29b9.html
  1692. match: ["*://huaweicloud.csdn.net/*", "*://openatomworkshop.csdn.net/*"],
  1693. hide: [".article-detail .main-content .user-article-hide .article-show-more", ".article-detail .user-desc-fix"],
  1694. expand: [".article-detail .main-content", ".article-detail .main-content .user-article-hide"],
  1695. },
  1696. {
  1697. // https://ask.csdn.net/questions/8082390/54571405
  1698. match: ["*://ask.csdn.net/*"],
  1699. hide: [".expandBtn"],
  1700. expand: [".ask-issue-content"],
  1701. js: () => {
  1702. $('.answer-more').click();
  1703. }
  1704. },
  1705. {
  1706. match: "*://blog.csdn.net/*",
  1707. hide: [".weixin-shadowbox.wap-shadowbox", ".aside-header-fixed", ".hide-preCode-box", "#m_toolbar_left .m_toolbar_left_app_btn", ".readall_box", ".feed-Sign-span", ".btn_mod", ".btn_app_link", ".btn-readmore", ".comment_read_more_box", ".btn_open_app_prompt_div", ".feed-Sign-weixin"],
  1708. expand: [".article_content", "#article_content", "#comment", ".set-code-hide"],
  1709. directLink: ["*://link.csdn.net/?target=*", "target"],
  1710. bindClick: [
  1711. "a[href^=http]",
  1712. (node, e) => {
  1713. if (node.target == "_blank" && !node.hostname.includes(".csdn.net")) {
  1714. e.stopPropagation();
  1715. }
  1716. },
  1717. ],
  1718. // https://greasyfork.org/zh-CN/scripts/440400-%E8%87%AA%E5%8A%A8%E5%B1%95%E5%BC%80%E5%85%A8%E6%96%87%E9%98%85%E8%AF%BB%E6%9B%B4%E5%A4%9A/discussions/224754
  1719. css: `
  1720. #content_views,code,pre {
  1721. -webkit-touch-callout: auto !important;
  1722. -webkit-user-select: auto !important;
  1723. -khtml-user-select: auto !important;
  1724. -moz-user-select: auto !important;
  1725. -ms-user-select: auto !important;
  1726. user-select: auto !important;
  1727. }
  1728. main div.blog-content-box pre {
  1729. max-height: unset;
  1730. overflow-y: unset;
  1731. }
  1732. `,
  1733. js: () => {
  1734. safeWaitJQuery(() => {
  1735. jQuery(function () {
  1736. jQuery(function () {
  1737. jQuery(".recommend-jump-app").removeAttr("id");
  1738. jQuery(".recommend-jump-app")
  1739. .off("click")
  1740. .on("click", (e) => {
  1741. let url = jQuery(this).find("a.flag").attr("href");
  1742. if (url) {
  1743. location.href = url;
  1744. }
  1745. });
  1746. jQuery("a[data-report-click]").removeAttr("data-report-click");
  1747. jQuery("a[data-report-query]").removeAttr("data-report-query");
  1748. if (typeof unsafeWindow.csdn != "undefined") {
  1749. // https://github.com/adlered/CSDNGreener
  1750. jQuery("code").attr("onclick", "mdcp.copyCode(event)");
  1751. try {
  1752. unsafeWindow.csdn.copyright.init("", "", "");
  1753. } catch (err) { }
  1754. try {
  1755. Object.defineProperty(unsafeWindow.csdn.report, "reportClick", {
  1756. value: function () {
  1757. return true;
  1758. },
  1759. writable: false,
  1760. configurable: false,
  1761. });
  1762. } catch (err) { }
  1763. try {
  1764. Object.defineProperty(unsafeWindow, "articleType", {
  1765. value: 0,
  1766. writable: false,
  1767. configurable: false,
  1768. });
  1769. } catch (err) { }
  1770. }
  1771. });
  1772. });
  1773. });
  1774. },
  1775. },
  1776. {
  1777. match: "*://jingyan.baidu.com/article/*",
  1778. hide: [".read-whole-mask"],
  1779. expand: [".exp-content-container"],
  1780. },
  1781. ];
  1782. function matchRule(str, rule) {
  1783. var escapeRegex = (str) => str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
  1784. return new RegExp("^" + rule.split("*").map(escapeRegex).join(".*") + "$").test(str);
  1785. }
  1786. // https://greasyfork.org/zh-CN/scripts/416338
  1787. function parseUrl(href) {
  1788. if (!href) return {};
  1789. let search;
  1790. try {
  1791. // 链接
  1792. const url = new URL(href);
  1793. ({ search } = url); // 主要处理对hash的search
  1794. if (!search && url.hash.includes("?")) {
  1795. search = url.hash.split("?")[1];
  1796. }
  1797. } catch (err) {
  1798. // 非链接,如:a=1&b=2、?a=1、/foo?a=1、/foo#bar?a=1
  1799. if (href.includes("?")) {
  1800. search = href.split("?")[1];
  1801. } else {
  1802. search = href;
  1803. }
  1804. }
  1805. const searchParams = new URLSearchParams(search);
  1806. return [...searchParams.entries()].reduce((acc, [key, value]) => ((acc[key] = value), acc), {});
  1807. }
  1808. function randomString(length, chars) {
  1809. let result = "";
  1810. for (let i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
  1811. return result;
  1812. }
  1813. function setCookie(name, value, days) {
  1814. let expires = "";
  1815. if (days) {
  1816. let date = new Date();
  1817. date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
  1818. expires = "; expires=" + date.toUTCString();
  1819. }
  1820. document.cookie = name + "=" + (value || "") + expires + "; path=/";
  1821. }
  1822. function getCookie(name) {
  1823. let nameEQ = name + "=";
  1824. let ca = document.cookie.split(";");
  1825. for (let i = 0; i < ca.length; i++) {
  1826. let c = ca[i];
  1827. while (c.charAt(0) == " ") c = c.substring(1, c.length);
  1828. if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
  1829. }
  1830. return null;
  1831. }
  1832. function eraseCookie(name) {
  1833. document.cookie = name + "=; Max-Age=-99999999;";
  1834. }
  1835. function clearAdLoop() {
  1836. let id = setTimeout(";");
  1837. for (let i = 0; i < id; i++) {
  1838. clearTimeout(i);
  1839. }
  1840. id = setInterval(";");
  1841. for (let i = 0; i < id; i++) {
  1842. clearInterval(i);
  1843. }
  1844. }
  1845. function safeWaitJQuery(callbackFunc) {
  1846. let jQueryTimer = setInterval(function () {
  1847. if (typeof jQuery !== "undefined") {
  1848. clearInterval(jQueryTimer);
  1849. callbackFunc(jQuery);
  1850. }
  1851. }, 300);
  1852. }
  1853. function nativeCopy(value) {
  1854. return new Promise((resolve, reject) => {
  1855. let textArea = document.createElement("textarea");
  1856. textArea.value = value;
  1857. textArea.style.top = "0";
  1858. textArea.style.left = "0";
  1859. textArea.style.position = "fixed";
  1860. document.body.appendChild(textArea);
  1861. textArea.focus();
  1862. textArea.select();
  1863. try {
  1864. document.execCommand("copy");
  1865. setTimeout(() => {
  1866. resolve(value);
  1867. }, 1);
  1868. } catch (e) {
  1869. setTimeout(() => {
  1870. reject(e);
  1871. }, 1);
  1872. }
  1873. document.body.removeChild(textArea);
  1874. });
  1875. }
  1876. function copy(value) {
  1877. return new Promise((resolve, reject) => {
  1878. navigator.clipboard
  1879. ? navigator.clipboard.writeText(value).then(resolve, function () {
  1880. nativeCopy(text).then(resolve, reject);
  1881. })
  1882. : nativeCopy(text).then(resolve, reject);
  1883. });
  1884. }
  1885. function querySelectorIncludesText(selector, text) {
  1886. return Array.from(document.querySelectorAll(selector)).filter((el) => el.textContent.includes(text));
  1887. }
  1888. // https://github.com/Shawak/TwitchSquad/blob/main/twitchsquad.user.js
  1889. if (typeof GM_addStyle === "undefined") {
  1890. GM_addStyle = function (css) {
  1891. let head = document.getElementsByTagName("head")[0],
  1892. style = document.createElement("style");
  1893. if (!head) {
  1894. return;
  1895. }
  1896. style.type = "text/css";
  1897. try {
  1898. style.innerHTML = css;
  1899. } catch (x) {
  1900. style.innerText = css;
  1901. }
  1902. head.appendChild(style);
  1903. };
  1904. }
  1905. if (typeof unsafeWindow == "undefined") unsafeWindow = window;
  1906. const readyName = randomString(8, "abcdefghijklmnopqrstuvwxyz");
  1907. // https://greasyfork.org/zh-CN/scripts/28497
  1908. var EventTarget_addEventListener = EventTarget.prototype.addEventListener;
  1909. var document_addEventListener = document.addEventListener;
  1910. var Event_preventDefault = Event.prototype.preventDefault;
  1911. for (var website of websites) {
  1912. let hit = false;
  1913. if (Array.isArray(website.match)) {
  1914. hit = website.match.some((s) => matchRule(window.location.href, s));
  1915. } else {
  1916. hit = matchRule(window.location.href, website.match);
  1917. }
  1918. if (hit) {
  1919. console.log(website);
  1920. let style = "";
  1921. if ("hide" in website && website.hide.length > 0) {
  1922. style +=
  1923. website.hide.join(",\n") +
  1924. `
  1925. {
  1926. display: none !important;
  1927. visibility:hidden !important;
  1928. max-height: 0 !important;
  1929. max-width: 0 !important;
  1930. height: 0 !important;
  1931. width: 0 !important;
  1932. }
  1933. `;
  1934. }
  1935. if ("expand" in website && website.expand.length > 0) {
  1936. style +=
  1937. website.expand.join(",\n") +
  1938. `
  1939. {
  1940. height: auto !important;
  1941. max-height: unset !important;
  1942. overflow: unset !important;
  1943. -webkit-line-clamp: unset !important;
  1944. }
  1945. `;
  1946. }
  1947. if ("disable" in website && website.disable.length > 0) {
  1948. style +=
  1949. website.disable.join(",\n") +
  1950. `
  1951. {
  1952. pointer-events: none !important;
  1953. }
  1954. `;
  1955. }
  1956. if ("css" in website && website.css.length > 0) {
  1957. style += website.css;
  1958. }
  1959. GM_addStyle(style);
  1960. if ("wait" in website) {
  1961. // TODO 需要换种方式优化
  1962. let ready = [];
  1963. let id = setInterval(() => {
  1964. try {
  1965. for (let w of website.wait) {
  1966. if (!(w[0] in ready)) {
  1967. let nodeList;
  1968. let m = w[0].match(/(.+?):contains\(\s*['"](.+?)['"]\s*\)/);
  1969. if (m) {
  1970. nodeList = querySelectorIncludesText(m[1], m[2]);
  1971. } else {
  1972. nodeList = document.querySelectorAll(w[0]);
  1973. }
  1974. let allNodeFinish = nodeList.length > 0;
  1975. nodeList.forEach((node) => {
  1976. if (!node.dataset[readyName]) {
  1977. if (w[1] === "click") {
  1978. node.dispatchEvent(new Event("click"));
  1979. node.dispatchEvent(new Event("tap"));
  1980. node.click();
  1981. } else {
  1982. let callret = w[1].call(node, node); // 返回值
  1983. if (callret === false) {
  1984. allNodeFinish = false;
  1985. return;
  1986. }
  1987. }
  1988. node.dataset[readyName] = true;
  1989. }
  1990. });
  1991. if (allNodeFinish) {
  1992. ready.push(w[0]);
  1993. }
  1994. }
  1995. }
  1996. if (ready.length == website.wait.length) {
  1997. clearInterval(id);
  1998. }
  1999. } catch (x) {
  2000. clearInterval(id);
  2001. }
  2002. }, 1000);
  2003. }
  2004. if ("directLink" in website) {
  2005. // 去除链接重定向
  2006. // 支持鼠标左右键和拖拽打开超链接
  2007. document.addEventListener(
  2008. "mousedown",
  2009. (e) => {
  2010. // https://greasyfork.org/zh-CN/scripts/20431-zhihu-link-redirect-fix
  2011. let dom = e.target;
  2012. let target = dom.closest("a[href]");
  2013. if (target) {
  2014. let d = website.directLink;
  2015. for (let i = 0; i < d.length; i += 2) {
  2016. if (matchRule(target.href, d[i])) {
  2017. if (typeof d[i + 1] === "function") {
  2018. d[i + 1].call(target, target);
  2019. } else {
  2020. let param = parseUrl(target.href);
  2021. if (param[d[i + 1]]) {
  2022. target.href = param[d[i + 1]];
  2023. }
  2024. }
  2025. // 避免泄露来源, 加强隐私保护
  2026. if (target.target == "_blank") {
  2027. let rel = target.getAttribute("rel");
  2028. if (rel != null) {
  2029. if (!rel.includes("noreferrer")) {
  2030. target.setAttribute("rel", rel + " noreferrer");
  2031. }
  2032. } else {
  2033. target.setAttribute("rel", "noreferrer");
  2034. }
  2035. }
  2036. }
  2037. }
  2038. }
  2039. },
  2040. true
  2041. );
  2042. }
  2043. if ("bindClick" in website) {
  2044. document.addEventListener(
  2045. "click",
  2046. (e) => {
  2047. let dom = e.target;
  2048. let d = website.bindClick;
  2049. let target = dom.closest(d[0]);
  2050. if (target) {
  2051. d[1].call(target, target, e);
  2052. }
  2053. },
  2054. true
  2055. );
  2056. }
  2057. if ("start" in website) {
  2058. website.start();
  2059. }
  2060. if ("js" in website) {
  2061. if (document.readyState == "complete") {
  2062. website.js();
  2063. // alert("程序出现异常");
  2064. // GM_openInTab("https://greasyfork.org/zh-CN/scripts/440400/feedback");
  2065. } else {
  2066. document.addEventListener("DOMContentLoaded", website.js);
  2067. }
  2068. }
  2069. if ('hookEvent' in website) {
  2070. function addEventListener(type, func, useCapture) {
  2071. var _addEventListener = this === document ? document_addEventListener : EventTarget_addEventListener;
  2072. if (typeof obj === 'function' && website.hookEvent(type, func, useCapture)) {
  2073. return true
  2074. } else if (website.hookEvent.includes(type)) {
  2075. return true
  2076. } else {
  2077. _addEventListener.apply(this, arguments);
  2078. }
  2079. }
  2080. EventTarget.prototype.addEventListener = addEventListener;
  2081. document.addEventListener = addEventListener;
  2082. var frames = document.querySelectorAll("frame")
  2083. if (frames) {
  2084. for (let i = 0; i < frames.length; i++) {
  2085. frames[i].contentWindow.document.addEventListener = addEventListener;
  2086. }
  2087. }
  2088. document.addEventListener("DOMContentLoaded", function () {
  2089. var frames = document.querySelectorAll("frame")
  2090. if (frames) {
  2091. for (let i = 0; i < frames.length; i++) {
  2092. frames[i].contentWindow.document.addEventListener = addEventListener;
  2093. }
  2094. }
  2095. });
  2096. }
  2097. break;
  2098. }
  2099. }
  2100. })();