自动展开

自动展开文档 隐藏部分;长期维护、PC+手机全平台支持;全平台支持:CSDN、编程之家、简书、知乎、百家号、百度资讯、百度百科、百度经验、百度知道、百度贴吧、百度新闻、新浪新闻、腾讯新闻、搜狐新闻、网易新闻、凤凰新闻、澎湃新闻、新京报、央广网、环球网、人民日报、人民网、中华网、今日头条、东方资讯、丁香园、有来医生、健康界、36氪、果壳、虎扑、虎嗅、头条、B站专栏、B站笔记、微博文章、豆瓣文章、豆瓣小组、开源中国、阿里云开发者社区、腾讯云开发者社区、华为云开发者社区、360图书馆、太平洋电脑网、中关村在线、汽车之家、游侠网、游民星空、网易大神、360问答、天眼查、天涯社区、新浪财经、东方财富网、喜马拉雅、it1352、代码随想录、古诗文网

Nainstalovat skript?
Skript doporučený autorem

Mohlo by se vám také líbit 骚扰拦截.

Nainstalovat skript
  1. // ==UserScript==
  2. // @name 自动展开
  3. // @version 1.3.81
  4. // @namespace https://github.com/AirBashX/AutoUnfold/
  5. // @homepageURL https://github.com/AirBashX/UserScript
  6. // @author airbash
  7. // @description 自动展开文档 隐藏部分;长期维护、PC+手机全平台支持;全平台支持:CSDN、编程之家、简书、知乎、百家号、百度资讯、百度百科、百度经验、百度知道、百度贴吧、百度新闻、新浪新闻、腾讯新闻、搜狐新闻、网易新闻、凤凰新闻、澎湃新闻、新京报、央广网、环球网、人民日报、人民网、中华网、今日头条、东方资讯、丁香园、有来医生、健康界、36氪、果壳、虎扑、虎嗅、头条、B站专栏、B站笔记、微博文章、豆瓣文章、豆瓣小组、开源中国、阿里云开发者社区、腾讯云开发者社区、华为云开发者社区、360图书馆、太平洋电脑网、中关村在线、汽车之家、游侠网、游民星空、网易大神、360问答、天眼查、天涯社区、新浪财经、东方财富网、喜马拉雅、it1352、代码随想录、古诗文网
  8. // @match *://*.blog.csdn.net/*
  9. // @match *://blog.csdn.net/*
  10. // @match *://ask.csdn.net/questions/*
  11. // @match *://download.csdn.net/download/*
  12. // @match *://wenku.csdn.net/answer/*
  13. // @match *://*.jb51.cc/*
  14. // @match *://*.jianshu.com/*
  15. // @match *://www.zhihu.com/question/*
  16. // @match *://zhuanlan.zhihu.com/p/*
  17. // @match *://jingyan.baidu.com/article*
  18. // @match *://zhidao.baidu.com/question*
  19. // @match *://baike.baidu.com/item/*
  20. // @match *://tieba.baidu.com/p*
  21. // @match *://wk.baidu.com/view/*
  22. // @match *://tanbi.baidu.com/h5apptopic/browse/*
  23. // @match *://baijiahao.baidu.com/s*
  24. // @match *://easylearn.baidu.com/edu-page/*
  25. // @match *://mbd.baidu.com/newspage/data/*
  26. // @match *://news.baidu.com/news*
  27. // @match *://m.baidu.com/sf_baijiahao/*
  28. // @match *://*.sina.cn/*
  29. // @match *://3g.163.com/*
  30. // @match *://*.sohu.com/a/*
  31. // @match *://view.inews.qq.com/*
  32. // @match *://*.ifeng.com/*
  33. // @match *://m.thepaper.cn/newsDetail_forward*
  34. // @match *://m.bjnews.com.cn/detail/*
  35. // @match *://*.huanqiu.com/article/*
  36. // @match *://3w.huanqiu.com/a/*
  37. // @match *://3g.china.com/act/*
  38. // @match *://m.toutiao.com/article/*
  39. // @match *://mini.eastday.com/*
  40. // @match *://*.dxy.cn/*
  41. // @match *://www.cn-healthcare.com/*
  42. // @match *://m.youlai.cn/*
  43. // @match *://space.bilibili.com/*/dynamic*
  44. // @match *://t.bilibili.com/*
  45. // @match *://www.bilibili.com/read/mobile*
  46. // @match *://m.bilibili.com/opus/*
  47. // @match *://weibo.com/ttarticle/p/show?id=*
  48. // @match *://card.weibo.com/article/m/show/id*
  49. // @match *://*.douban.com/*
  50. // @match *://www.oschina.net/p/*
  51. // @match *://developer.aliyun.com/article/*
  52. // @match *://cloud.tencent.com/developer/article/*
  53. // @match *://cloud.tencent.com/developer/beta/article/*
  54. // @match *://huaweicloud.csdn.net/*
  55. // @match *://www.360doc.cn/article/*
  56. // @match *://www.360doc.com/content/*
  57. // @match *://g.pconline.com.cn/x/*
  58. // @match *://m.zol.com.cn/article/*
  59. // @match *://m.autohome.com.cn/news/*
  60. // @match *://chejiahao.m.autohome.com.cn/info/*
  61. // @match *://*.cnr.cn/*
  62. // @match *://club.m.autohome.com.cn/bbs/*
  63. // @match *://3g.ali213.net/*
  64. // @match *://wap.gamersky.com/*
  65. // @match *://m.ds.163.com/*
  66. // @match *://wenda.so.com/q/*
  67. // @match *://m.wenda.so.com/q/*
  68. // @match *://n.tianyancha.com/content/*
  69. // @match *://bbs.tianya.cn/m/*
  70. // @match *://wap.eastmoney.com/a/*
  71. // @match *://mguba.eastmoney.com/*
  72. // @match *://emcreative.eastmoney.com/*
  73. // @match *://*.ximalaya.com/*
  74. // @match *://www.gushiwen.cn/*
  75. // @match *://*.it1352.com/*
  76. // @match *://www.taodudu.cc/news/*
  77. // @match *://programmercarl.com/*
  78. // @match *://blog.didispace.com/*
  79. // @match *://*.wang1314.com/doc/*
  80. // @match *://*.k4china.com/*
  81. // @match *://www.tofacebook.com/*
  82. // @run-at document-start
  83. // @icon data:image/png;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAA29JREFUeF7tmMvrT08Yx1/fnViwVcq/gqKQa8gtd0Kyk8Vv81tZKWGByC233JWIwp9iYcPORkT56fl1po5pnjNn5syc6dOZz/Iz1/dr3s9z5pk5Jv6bm7h+KoDqgIkTqCEwcQPUJFhDoIbAxAnUEJi4AepXoIZADYGJE4gJgSPAF+BFYXYngU/AsyH7CAUg4s8B84GNBSGI+DPAAmDzEAghANriDfS9wO0hJxAx9iBwvhFvhu8HbkbM1fsz6BJfAoJL/CAIfRzQJX5MCF3ioyH4AOwGrjQxbxb5Cixy2G0fcCvGhj3GuMS79vEfIH1v9Jjz/y5dADTx/wCfgScjQdDE/wt8dCTiIAgaAE38MeBBI1yyrw3hN3AgoRO2A9eshCcnfwK42+xjvQJBxj70OcEFQMRftGz+C5BcYGfanBD6iDf6DgFXLbHihG3A4y4ILgBbgEeOQWuA147/VwFvrP/FCbK4K0x8hyLtmnj53D13TCD9LwMLW23fAclLnS7QQmCDspAGYRdwJxEEifmzlgN/AiL+npJ35HLWTsy9xPuS4A5lwVAI0t92iOaCUcX7AEh7qBPEivcdTlgHvPJ435Xtu07+aHMtnxdq+/Y+fPcA6RuaEzQIq4G3CoQi4vs4wOx3GfAhIDEuB947nOCCECpeEtslYNDJm731cYDp6xIlbVpOWAG880AoKj7EAUbHWuClwwlble+tC4IMl1J6aaukNVNKzMsJ23lE2pPEvL33EAfEQlipxP4364Y3uvgYB/ggHG6urjZoDYLpJ9fb4wEnL/1PKWt5PjZ/N8c4IDWELvGuhJdM/BAHxELYBDxtnUFR8SkAyBxaYtypWNpAKC4+FQCZZ49SAmsQpIpcAlxwBKzY3nW3P91UqUEx7us8JAfYc2sQQl6PNfHyDpHltSklgC4n9IEgoXHdUdVlE58yBNpukEuRqwbXbowyVuoHud5GlbQ+m3e1p3aAWSukitRs733MGCLcjM0FQObv855QVHyuEGgfTJcTpBaQbJ+kqot1Q04HmD1p7wk/SosfwwEGgvaeYNp7v+HFnrQ2bgwHmLW194Ri4sd0gFY7FBVfAkC7diguvhQAA2Fxinp+aE4YMwcM3WuW8RVAFqwzNGl1wAwdVpatVgdkwTpDk1YHzNBhZdlqdUAWrDM06eQd8Acza/FB2qWb3AAAAABJRU5ErkJggg==
  84. // @grant none
  85. // @license GPL-3.0
  86. // ==/UserScript==
  87. (function () {
  88. "use strict";
  89.  
  90. /**
  91. * 网站列表
  92. * @type {name/url/操作类型}
  93. */
  94. const websites = [
  95. {
  96. name: "CSDN",
  97. url: "blog.csdn.net",
  98. handles: [
  99. //PC端:自动展开代码块
  100. {
  101. type: "click",
  102. item: ".hide-preCode-bt",
  103. },
  104. //PC端:关注博主即可阅读全文
  105. {
  106. type: "display",
  107. item: ".hide-article-box",
  108. },
  109. //阅读全文
  110. {
  111. type: "display",
  112. item: ".btn_mod",
  113. },
  114. {
  115. type: "height",
  116. item: ".article_content",
  117. },
  118. {
  119. type: "display",
  120. item: ".readall_box",
  121. },
  122. //展开评论
  123. {
  124. type: "click",
  125. item: ".btn_comment_readmore",
  126. },
  127. ],
  128. },
  129. {
  130. name: "CSDN问答",
  131. url: "ask.csdn.net/questions",
  132. handles: [
  133. //PC端:展开全部
  134. {
  135. type: "display",
  136. item: ".expandBtn",
  137. },
  138. {
  139. type: "height",
  140. item: ".normal-style",
  141. },
  142. //PC端:查看等多回答
  143. {
  144. type: "click",
  145. item: ".ic_ask_down_reeow",
  146. },
  147. ],
  148. },
  149. {
  150. name: "CSDN下载",
  151. url: "download.csdn.net/download",
  152. handles: [
  153. {
  154. type: "click",
  155. item: ".fl",
  156. },
  157. //展开全部
  158. {
  159. type: "click",
  160. item: ".unfold-font",
  161. },
  162. //查看更多
  163. {
  164. type: "click",
  165. item: ".el-button--text",
  166. },
  167. ],
  168. },
  169. {
  170. name: "CSDN文库",
  171. url: "wenku.csdn.net/answer/",
  172. handles: [
  173. //展开全部
  174. {
  175. type: "click",
  176. item: ".text-all",
  177. },
  178. ],
  179. },
  180. {
  181. name: "it1352",
  182. url: "it1352.com",
  183. handles: [
  184. //PC端:查看全文:解除公众号限制
  185. {
  186. type: "display",
  187. item: ".arc-body-main-more",
  188. },
  189. {
  190. type: "height",
  191. item: ".arc-body-main",
  192. },
  193. ],
  194. },
  195. {
  196. name: "编程之家",
  197. url: "jb51.cc",
  198. handles: [
  199. //PC端:阅读全文
  200. {
  201. type: "display",
  202. item: "#read-more-wrap",
  203. },
  204. {
  205. type: "height",
  206. item: "#container",
  207. },
  208. //展开
  209. {
  210. type: "height",
  211. item: ".read-more-hidden",
  212. },
  213. ],
  214. },
  215. {
  216. name: "简书",
  217. url: "jianshu.com/p",
  218. handles: [
  219. //阅读全文
  220. {
  221. type: "display",
  222. item: ".collapse-tips",
  223. },
  224. {
  225. type: "height",
  226. item: ".collapse-free-content",
  227. },
  228. //允许滑动
  229. {
  230. type: "overflow",
  231. item: "body",
  232. },
  233. ],
  234. //删除遮挡栏
  235. fun: function () {
  236. let css = document.createElement("style");
  237. css.innerText = ".collapse-free-content::after {height: 0px !important}";
  238. document.head.appendChild(css);
  239. },
  240. },
  241. {
  242. name: "知乎",
  243. url: "www.zhihu.com/question",
  244. handles: [
  245. {
  246. type: "display",
  247. item: ".ContentItem-rightButton",
  248. },
  249. {
  250. type: "height",
  251. item: ".RichContent-inner--collapsed",
  252. },
  253. ],
  254. fun: function () {
  255. let css = document.createElement("style");
  256. //空白遮挡
  257. css.innerText += ".RichContent--unescapable.is-collapsed .RichContent-inner {mask-image: unset !important;}";
  258. //点击按钮
  259. css.innerText += ".RichContent.is-collapsed {cursor: unset !important;}";
  260. document.head.append(css);
  261. },
  262. },
  263. {
  264. name: "百度经验",
  265. url: "jingyan.baidu.com/article",
  266. handles: [
  267. //PC端:展开内容
  268. {
  269. type: "display",
  270. item: ".read-whole-mask",
  271. },
  272. {
  273. type: "height",
  274. item: ".exp-content-container",
  275. },
  276. //展开内容
  277. {
  278. type: "click",
  279. item: ".more-img-opt",
  280. },
  281. ],
  282. },
  283. {
  284. name: "百度知道",
  285. url: "zhidao.baidu.com/question",
  286. handles: [
  287. //展开剩余
  288. {
  289. type: "display",
  290. item: ".w-detail-display-btn",
  291. },
  292. {
  293. type: "height",
  294. item: ".w-detail-container",
  295. },
  296. //PC端:展开全部(1)
  297. {
  298. type: "display",
  299. item: ".wgt-best-mask",
  300. },
  301. {
  302. type: "height",
  303. item: ".best-text",
  304. },
  305. //PC端:展开全部(2)
  306. {
  307. type: "display",
  308. item: ".wgt-answers-mask",
  309. },
  310. {
  311. type: "height",
  312. item: ".answer-text",
  313. },
  314. //PC端:更多回答1
  315. {
  316. type: "display",
  317. item: "#show-hide-container",
  318. },
  319. {
  320. type: "classList",
  321. item: ".answer",
  322. remove: "answer-hide",
  323. },
  324. //PC端:更多回答2
  325. {
  326. type: "display",
  327. item: ".show-answer-dispute",
  328. },
  329. {
  330. type: "classList",
  331. item: ".answer",
  332. remove: "answer-dispute-hide",
  333. },
  334. ],
  335. },
  336. {
  337. name: "百度百科",
  338. url: "baike.baidu.com/item",
  339. handles: [
  340. //展开全部
  341. {
  342. type: "click",
  343. item: ".layout-icons_down-arrow",
  344. },
  345. //点击加载更多
  346. {
  347. type: "display",
  348. item: "#ui_refresh_down",
  349. },
  350. ],
  351. fun: function () {
  352. //点击加载更多
  353. let button = document.querySelector(".yx-load-more-inner");
  354. button.dispatchEvent(new Event("tap"));
  355. },
  356. },
  357. {
  358. name: "百度贴吧",
  359. url: "tieba.baidu.com/p",
  360. handles: [
  361. //PC端:自动展开图片
  362. {
  363. type: "display",
  364. item: ".replace_tip",
  365. },
  366. {
  367. type: "height",
  368. item: ".replace_div",
  369. },
  370. //PC端:自动展开回复
  371. {
  372. type: "click",
  373. item: ".j_lzl_m",
  374. },
  375. ],
  376. },
  377. {
  378. name: "百度文库手机版1",
  379. url: "wk.baidu.com/view",
  380. handles: [
  381. //自动展开
  382. {
  383. type: "height",
  384. item: ".reader-copy",
  385. },
  386. {
  387. //透明遮挡
  388. type: "display",
  389. item: ".blur-bg",
  390. },
  391. ],
  392. fun: function () {
  393. //工具相关内容下移,避免遮挡
  394. let item = document.querySelector(".fold-pager");
  395. if (item) {
  396. item.style.setProperty("margin-top", "0px");
  397. }
  398. },
  399. },
  400. {
  401. name: "百度文库手机版2",
  402. url: "tanbi.baidu.com/h5apptopic/browse/",
  403. handles: [
  404. {
  405. //下载app,继续阅读
  406. type: "display",
  407. item: ".continue-read-wrap",
  408. },
  409. ],
  410. fun: function () {
  411. let item = document.querySelector("#read-view");
  412. item.setAttribute("scrolling", "yes");
  413. },
  414. },
  415. {
  416. name: "百家题库",
  417. url: "easylearn.baidu.com/edu-page/",
  418. handles: [
  419. //阅读全文
  420. {
  421. type: "display",
  422. item: ".shiti-answer .mask",
  423. },
  424. {
  425. type: "height",
  426. item: ".shiti-answer .analysis-text",
  427. },
  428. // 显示完整题目
  429. {
  430. type: "height",
  431. item: ".question-cont .tigan",
  432. },
  433. // 移除遮罩
  434. {
  435. type: "height",
  436. item: ".question-cont .tigan .mask",
  437. },
  438. ],
  439. },
  440. {
  441. name: "百家号",
  442. url: "baijiahao.baidu.com/s",
  443. handles: [
  444. //阅读全文
  445. {
  446. type: "display",
  447. item: ".oPadding",
  448. },
  449. {
  450. type: "height",
  451. item: ".mainContent",
  452. },
  453. //点击展开全文:狐猴浏览器特有bug
  454. {
  455. type: "height",
  456. item: "#mainContentContainer",
  457. },
  458. {
  459. type: "display",
  460. item: ".foldMaskWrapper",
  461. },
  462. ],
  463. },
  464. {
  465. name: "百度新闻",
  466. url: "mbd.baidu.com/newspage/data",
  467. handles: [
  468. //打开百度app:普通新闻
  469. {
  470. type: "display",
  471. item: "[class^=foldMaskWrapper-]",
  472. },
  473. {
  474. type: "height",
  475. item: "#dynamicItem",
  476. },
  477. //打开百度app:百度首页
  478. {
  479. type: "display",
  480. item: ".foldMaskWrapper",
  481. },
  482. {
  483. type: "height",
  484. item: "#mainContentContainer",
  485. },
  486. ],
  487. },
  488. {
  489. name: "新浪新闻",
  490. url: "sina.cn",
  491. handles: [
  492. //展开
  493. {
  494. type: "display",
  495. item: ".look_more",
  496. },
  497. {
  498. type: "height",
  499. item: ".s_card",
  500. },
  501. ],
  502. },
  503. {
  504. name: "网易新闻",
  505. url: "3g.163.com",
  506. handles: [
  507. //展开
  508. {
  509. type: "display",
  510. item: ".show_article",
  511. },
  512. {
  513. type: "height",
  514. item: "article",
  515. },
  516. ],
  517. },
  518. {
  519. name: "搜狐新闻",
  520. url: "sohu.com/a",
  521. handles: [
  522. {
  523. type: "display",
  524. item: ".lookall-box",
  525. },
  526. {
  527. type: "height",
  528. item: "#mp-editor",
  529. },
  530. ],
  531. fun: function () {
  532. onload = function () {
  533. let item = document.querySelector("#artLookAll");
  534. item.click();
  535. clearInterval(interval);
  536. };
  537. },
  538. },
  539. {
  540. name: "腾讯新闻",
  541. url: "view.inews.qq.com/",
  542. handles: [
  543. //点击展开全文
  544. {
  545. type: "display",
  546. item: "[class^=show-more_outer__]",
  547. },
  548. {
  549. type: "display",
  550. item: "[class^=show-more-article_cover__]",
  551. },
  552. {
  553. type: "height",
  554. item: "[class^=show-more_height-not-full__]",
  555. },
  556. ],
  557. },
  558. {
  559. name: "凤凰新闻",
  560. url: "ifeng.com/",
  561. handles: [
  562. //点击展开全文(新闻)
  563. {
  564. type: "display",
  565. item: "[class^=index_more_]",
  566. },
  567. {
  568. type: "display",
  569. item: "[class^=index_tip_",
  570. },
  571. {
  572. type: "height",
  573. item: "[class^=index_main_content_]",
  574. },
  575.  
  576. //点击查看完整内容(房产)
  577. {
  578. type: "display",
  579. item: ".showall",
  580. },
  581. {
  582. type: "height",
  583. item: ".article",
  584. },
  585. //展开全文(汽车)
  586. {
  587. type: "display",
  588. item: "[class^=more]",
  589. },
  590. {
  591. type: "height",
  592. item: "[class^=main_content]",
  593. },
  594. //展开(视频简介)
  595. {
  596. type: "click",
  597. item: "[class^=index_videoBrefTextBtn_]",
  598. },
  599. ],
  600. },
  601. {
  602. name: "澎湃新闻",
  603. url: "m.thepaper.cn/newsDetail_forward",
  604. handles: [
  605. //展开全文
  606. {
  607. type: "display",
  608. item: "#clickForMore",
  609. },
  610. {
  611. type: "height",
  612. item: ".newsdetail_body",
  613. },
  614. ],
  615. },
  616. {
  617. name: "新京报",
  618. url: "m.bjnews.com.cn/detail/",
  619. handles: [
  620. //展开全文
  621. {
  622. type: "display",
  623. item: ".shade",
  624. },
  625. {
  626. type: "height",
  627. item: ".article",
  628. },
  629. ],
  630. },
  631. {
  632. name: "央广网",
  633. url: "cnr.cn",
  634. handles: [
  635. //展开全文
  636. {
  637. type: "display",
  638. item: "#readmore",
  639. },
  640. {
  641. type: "height",
  642. item: "#perny-main",
  643. },
  644. ],
  645. },
  646. {
  647. name: "环球网1",
  648. url: "huanqiu.com/article/",
  649. handles: [
  650. //展开全文
  651. {
  652. type: "click",
  653. item: ".unfold-btn",
  654. },
  655. ],
  656. },
  657. {
  658. name: "环球网2",
  659. url: "3w.huanqiu.com/a/",
  660. handles: [
  661. //展开全文
  662. {
  663. type: "click",
  664. item: "#more",
  665. },
  666. ],
  667. },
  668. {
  669. name: "中华网",
  670. url: "3g.china.com/act/",
  671. handles: [
  672. //点击查看全文(剩余n%)
  673. {
  674. type: "display",
  675. item: "#js-continue-reading",
  676. },
  677. {
  678. type: "height",
  679. item: "#artiCon",
  680. },
  681. ],
  682. },
  683. {
  684. name: "今日头条:移动版",
  685. url: "m.toutiao.com/article/",
  686. handles: [
  687. //点击查看完整内容
  688. {
  689. type: "display",
  690. item: ".toggle-button-container",
  691. },
  692. {
  693. type: "display",
  694. item: ".content-shadow",
  695. },
  696. {
  697. type: "height",
  698. item: ".content",
  699. },
  700. ],
  701. },
  702. {
  703. name: "东方资讯",
  704. url: "mini.eastday.com/",
  705. handles: [
  706. //查看全文
  707. {
  708. type: "display",
  709. item: ".Unfolded-btn",
  710. },
  711. {
  712. type: "height",
  713. item: ".article-content",
  714. },
  715. ],
  716. },
  717. {
  718. name: "丁香园",
  719. url: "dxy.cn",
  720. handles: [
  721. //显示第一条评论
  722. {
  723. type: "height",
  724. item: ".dicussion-text",
  725. },
  726. //展开阅读全文
  727. {
  728. type: "display",
  729. item: "[class^=contentWrapBottom___]",
  730. },
  731. {
  732. type: "height",
  733. item: "[class^=contentWrap___]",
  734. },
  735. //机构号:展开阅读全文
  736. {
  737. type: "display",
  738. item: ".show-all",
  739. },
  740. {
  741. type: "height",
  742. item: ".article__content",
  743. },
  744. ],
  745. },
  746. {
  747. name: "健康界",
  748. url: "www.cn-healthcare.com/",
  749. handles: [
  750. //阅读全文
  751. {
  752. type: "display",
  753. item: ".mask",
  754. },
  755. {
  756. type: "height",
  757. item: "#artbody",
  758. },
  759. ],
  760. },
  761. {
  762. name: "有来医生",
  763. url: "m.youlai.cn/",
  764. handles: [
  765. //阅读全文
  766. {
  767. type: "display",
  768. item: ".showBtn--nqouA",
  769. },
  770. {
  771. type: "height",
  772. item: ".show-more",
  773. },
  774. ],
  775. },
  776. {
  777. name: "B站动态",
  778. url: "space.bilibili.com/",
  779. handles: [],
  780. fun: function () {
  781. //PC端展开简介
  782. let item1s = document.querySelectorAll(".folded");
  783. for (let item of item1s) {
  784. item.className = "bili-rich-text__content";
  785. }
  786. let item2s = document.querySelectorAll(".bili-rich-text__action");
  787. for (let item2 of item2s) {
  788. item2.innerText = "收起";
  789. }
  790. },
  791. },
  792. {
  793. name: "B站专栏",
  794. url: "m.bilibili.com/opus/",
  795. handles: [
  796. //展开阅读全文
  797. {
  798. type: "display",
  799. item: ".opus-read-more",
  800. },
  801. {
  802. type: "classList",
  803. item: ".opus-module-content",
  804. remove: "limit",
  805. },
  806. {
  807. type: "classList",
  808. item: ".opus-module-content",
  809. remove: "show-read-text",
  810. },
  811. ],
  812. },
  813. {
  814. name: "微博文章PC版",
  815. url: "weibo.com/ttarticle/p/show?id=",
  816. handles: [
  817. {
  818. type: "height",
  819. item: ".WB_editor_iframe_new",
  820. },
  821. {
  822. type: "display",
  823. item: ".btn_line",
  824. },
  825. ],
  826. },
  827. {
  828. name: "豆瓣",
  829. url: "douban.com",
  830. handles: [
  831. //点击展开全文
  832. {
  833. type: "display",
  834. item: ".oia-readall",
  835. },
  836. {
  837. type: "height",
  838. item: ".note-content",
  839. },
  840. ],
  841. fun: function () {
  842. //展开(简介)
  843. let item1 = document.querySelector(".subject-intro p");
  844. try {
  845. let str = item1.getAttribute("data-content");
  846. if (str) {
  847. item1.innerText = str;
  848. }
  849. } catch (error) {
  850. /* empty */
  851. }
  852. onload = function () {
  853. //展开(评论)
  854. let items2 = document.querySelectorAll(".LinesEllipsis-readmore");
  855. for (let item of items2) {
  856. item.click();
  857. }
  858.  
  859. //展开(PC端:评论;简介;人物简介)
  860. let items3 = document.querySelectorAll(".expand,.a_show_full,.fold-switch");
  861. for (let item of items3) {
  862. item.click();
  863. }
  864. };
  865. },
  866. },
  867. {
  868. name: "开源中国",
  869. url: "www.oschina.net/p/",
  870. handles: [
  871. //展开阅读全文
  872. {
  873. type: "display",
  874. item: ".collapse-bar",
  875. },
  876. {
  877. type: "height",
  878. item: ".article-detail",
  879. },
  880. ],
  881. },
  882. {
  883. name: "阿里云开发者社区",
  884. url: "developer.aliyun.com/article",
  885. handles: [
  886. //关注
  887. {
  888. type: "height",
  889. item: ".article-hide-content",
  890. },
  891. {
  892. type: "display",
  893. item: ".article-hide-box",
  894. },
  895. ],
  896. },
  897. {
  898. name: "腾讯云开发者社区",
  899. url: "cloud.tencent.com/developer/article/",
  900. handles: [
  901. //旧版:展开阅读全文
  902. {
  903. type: "height",
  904. item: ".com-markdown-collpase-main",
  905. },
  906. {
  907. type: "display",
  908. item: ".com-markdown-collpase-toggle",
  909. },
  910. //新版:展开阅读全文
  911. {
  912. type: "height",
  913. item: ".cdc-expand-area__main",
  914. },
  915. {
  916. type: "display",
  917. item: ".cdc-expand-area__toggle",
  918. },
  919. ],
  920. },
  921. {
  922. name: "华为云开发者社区",
  923. url: "huaweicloud.csdn.net/",
  924. handles: [
  925. //展开阅读全文
  926. {
  927. type: "height",
  928. item: ".user-article",
  929. },
  930. {
  931. type: "display",
  932. item: ".article-show-more",
  933. },
  934. ],
  935. },
  936. {
  937. name: "360图书馆手机版",
  938. url: "www.360doc.cn/article/",
  939. handles: [
  940. //移动版:展开剩余内容
  941. {
  942. type: "display",
  943. item: ".article_showall",
  944. },
  945. {
  946. type: "height",
  947. item: ".article",
  948. },
  949. ],
  950. },
  951. {
  952. name: "360图书馆PC版",
  953. url: "www.360doc.com/content/",
  954. handles: [
  955. {
  956. type: "classList",
  957. item: "body",
  958. remove: "articleMaxH",
  959. },
  960. ],
  961. },
  962. {
  963. name: "太平洋电脑网",
  964. url: "g.pconline.com.cn/x/",
  965. handles: [
  966. //展开全文
  967. {
  968. type: "display",
  969. item: ".show_article",
  970. },
  971. {
  972. type: "height",
  973. item: ".art-content",
  974. },
  975. ],
  976. },
  977. {
  978. name: "中关村在线",
  979. url: "m.zol.com.cn/article/",
  980. handles: [
  981. //展开全文
  982. {
  983. type: "display",
  984. item: ".unfold-article-btn",
  985. },
  986. {
  987. type: "height",
  988. item: ".article-content",
  989. },
  990. ],
  991. },
  992. {
  993. name: "汽车之家:新闻",
  994. url: "m.autohome.com.cn/news/",
  995. handles: [
  996. //点击展开剩余部分
  997. {
  998. type: "display",
  999. item: "#continue_reading",
  1000. },
  1001. {
  1002. type: "classList",
  1003. item: "#content .fn-hide",
  1004. remove: "fn-hide",
  1005. },
  1006. ],
  1007. },
  1008. {
  1009. name: "汽车之家:车家号",
  1010. url: "chejiahao.m.autohome.com.cn/info/",
  1011. handles: [
  1012. //点击展开剩余部分
  1013. {
  1014. type: "display",
  1015. item: "#continue_reading_new",
  1016. },
  1017. {
  1018. type: "classList",
  1019. item: ".pgc-details .fn-hide",
  1020. remove: "fn-hide",
  1021. },
  1022. ],
  1023. },
  1024. {
  1025. name: "汽车之家:论坛",
  1026. url: "club.m.autohome.com.cn/bbs/",
  1027. handles: [
  1028. //点击展开剩余部分
  1029. {
  1030. type: "display",
  1031. item: "#continue_reading",
  1032. },
  1033. {
  1034. type: "height",
  1035. item: "#topicContentSection",
  1036. },
  1037. {
  1038. type: "classList",
  1039. item: "#topicContentSection .fn-hide",
  1040. remove: "fn-hide",
  1041. },
  1042. ],
  1043. },
  1044. {
  1045. name: "游侠网",
  1046. url: "3g.ali213.net",
  1047. handles: [
  1048. //阅读全文
  1049. {
  1050. type: "display",
  1051. item: ".read-all-con",
  1052. },
  1053. {
  1054. type: "display",
  1055. item: ".read-all-con2",
  1056. },
  1057. {
  1058. type: "height",
  1059. item: ".detail-content",
  1060. },
  1061. ],
  1062. },
  1063. {
  1064. name: "游民星空",
  1065. url: "wap.gamersky.com/",
  1066. handles: [
  1067. //展开全文
  1068. {
  1069. type: "display",
  1070. item: ".gsAreaContextOpen",
  1071. },
  1072. {
  1073. type: "height",
  1074. item: "#gsAreaContext",
  1075. },
  1076. ],
  1077. },
  1078. {
  1079. name: "网易大神",
  1080. url: "m.ds.163.com/",
  1081. handles: [
  1082. //展开全文
  1083. {
  1084. type: "display",
  1085. item: ".feed-page-main-controller",
  1086. },
  1087. {
  1088. type: "height",
  1089. item: ".feed-page__main-content",
  1090. },
  1091. ],
  1092. },
  1093. {
  1094. name: "360文档",
  1095. url: "wenda.so.com/q/",
  1096. handles: [
  1097. //PC端:展开问答
  1098. {
  1099. type: "display",
  1100. item: ".answer-part__has-folder__btn",
  1101. },
  1102. {
  1103. type: "height",
  1104. item: ".answer-part__has-folder",
  1105. },
  1106. //PC端:更多回答
  1107. {
  1108. type: "display",
  1109. item: ".js-unfold-page",
  1110. },
  1111. {
  1112. type: "classList",
  1113. item: ".hide.js-unfold-answer.answer-fold-box",
  1114. remove: "hide",
  1115. },
  1116. //展开完整答案
  1117. {
  1118. type: "display",
  1119. item: ".overflow-cover",
  1120. },
  1121. {
  1122. type: "height",
  1123. item: ".max-height",
  1124. },
  1125. //更多回答
  1126. {
  1127. type: "display",
  1128. item: ".js-rest-icon",
  1129. },
  1130. {
  1131. type: "classList",
  1132. item: ".ans-box.hide",
  1133. remove: "hide",
  1134. },
  1135. ],
  1136. },
  1137. {
  1138. name: "天眼查",
  1139. url: "n.tianyancha.com/content",
  1140. handles: [
  1141. //展开剩余内容
  1142. {
  1143. type: "display",
  1144. item: "[class^=index_other-content-more__]",
  1145. },
  1146. {
  1147. type: "height",
  1148. item: "[class^=index_other-content-container__]",
  1149. },
  1150. ],
  1151. },
  1152. {
  1153. name: "天涯社区",
  1154. url: "bbs.tianya.cn/m/",
  1155. handles: [
  1156. //点击展开完整贴文
  1157. {
  1158. type: "display",
  1159. item: ".openFullPost",
  1160. },
  1161. {
  1162. type: "height",
  1163. item: ".onhide",
  1164. },
  1165. ],
  1166. //删除透明遮挡
  1167. fun: function () {
  1168. let css = document.createElement("style");
  1169. css.innerHTML = ".item-lz .bd.onhide:before{content:none}";
  1170. document.head.append(css);
  1171. },
  1172. },
  1173. {
  1174. name: "新浪财经",
  1175. url: "cj.sina.cn/article",
  1176. handles: [
  1177. //打开app阅读全文
  1178. {
  1179. type: "display",
  1180. item: ".read-unfold-box",
  1181. },
  1182. {
  1183. type: "height",
  1184. item: ".main-article-body",
  1185. },
  1186. ],
  1187. },
  1188. {
  1189. name: "东方财富网",
  1190. url: "wap.eastmoney.com/a/",
  1191. handles: [
  1192. //点击展开完整贴文
  1193. {
  1194. type: "display",
  1195. item: ".fold-btn",
  1196. },
  1197. {
  1198. type: "display",
  1199. item: ".fold-arrow",
  1200. },
  1201. {
  1202. type: "height",
  1203. item: "#articleContent",
  1204. },
  1205. //删除透明遮挡
  1206. {
  1207. type: "display",
  1208. item: ".fold-mask",
  1209. },
  1210. ],
  1211. },
  1212. {
  1213. name: "东方财富网:社区",
  1214. url: "emcreative.eastmoney.com/",
  1215. handles: [
  1216. //点击阅读全文
  1217. {
  1218. type: "display",
  1219. item: ".my_ad_wrap",
  1220. },
  1221. {
  1222. type: "height",
  1223. item: "#text-content",
  1224. },
  1225. ],
  1226. },
  1227. {
  1228. name: "东方财富网:股吧",
  1229. url: "mguba.eastmoney.com/",
  1230. handles: [
  1231. //点击阅读全文
  1232. {
  1233. type: "display",
  1234. item: "#foldup_box",
  1235. },
  1236. {
  1237. type: "height",
  1238. item: "#content",
  1239. },
  1240. ],
  1241. },
  1242. {
  1243. name: "喜马拉雅",
  1244. url: "www.ximalaya.com/",
  1245. handles: [
  1246. //简介
  1247. {
  1248. type: "display",
  1249. item: ".more-intro-wrapper",
  1250. },
  1251. {
  1252. type: "height",
  1253. item: ".layout-main div>article",
  1254. },
  1255. ],
  1256. },
  1257. {
  1258. name: "喜马拉雅",
  1259. url: "m.ximalaya.com/",
  1260. handles: [
  1261. //简介+评论
  1262. {
  1263. type: "height",
  1264. item: ".stretch-box",
  1265. },
  1266. ],
  1267. fun: function () {
  1268. onload = function () {
  1269. let item1 = document.querySelector(".stretch-more");
  1270. let item2 = item1.parentElement;
  1271. item2.remove();
  1272. };
  1273. },
  1274. },
  1275. {
  1276. name: "古诗文网",
  1277. url: "www.gushiwen.cn/",
  1278. handles: [],
  1279. fun: function () {
  1280. let item1s = document.evaluate("//a[contains(text(), '阅读全文')]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  1281. for (let i = 0; i < item1s.snapshotLength; i++) {
  1282. item1s.snapshotItem(i).click();
  1283. }
  1284. clearInterval(interval);
  1285. },
  1286. },
  1287. {
  1288. name: "淘嘟嘟",
  1289. url: "www.taodudu.cc/news/",
  1290. handles: [
  1291. //阅读全文,人机检测
  1292. {
  1293. type: "display",
  1294. item: "#vip",
  1295. },
  1296. {
  1297. type: "height",
  1298. item: "#article_content",
  1299. },
  1300. ],
  1301. },
  1302. {
  1303. name: "代码随想录",
  1304. url: "programmercarl.com/",
  1305. handles: [
  1306. //阅读全文
  1307. {
  1308. type: "display",
  1309. item: "#read-more-wrap",
  1310. },
  1311. {
  1312. type: "height",
  1313. item: "#container",
  1314. },
  1315. ],
  1316. },
  1317. {
  1318. name: "程序猿DD",
  1319. url: "blog.didispace.com",
  1320. handles: [
  1321. //阅读全文,人机检测
  1322. {
  1323. type: "display",
  1324. item: "#read-more-wrap",
  1325. },
  1326. {
  1327. type: "height",
  1328. item: ".article",
  1329. },
  1330. ],
  1331. },
  1332. {
  1333. name: "好网角收藏夹",
  1334. url: "wang1314.com/doc",
  1335. handles: [
  1336. //PC端:阅读全文,人机检测
  1337. {
  1338. type: "display",
  1339. item: "#show_content_bar",
  1340. },
  1341. {
  1342. type: "height",
  1343. item: "#art_body",
  1344. },
  1345. //阅读原文全部内容
  1346. {
  1347. type: "display",
  1348. item: "#show_content_bar",
  1349. },
  1350. {
  1351. type: "height",
  1352. item: "#body_content",
  1353. },
  1354. ],
  1355. },
  1356. {
  1357. name: "科中资源网",
  1358. url: "k4china.com",
  1359. handles: [
  1360. //点击阅读全文
  1361. {
  1362. type: "click",
  1363. item: ".readmore",
  1364. },
  1365. ],
  1366. },
  1367. {
  1368. name: "tofacebook",
  1369. url: "www.tofacebook.com",
  1370. handles: [
  1371. //阅读全部
  1372. {
  1373. type: "height",
  1374. item: ".panel-default",
  1375. },
  1376. {
  1377. type: "display",
  1378. item: ".more-box",
  1379. },
  1380. ],
  1381. },
  1382. ];
  1383. let time = 0;
  1384. let interval = setInterval(() => {
  1385. if (++time == 100) {
  1386. clearInterval(interval);
  1387. }
  1388. for (let website of websites) {
  1389. if (location.href.indexOf(website.url) != -1) {
  1390. if (website.fun) {
  1391. website.fun();
  1392. }
  1393. for (let handle of website.handles) {
  1394. let items = document.querySelectorAll(handle.item);
  1395. if (items.length != 0) {
  1396. if (handle.type == "display") {
  1397. //隐藏遮挡部分
  1398. for (let item of items) {
  1399. item.style.display = "none";
  1400. }
  1401. } else if (handle.type == "height") {
  1402. //加长内容部分
  1403. for (let item of items) {
  1404. item.style.setProperty("height", "unset", "important");
  1405. item.style.setProperty("min-height", "unset", "important");
  1406. item.style.setProperty("max-height", "unset", "important");
  1407. }
  1408. } else if (handle.type == "overflow") {
  1409. //防止无法滑动
  1410. for (let item of items) {
  1411. item.style.setProperty("overflow", "unset", "important");
  1412. }
  1413. } else if (handle.type == "classList") {
  1414. //删除className
  1415. for (let item of items) {
  1416. item.classList.remove(handle.remove);
  1417. }
  1418. } else if (handle.type == "click") {
  1419. //模拟一次点击
  1420. for (let item of items) {
  1421. if (item != null && item.getAttribute("opened") != "yes") {
  1422. item.click();
  1423. item.setAttribute("opened", "yes");
  1424. }
  1425. }
  1426. } else {
  1427. //模拟多次点击
  1428. for (let item of items) {
  1429. if (item) {
  1430. item.click();
  1431. }
  1432. }
  1433. }
  1434. }
  1435. }
  1436. }
  1437. }
  1438. }, 100);
  1439. })();