自动无缝翻页

无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、头条、360、微信、贴吧、豆瓣、微博、NGA、V2EX、起点小说、煎蛋网、超能网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、CS.RIN.RU、FitGirl、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、爱恋动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、小众软件、极简插件、异次元软件、异星软件空间、动漫狂、漫画猫、漫画DB、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork(以上仅一部分,更多的写不下了...

当前为 2021-09-07 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name 自动无缝翻页
  3. // @version 2.1.9
  4. // @author X.I.U
  5. // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、头条、360、微信、贴吧、豆瓣、微博、NGA、V2EX、起点小说、煎蛋网、超能网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、CS.RIN.RU、FitGirl、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、爱恋动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、小众软件、极简插件、异次元软件、异星软件空间、动漫狂、漫画猫、漫画DB、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork(以上仅一部分,更多的写不下了...
  6. // @match *://*/*
  7. // @connect www.gamersky.com
  8. // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png
  9. // @grant GM_xmlhttpRequest
  10. // @grant GM_registerMenuCommand
  11. // @grant GM_unregisterMenuCommand
  12. // @grant GM_openInTab
  13. // @grant GM_getValue
  14. // @grant GM_setValue
  15. // @grant GM_notification
  16. // @grant unsafeWindow
  17. // @noframes
  18. // @license GPL-3.0 License
  19. // @run-at document-end
  20. // @namespace https://github.com/XIU2/UserScript
  21. // @supportURL https://github.com/XIU2/UserScript
  22. // @homepageURL https://github.com/XIU2/UserScript
  23. // ==/UserScript==
  24.  
  25. (function() {
  26. 'use strict';
  27. var menuAll = [
  28. ['menu_disable', '✅ 已启用 (点击对当前网站禁用)', '❌ 已禁用 (点击对当前网站启用)', []],
  29. ['menu_discuz_thread_page', '帖子内自动翻页 (仅论坛)', '帖子内自动翻页 (仅论坛)', true],
  30. ['menu_page_number', '显示当前页码及点击暂停翻页', '显示当前页码及点击暂停翻页', true],
  31. ['menu_pause_page', '左键双击网页空白处暂停翻页', '左键双击网页空白处暂停翻页', false]
  32. ], menuId = [], webType = 0, curSite = {SiteTypeID: 0}, DBSite, SiteType, pausePage = true, pageNum = {now: 1, _now: 1}, forumWebsite = ['cs.rin.ru', 'www.flyert.com', 'bbs.pediy.com', 'www.libaclub.com'];
  33. for (let i=0;i<menuAll.length;i++){ // 如果读取到的值为 null 就写入默认值
  34. if (GM_getValue(menuAll[i][0]) == null){GM_setValue(menuAll[i][0], menuAll[i][3])};
  35. }
  36. registerMenuCommand();
  37. if (menuId.length < 2) {return}
  38. // 注册(不可用)脚本菜单
  39. function registerMenuCommand() {
  40. if (menuId.length != []){
  41. for (let i=0;i<menuId.length;i++){
  42. GM_unregisterMenuCommand(menuId[i]);
  43. }
  44. }
  45. for (let i=0;i<menuAll.length;i++) { // 循环注册(不可用)脚本菜单
  46. menuAll[i][3] = GM_getValue(menuAll[i][0]);
  47. if (menuAll[i][0] === 'menu_disable') { // 启用/禁用
  48.  
  49. if (menu_disable('check')) { // 当前网站在禁用列表中
  50. menuId[i] = GM_registerMenuCommand(`${menuAll[i][2]}`, function(){menu_disable('del')});
  51. return
  52. } else { // // 不在禁用列表中
  53. webType = doesItSupport(); // 判断网站类型(即是否支持),顺便直接赋值
  54. if (webType === 0) {
  55. GM_registerMenuCommand('❌ 当前网站暂不支持 [点击申请支持]', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://gf.qytechs.cn/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});});
  56. console.info('[自动无缝翻页] - 不支持当前网站,欢迎申请支持:https://github.com/XIU2/UserScript / https://gf.qytechs.cn/zh-CN/scripts/96880/feedback');
  57. return
  58. }
  59. menuId[i] = GM_registerMenuCommand(`${menuAll[i][1]}`, function(){menu_disable('add')});
  60. }
  61.  
  62. } else if (menuAll[i][0] === 'menu_discuz_thread_page') { // 帖子内自动翻页 (仅论坛)
  63.  
  64. if (webType === 2 || forumWebsite.indexOf(location.host) > -1) {
  65. menuId[i] = GM_registerMenuCommand(`${menuAll[i][3]?'✅':'❌'} ${menuAll[i][1]}`, function(){menu_switch(menuAll[i][3], menuAll[i][0], menuAll[i][2])});
  66. }
  67.  
  68. } else {
  69. menuId[i] = GM_registerMenuCommand(`${menuAll[i][3]?'✅':'❌'} ${menuAll[i][1]}`, function(){menu_switch(menuAll[i][3], menuAll[i][0], menuAll[i][2])});
  70. }
  71. }
  72. menuId[menuId.length] = GM_registerMenuCommand('💬 反馈 & 欢迎申请支持', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://gf.qytechs.cn/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});});
  73. }
  74.  
  75. // 网站规则
  76. function setDBSite() {
  77. /*
  78. 自动翻页规则
  79. type:
  80. 1 = 由脚本实现自动无缝翻页
  81. 2 = 网站自带了自动无缝翻页功能,只需要点击下一页按钮即可
  82. nextText: 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页)
  83. nextTextOf: 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页)
  84. nextHTML: 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页)
  85. intervals: 点击间隔时间,对于没有按钮文字变化的按钮,可以手动指定间隔时间,单位:ms
  86. 3 = 依靠元素距离可视区域底部的距离来触发翻页
  87. 4 = 部分简单的动态加载类网站(暂时)
  88. insertPosition:
  89. 1 = 插入该元素本身的前面;
  90. 2 = 插入该元素当中,第一个子元素前面;
  91. 3 = 插入该元素当中,最后一个子元素后面;
  92. 4 = 插入该元素本身的后面;
  93. mimeType: 网站编码
  94. scriptType: 单独插入 <script> 标签
  95. 1 = 下一页的所有 <script> 标签
  96. 2 = 下一页主体元素同级 <script> 标签
  97. 3 = 下一页主体元素同级 <script> 标签(远程文件)
  98. 4 = 下一页主体元素子元素 <script> 标签
  99. scrollDelta:数值越大,滚动条触发点越靠上(越早开始翻页),一般是访问网页速度越慢,该值就需要越大(如果 Type = 3,则相反)
  100. function:
  101. before = 插入前执行函数;
  102. after = 插入后执行函数;
  103. parameter = 参数
  104. */
  105. DBSite = {
  106. discuz_forum: {
  107. SiteTypeID: 0,
  108. pager: {
  109. type: 2,
  110. nextLink: '#autopbn',
  111. nextTextOf: '下一页',
  112. scrollDelta: 1500
  113. }
  114. }, // Discuz! - 各版块帖子列表(自带无缝加载下一页按钮的)
  115. discuz_guide: {
  116. SiteTypeID: 0,
  117. pager: {
  118. type: 1,
  119. nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]',
  120. pageElement: 'css;#threadlist table > tbody[id^="normalthread_"]',
  121. insertPosition: ['id("threadlist")//table/tbody[starts-with(@id, "normalthread_")]/parent::table', 3],
  122. replaceE: 'css;.pg, .pages',
  123. scrollDelta: 1000
  124. }
  125. }, // Discuz! - 导读页 及 各版块帖子列表(不带无缝加载下一页按钮的)
  126. discuz_waterfall: {
  127. SiteTypeID: 0,
  128. pager: {
  129. type: 1,
  130. nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]',
  131. pageElement: 'css;#waterfall > li',
  132. insertPosition: ['css;#waterfall', 3],
  133. replaceE: 'css;.pg, .pages',
  134. scrollDelta: 1000
  135. }
  136. }, // Discuz! - 图片模式的各版块帖子列表(不带无缝加载下一页按钮的)
  137. discuz_thread: {
  138. SiteTypeID: 0,
  139. pager: {
  140. type: 1,
  141. nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]',
  142. pageElement: 'css;#postlist > div[id^="post_"]',
  143. insertPosition: ['css;#postlist', 3],
  144. replaceE: 'css;.pg, .pages',
  145. scrollDelta: 1000
  146. },
  147. function: {
  148. before: discuz_thread_functionBefore
  149. }
  150. }, // Discuz! - 帖子内
  151. discuz_search: {
  152. SiteTypeID: 0,
  153. pager: {
  154. type: 1,
  155. nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]',
  156. pageElement: 'css;#threadlist > ul',
  157. insertPosition: ['css;#threadlist', 3],
  158. replaceE: 'css;.pg, .pages',
  159. scrollDelta: 1000
  160. }
  161. }, // Discuz! - 搜索页
  162. discuz_youspace: {
  163. SiteTypeID: 0,
  164. pager: {
  165. type: 1,
  166. nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]',
  167. pageElement: 'css;tbody > tr:not(.th)',
  168. insertPosition: ['css;tbody', 3],
  169. replaceE: 'css;.pg, .pages',
  170. scrollDelta: 1000
  171. }
  172. }, // Discuz! - 回复页、主题页(别人的)
  173. discuz_collection: {
  174. SiteTypeID: 0,
  175. pager: {
  176. type: 1,
  177. nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))] | //a[@class="next"][@href][not(contains(@href, "javascript"))]',
  178. pageElement: 'css;#ct .bm_c table > tbody',
  179. insertPosition: ['css;#ct .bm_c table', 3],
  180. replaceE: 'css;.pg, .pages',
  181. scrollDelta: 1000
  182. }
  183. }, // Discuz! - 淘帖页
  184. flarum: {
  185. SiteTypeID: 0,
  186. pager: {
  187. type: 2,
  188. nextLink: '.DiscussionList-loadMore > button[title]',
  189. scrollDelta: 1000
  190. }
  191. },
  192. dux: {
  193. SiteTypeID: 0,
  194. pager: {
  195. type: 1,
  196. nextLink: '//li[@class="next-page"]/a[@href]',
  197. pageElement: 'css;.content > article',
  198. insertPosition: ['css;.content > .pagination', 1],
  199. replaceE: 'css;.content > .pagination',
  200. scrollDelta: 1500
  201. },
  202. function: {
  203. before: dux_functionBefore
  204. }
  205. }, // 一种 WordPress 主题
  206. baidu: {
  207. SiteTypeID: 0,
  208. host: 'www.baidu.com',
  209. functionStart: function() {curSite = DBSite.baidu; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.new-pmd .c-img-border {position: initial !important;} .op-bk-polysemy-video__wrap.c-gap-bottom {display: none !important;}';},
  210. pager: {
  211. type: 1,
  212. nextLink: 'id("page")//a[contains(text(),"下一页")][@href]',
  213. pageElement: 'css;#content_left > *',
  214. insertPosition: ['css;#content_left', 3],
  215. replaceE: 'css;#page',
  216. scrollDelta: 1200
  217. }
  218. }, // 百度搜素
  219. google: {
  220. SiteTypeID: 0,
  221. host: 'www.google.com',
  222. functionStart: function() {if (location.pathname === '/search') curSite = DBSite.google;},
  223. pager: {
  224. type: 1,
  225. nextLink: 'id("pnnext")[@href]',
  226. pageElement: 'css;#res > *',
  227. insertPosition: ['css;#res', 3],
  228. replaceE: 'id("navcnt") | id("rcnt")//div[@role="navigation"]',
  229. scriptType: 1,
  230. scrollDelta: 3000
  231. }
  232. }, // 谷歌搜索
  233. bing: {
  234. SiteTypeID: 0,
  235. host: ['www.bing.com','cn.bing.com'],
  236. functionStart: function() {if (location.pathname === '/search') {curSite = DBSite.bing; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.b_imagePair.square_mp > .inner {display: none;}';}},
  237. pager: {
  238. type: 1,
  239. nextLink: '//a[contains(@class,"sb_pagN")][@href]',
  240. pageElement: 'css;#b_results > li:not(.b_msg):not(.b_pag):not(#mfa_root)',
  241. insertPosition: ['css;#b_results > .b_pag', 1],
  242. replaceE: 'css;#b_results > .b_pag',
  243. scrollDelta: 1500
  244. }
  245. }, // 必应搜索
  246. toutiao: {
  247. SiteTypeID: 0,
  248. host: ['www.toutiao.com', 'so.toutiao.com'],
  249. functionStart: function() {if (location.hostname != 'www.toutiao.com') {if (location.pathname === '/search') {curSite = DBSite.toutiao;}}},
  250. pager: {
  251. type: 1,
  252. nextLink: '//div[contains(@class, "-pagination")]/a[contains(string(), "下一页")]',
  253. pageElement: 'css;div[class*="-result-list"] > .result-content[data-i]',
  254. insertPosition: ['css;div[class*="-result-list"] > .result-content:not([data-i]):last-child', 1],
  255. replaceE: 'css;div[class*="-pagination"]',
  256. scrollDelta: 1200
  257. },
  258. function: {
  259. before: toutiao_functionBefore
  260. }
  261. }, // 头条搜索
  262. sogou: {
  263. SiteTypeID: 0,
  264. host: 'www.sogou.com',
  265. functionStart: function() {if (location.pathname != '/') {curSite = DBSite.sogou;}},
  266. pager: {
  267. type: 1,
  268. nextLink: 'css;#sogou_next',
  269. pageElement: 'css;.results > *',
  270. insertPosition: ['css;.results', 3],
  271. replaceE: 'css;#pagebar_container',
  272. scriptType: 4,
  273. scrollDelta: 1200
  274. }
  275. }, // 搜狗搜索
  276. sogou_weixin: {
  277. SiteTypeID: 0,
  278. host: 'weixin.sogou.com',
  279. functionStart: function() {if (location.pathname === '/') {
  280. curSite = DBSite.sogou_weixin;
  281. } else if (location.pathname === '/weixin') {
  282. curSite = DBSite.sogou_weixin_search;
  283. }},
  284. pager: {
  285. type: 2,
  286. nextLink: '#look-more',
  287. intervals: 1000,
  288. scrollDelta: 1000
  289. }
  290. }, // 搜狗微信 - 首页
  291. sogou_weixin_search: {
  292. SiteTypeID: 0,
  293. pager: {
  294. type: 1,
  295. nextLink: 'css;#sogou_next',
  296. pageElement: 'css;.news-box > ul[class*="news-list"] > li',
  297. insertPosition: ['css;.news-box > ul[class*="news-list"]', 3],
  298. replaceE: 'css;#pagebar_container',
  299. scrollDelta: 1000
  300. }
  301. }, //搜狗微信 - 搜索
  302. so: {
  303. SiteTypeID: 0,
  304. host: 'www.so.com',
  305. functionStart: function() {if (location.pathname != '/') {curSite = DBSite.so;}},
  306. pager: {
  307. type: 1,
  308. nextLink: 'css;#snext[href]',
  309. pageElement: 'css;ul.result > li, style:not(src)',
  310. insertPosition: ['css;ul.result', 3],
  311. replaceE: 'css;#page',
  312. scrollDelta: 1200
  313. },
  314. function: {
  315. before: so_functionBefore
  316. }
  317. }, // 360 搜索
  318. magi: {
  319. SiteTypeID: 0,
  320. host: 'magi.com',
  321. functionStart: function() {if (location.pathname === '/search') {curSite = DBSite.magi;}},
  322. pager: {
  323. type: 2,
  324. nextLink: '.card[data-type="next"]',
  325. nextText: '加载更多',
  326. scrollDelta: 1500
  327. }
  328. }, // Magi搜索
  329. baidu_tieba: {
  330. SiteTypeID: 0,
  331. host: 'tieba.baidu.com',
  332. functionStart: function() {if (location.pathname === '/f') {
  333. baidu_tieba_1(); // 右侧悬浮发帖按钮点击事件(解决自动翻页导致无法发帖的问题)
  334. curSite = DBSite.baidu_tieba; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'img.j_retract {margin-top: 0 !important;margin-bottom: 0 !important;}'; // 修复帖子列表中预览图片,在切换下一个/上一个图片时,多出来的图片上下边距
  335. //} else if (location.pathname.indexOf('/p/') > -1) {
  336. //curSite = DBSite.baidu_tieba_post;
  337. } else if (location.pathname === '/f/search/res') {
  338. curSite = DBSite.baidu_tieba_search;
  339. }},
  340. pager: {
  341. type: 4,
  342. nextLink: baidu_tieba_functionNext,
  343. pageElement: 'css;#thread_list > li',
  344. insertPosition: ['css;#thread_list', 3],
  345. insertElement: baidu_tieba_insertElement,
  346. replaceE: 'css;#frs_list_pager',
  347. intervals: 3000,
  348. scrollDelta: 2000
  349. },
  350. function: {
  351. before: baidu_tieba_functionBefore
  352. }
  353. }, // 百度贴吧 - 帖子列表
  354. baidu_tieba_post: {
  355. SiteTypeID: 0,
  356. pager: {
  357. type: 1,
  358. nextLink: '//li[contains(@class,"pb_list_pager")]/a[contains(text(),"下一页")][@href]',
  359. pageElement: 'css;#j_p_postlist > div',
  360. insertPosition: ['css;#j_p_postlist', 3],
  361. replaceE: 'css;li.pb_list_pager',
  362. scrollDelta: 1000
  363. }
  364. }, // 百度贴吧 - 帖子内
  365. baidu_tieba_search: {
  366. SiteTypeID: 0,
  367. pager: {
  368. type: 1,
  369. nextLink: '//a[@class="next"][@href]',
  370. pageElement: 'css;#j_p_postlist > *',
  371. insertPosition: ['css;#j_p_postlist', 3],
  372. replaceE: 'css;.pager.pager-search',
  373. scriptType: 1,
  374. scrollDelta: 1000
  375. }
  376. }, // 百度贴吧 - 搜索页
  377. douban_subject_comments: {
  378. SiteTypeID: 0,
  379. host: 'movie.douban.com',
  380. functionStart: function() {if (location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/comments') > -1) { // 短评列表
  381. curSite = DBSite.douban_subject_comments;
  382. } else if (location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/reviews') > -1) { // 影评列表
  383. curSite = DBSite.douban_subject_reviews;
  384. } else if(location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/episode') > -1) { // 电视剧每集评论
  385. curSite = DBSite.douban_subject_episode;
  386. }},
  387. pager: {
  388. type: 1,
  389. nextLink: '//a[@class="next"][@href]',
  390. pageElement: 'css;#comments > .comment-item',
  391. insertPosition: ['css;#paginator', 1],
  392. replaceE: 'css;#paginator',
  393. scrollDelta: 1000
  394. }
  395. }, // 豆瓣 - 短评
  396. douban_subject_reviews: {
  397. SiteTypeID: 0,
  398. pager: {
  399. type: 1,
  400. nextLink: '//link[@rel="next"][@href]',
  401. pageElement: 'css;.review-list > div',
  402. insertPosition: ['css;.review-list', 3],
  403. replaceE: 'css;.paginator',
  404. scrollDelta: 1000
  405. }
  406. }, // 豆瓣 - 影评
  407. douban_subject_episode: {
  408. SiteTypeID: 0,
  409. pager: {
  410. type: 1,
  411. nextLink: '//link[@rel="next"][@href]',
  412. pageElement: 'css;#comments > div',
  413. insertPosition: ['css;#comments', 3],
  414. replaceE: 'css;.paginator',
  415. scrollDelta: 1000
  416. }
  417. }, // 豆瓣 - 剧评
  418. douban_group: {
  419. SiteTypeID: 0,
  420. host: 'www.douban.com',
  421. functionStart: function() {if (location.pathname.indexOf('/group/topic/') > -1) {
  422. curSite = DBSite.douban_group_topic;
  423. } else if (location.pathname.indexOf('/group/explore') > -1) {
  424. curSite = DBSite.douban_group_explore;
  425. } else if (location.pathname.indexOf('/group/') > -1 && location.pathname.indexOf('/discussion') > -1) {
  426. curSite = DBSite.douban_group;
  427. }},
  428. pager: {
  429. type: 1,
  430. nextLink: 'css;span.next > a',
  431. pageElement: 'css;table.olt > tbody > tr:not(.th)',
  432. insertPosition: ['css;table.olt > tbody', 3],
  433. replaceE: 'css;.paginator',
  434. scrollDelta: 1000
  435. }
  436. }, // 豆瓣 - 小组
  437. douban_group_explore: {
  438. SiteTypeID: 0,
  439. pager: {
  440. type: 1,
  441. nextLink: 'css;span.next > a',
  442. pageElement: 'css;#content .article > div > .channel-item',
  443. insertPosition: ['css;#content .article > div', 3],
  444. replaceE: 'css;.paginator',
  445. scrollDelta: 1000
  446. }
  447. }, // 豆瓣 - 小组讨论精选
  448. douban_group_topic: {
  449. SiteTypeID: 0,
  450. pager: {
  451. type: 1,
  452. nextLink: 'css;span.next > a',
  453. pageElement: 'css;#comments > li',
  454. insertPosition: ['css;#comments', 3],
  455. replaceE: 'css;.paginator',
  456. scrollDelta: 1000
  457. }
  458. }, // 豆瓣 - 小组帖子内
  459. weibo_comment: {
  460. SiteTypeID: 0,
  461. host: 'weibo.com',
  462. pager: {
  463. type: 2,
  464. nextLink: 'a[action-type="click_more_comment"]',
  465. nextText: '查看更多c',
  466. scrollDelta: 1000
  467. }
  468. }, // 微博评论
  469. nga_thread: {
  470. SiteTypeID: 0,
  471. host: 'bbs.nga.cn',
  472. functionStart: function() {if (location.pathname === '/thread.php') { // 帖子列表
  473. curSite = DBSite.nga_thread;
  474. } else if (location.pathname === '/read.php') { // 帖子内
  475. curSite = DBSite.nga_read;
  476. }},
  477. pager: {
  478. type: 1,
  479. nextLink: 'css;#pagebbtm a[title="下一页"][href]',
  480. pageElement: 'css;#topicrows > tbody, #topicrows > script',
  481. insertPosition: ['css;#topicrows', 3],
  482. replaceE: 'css;div[name="pageball"]',
  483. scriptType: 2,
  484. scrollDelta: 1000
  485. },
  486. function: {
  487. after: nga_thread_functionAfter
  488. }
  489. }, // NGA - 各版块帖子列表
  490. nga_read: {
  491. SiteTypeID: 0,
  492. pager: {
  493. type: 1,
  494. nextLink: 'css;#pagebbtm a[title="下一页"][href]',
  495. pageElement: 'id("m_posts_c")/table | id("m_posts_c")/script | //script[contains(text(), "commonui.userInfo.setAll")]',
  496. insertPosition: ['css;#m_posts_c', 3],
  497. replaceE: 'css;div[name="pageball"]',
  498. scriptType: 2,
  499. scrollDelta: 1000
  500. }
  501. }, // NGA - 帖子内
  502. v2ex_recent: {
  503. SiteTypeID: 0,
  504. host: ['v2ex.com', 'www.v2ex.com'],
  505. functionStart: function() {if (location.pathname === '/') { // 首页
  506. v2ex_functionAfter('#Main a.topic-link:not([target])');
  507. } else if (location.pathname === '/recent') { // 最近主题页
  508. curSite = DBSite.v2ex_recent;
  509. v2ex_functionAfter('#Main a.topic-link:not([target])');
  510. } else if (location.pathname === '/notifications') { // 提醒消息页
  511. curSite = DBSite.v2ex_notifications;
  512. v2ex_functionAfter('#Main a[href^="/t/"]:not([target])');
  513. } else if (location.pathname === '/balance') { // 账户余额页
  514. curSite = DBSite.v2ex_balance;
  515. } else if (location.pathname.indexOf('/go/') > -1) { // 分类主题页
  516. curSite = DBSite.v2ex_go;
  517. v2ex_functionAfter('#Main a.topic-link:not([target])');
  518. } else if (location.pathname.indexOf('/replies') > -1) { // 用户回复页
  519. curSite = DBSite.v2ex_replies;
  520. v2ex_functionAfter('#Main a[href^="/t/"]:not([target])');
  521. }},
  522. pager: {
  523. type: 1,
  524. nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]',
  525. pageElement: 'css;.cell.item',
  526. insertPosition: ['//div[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1],
  527. replaceE: 'css;#Main > .box > .cell[style]:not(.item) > table',
  528. scrollDelta: 1500
  529. },
  530. function: {
  531. after: v2ex_functionAfter,
  532. parameter: '#Main a.topic-link:not([target])'
  533. }
  534. }, // V2EX - 最近主题页
  535. v2ex_notifications: {
  536. SiteTypeID: 0,
  537. pager: {
  538. type: 1,
  539. nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]',
  540. pageElement: 'css;#notifications > div',
  541. insertPosition: ['css;#notifications', 3],
  542. replaceE: 'css;#Main > .box > .cell[style] > table',
  543. scrollDelta: 1500
  544. },
  545. function: {
  546. after: v2ex_functionAfter,
  547. parameter: '#Main a[href^="/t/"]:not([target])'
  548. }
  549. }, // V2EX - 提醒消息页
  550. v2ex_replies: {
  551. SiteTypeID: 0,
  552. pager: {
  553. type: 1,
  554. nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]',
  555. pageElement: '//div[@id="Main"]//div[@class="box"]//div[@class="dock_area"] | //*[@id="Main"]//div[@class="box"]//div[@class="inner"] | //*[@id="Main"]//div[@class="box"]//div[@class="dock_area"][last()]/following-sibling::div[@class="cell"][1]',
  556. insertPosition: ['//div[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1],
  557. replaceE: 'css;#Main > .box > .cell[style] > table',
  558. scrollDelta: 1500
  559. },
  560. function: {
  561. after: v2ex_functionAfter,
  562. parameter: '#Main a[href^="/t/"]:not([target])'
  563. }
  564. }, // V2EX - 用户回复页
  565. v2ex_go: {
  566. SiteTypeID: 0,
  567. pager: {
  568. type: 1,
  569. nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]',
  570. pageElement: 'css;#TopicsNode > div',
  571. insertPosition: ['css;#TopicsNode', 3],
  572. replaceE: 'css;#Main > .box > .cell[style] > table',
  573. scrollDelta: 1500
  574. },
  575. function: {
  576. after: v2ex_functionAfter,
  577. parameter: '#Main a.topic-link:not([target])'
  578. }
  579. }, // V2EX - 分类主题页
  580. v2ex_balance: {
  581. SiteTypeID: 0,
  582. pager: {
  583. type: 1,
  584. nextLink: '//a[@class="page_current"]/following-sibling::a[1][@href]',
  585. pageElement: 'css;#Main .box > div:not(.cell) > table > tbody > tr:not(:first-child)',
  586. insertPosition: ['css;#Main .box > div:not(.cell) > table > tbody', 3],
  587. replaceE: 'css;#Main > .box > .cell[style] > table',
  588. scrollDelta: 1000
  589. }
  590. }, // V2EX - 账户余额页
  591. pediy_forum: {
  592. SiteTypeID: 0,
  593. host: 'bbs.pediy.com',
  594. functionStart: function() {if (location.pathname.indexOf('/forum-') > -1) {
  595. curSite = DBSite.pediy_forum;
  596. } else if (location.pathname.indexOf('/thread-') > -1) {
  597. if (GM_getValue('menu_discuz_thread_page')) {curSite = DBSite.pediy_thread;}
  598. }},
  599. pager: {
  600. type: 1,
  601. nextLink: '//ul[contains(@class, "pagination")]//a[contains(text(), "▶")]',
  602. pageElement: 'css;table.threadlist > tbody > tr',
  603. insertPosition: ['css;table.threadlist > tbody', 3],
  604. replaceE: 'css;ul.pagination',
  605. scrollDelta: 1500
  606. }
  607. }, // 看雪论坛 - 各版块帖子列表
  608. pediy_thread: {
  609. SiteTypeID: 0,
  610. pager: {
  611. type: 1,
  612. nextLink: '//ul[contains(@class, "pagination")]//a[contains(text(), "▶")]',
  613. pageElement: 'css;table.postlist > tbody > tr[data-pid]',
  614. insertPosition: ['css;table.postlist > tbody > tr:not([data-pid])', 1],
  615. replaceE: 'css;ul.pagination',
  616. scrollDelta: 1500
  617. }
  618. }, // 看雪论坛 - 帖子内
  619. lkong: {
  620. SiteTypeID: 0,
  621. host: 'www.lkong.com',
  622. functionStart: function() {if (location.pathname.indexOf('/forum/') > -1) {
  623. curSite = DBSite.lkong;
  624. } else if (location.pathname.indexOf('/thread/') > -1) {
  625. curSite = DBSite.lkong_thread;
  626. }},
  627. pager: {
  628. type: 1,
  629. nextLink: lkong_functionNext,
  630. pageElement: '//div[@class="main-title"]/parent::div/parent::div | //head/style[@data-emotion-css]',
  631. insertPosition: ['//div[@class="main-title"][1]/parent::div/parent::div/parent::div', 3],
  632. replaceE: 'css;ul.ant-pagination',
  633. intervals: 500,
  634. scrollDelta: 1200
  635. }
  636. }, // 龙的天空 - 各版块帖子列表
  637. lkong_thread: {
  638. SiteTypeID: 0,
  639. pager: {
  640. type: 1,
  641. nextLink: lkong_functionNext,
  642. pageElement: '//div[@class="main-content"]/parent::div | //head/style[@data-emotion-css]',
  643. insertPosition: ['//div[@class="main-content"][1]/parent::div/parent::div', 3],
  644. replaceE: 'css;ul.ant-pagination',
  645. intervals: 500,
  646. scrollDelta: 1200
  647. }
  648. }, // 龙的天空 - 帖子内
  649. xcar_forumdisplay: {
  650. SiteTypeID: 0,
  651. host: 'www.xcar.com.cn',
  652. functionStart: function() {if (location.pathname === '/bbs/forumdisplay.php') {curSite = DBSite.xcar_forumdisplay}},
  653. pager: {
  654. type: 1,
  655. nextLink: 'css;a.page_down',
  656. pageElement: 'css;.table-section > dl:not(.table_head)',
  657. insertPosition: ['css;.table-section', 3],
  658. replaceE: 'css;.forumList_page',
  659. scrollDelta: 2000
  660. }
  661. }, // 爱卡汽车网论坛 - 各版块帖子列表
  662. flyert_forumdisplay: {
  663. SiteTypeID: 0,
  664. host: 'www.flyert.com',
  665. functionStart: function() {if (location.search.indexOf('mod=forumdisplay') > -1) {
  666. curSite = DBSite.flyert_forumdisplay;
  667. } else if (location.search.indexOf('mod=viewthread') > -1) {
  668. if (GM_getValue('menu_discuz_thread_page')) {curSite = DBSite.flyert_viewthread;}
  669. }},
  670. pager: {
  671. type: 1,
  672. nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))]',
  673. pageElement: 'css;#threadlist table > tbody[id^="normalthread_"]',
  674. insertPosition: ['id("threadlist")//table/tbody[starts-with(@id, "normalthread_")]/parent::table', 3],
  675. replaceE: 'css;.pg',
  676. scrollDelta: 2500
  677. }
  678. }, // 飞客网论坛 - 各版块帖子列表
  679. flyert_viewthread: {
  680. SiteTypeID: 0,
  681. pager: {
  682. type: 1,
  683. nextLink: '//a[@class="nxt"][@href][not(contains(@href, "javascript"))]',
  684. pageElement: 'css;#postlist > .comiis_viewbox',
  685. insertPosition: ['css;#postlist', 3],
  686. replaceE: 'css;.comiis_pgs > .pg',
  687. scrollDelta: 3000
  688. }
  689. }, // 飞客网论坛 - 帖子内
  690. zhutix: {
  691. SiteTypeID: 0,
  692. host: 'zhutix.com',
  693. functionStart: function() {if (document.getElementById('primary-home')) {
  694. curSite = DBSite.zhutix_postlist;
  695. } else {
  696. curSite = DBSite.zhutix;
  697. }},
  698. pager: {
  699. type: 1,
  700. nextLink: '//li[@class="next-page"]/a | //div[@class="btn-pager"]/a[contains(text(), "❯")]',
  701. pageElement: 'css;#post-list > ul > li',
  702. insertPosition: ['css;#post-list > ul', 3],
  703. replaceE: 'css;.pagination, .b2-pagenav.post-nav',
  704. scrollDelta: 1500
  705. }
  706. }, // 致美化
  707. zhutix_postlist: {
  708. SiteTypeID: 0,
  709. pager: {
  710. type: 1,
  711. nextLink: '//li[@class="next-page"]/a',
  712. pageElement: 'css;#primary-home > div:not(.pagination)',
  713. insertPosition: ['css;.pagination', 1],
  714. replaceE: 'css;.pagination',
  715. scrollDelta: 1500
  716. }
  717. }, // 致美化 - 文章列表
  718. jandan: {
  719. SiteTypeID: 0,
  720. host: 'jandan.net',
  721. functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/page/') > -1) {
  722. curSite = DBSite.jandan;
  723. } else if (location.pathname === '/dzh') {
  724. curSite = DBSite.jandan_dzh;
  725. } else {
  726. curSite = DBSite.jandan_comment;
  727. }},
  728. pager: {
  729. type: 1,
  730. nextLink: '//div[@class="wp-pagenavi"]/a[contains(text(), "下一页") or contains(text(), "更多文章")]',
  731. pageElement: 'css;#content > .list-post',
  732. insertPosition: ['css;.wp-pagenavi', 1],
  733. replaceE: 'css;.wp-pagenavi, #nav_prev',
  734. scrollDelta: 1500
  735. },
  736. function: {
  737. before: src_original_functionBefore
  738. }
  739. }, // 煎蛋网
  740. jandan_comment: {
  741. SiteTypeID: 0,
  742. pager: {
  743. type: 1,
  744. nextLink: 'css;a.previous-comment-page',
  745. pageElement: 'css;ol.commentlist > li[id^="comment-"], script[src^="//cdn.jandan.net/static/min/"]',
  746. insertPosition: ['css;ol.commentlist', 3],
  747. replaceE: 'css;.cp-pagenavi, #nav_prev',
  748. scriptType: 3,
  749. scrollDelta: 1500
  750. }
  751. }, // 煎蛋网
  752. jandan_dzh: {
  753. SiteTypeID: 0,
  754. pager: {
  755. type: 2,
  756. nextLink: '.show_more',
  757. intervals: 1500,
  758. scrollDelta: 1500
  759. }
  760. }, // 煎蛋网 - 大杂烩
  761. expreview: {
  762. SiteTypeID: 0,
  763. host: 'www.expreview.com',
  764. pager: {
  765. type: 2,
  766. nextLink: '#show_article_red_1SHOW',
  767. intervals: 1500,
  768. scrollDelta: 1500
  769. }
  770. }, // 超能网
  771. landian: {
  772. SiteTypeID: 0,
  773. host: 'www.landian.vip',
  774. pager: {
  775. type: 2,
  776. nextLink: '.load-more > button',
  777. nextText: '加载更多',
  778. scrollDelta: 1300
  779. }
  780. }, // 蓝点网
  781. ithome: {
  782. SiteTypeID: 0,
  783. host: 'www.ithome.com',
  784. pager: {
  785. type: 2,
  786. nextLink: 'a.more',
  787. intervals: 1500,
  788. scrollDelta: 1500
  789. }
  790. }, // IT 之家
  791. puxiang: {
  792. SiteTypeID: 0,
  793. host: 'www.puxiang.com',
  794. functionStart: function() {if (location.pathname === '/search/favorite') {
  795. curSite = DBSite.puxiang_collect;
  796. } else if (location.pathname === '/search/puxiang' || location.pathname === '/list' || location.pathname === '/galleries' || location.pathname === '/articles') {
  797. curSite = DBSite.puxiang;
  798. } else if (location.pathname === '/') {
  799. curSite = DBSite.puxiang; curSite.pager.scrollDelta = 4000;
  800. }},
  801. pager: {
  802. type: 1,
  803. nextLink: 'css;li.next > a[href]',
  804. pageElement: 'css;.work-list > div',
  805. insertPosition: ['css;.work-list', 3],
  806. replaceE: 'css;.pagerbar',
  807. scrollDelta: 1500
  808. }
  809. }, // 普象网 - 作品集/搜索页
  810. puxiang_collect: {
  811. SiteTypeID: 0,
  812. pager: {
  813. type: 1,
  814. nextLink: 'css;li.next > a[href]',
  815. pageElement: 'css;.collect-list > div',
  816. insertPosition: ['css;.collect-list', 3],
  817. replaceE: 'css;.pagerbar',
  818. scrollDelta: 1500
  819. }
  820. }, // 普象网 - 收藏夹
  821. _58pic: {
  822. SiteTypeID: 0,
  823. host: 'www.58pic.com',
  824. functionStart: function() {if (location.pathname.indexOf('/tupian/') > -1) {
  825. curSite = DBSite._58pic; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.qtw-card.place-box.is-two {display: none !important;}'; // 隐藏末尾很大的 [下一页] 按钮
  826. } else if (location.pathname.indexOf('/c/') > -1) {
  827. curSite = DBSite._58pic_c;
  828. }},
  829. pager: {
  830. type: 1,
  831. nextLink: '//div[contains(@class,"page-box")]//a[text()="下一页"][@href]',
  832. pageElement: 'css;.pic-box > .qtw-card',
  833. insertPosition: ['css;.pic-box', 3],
  834. replaceE: 'css;.page-box',
  835. scrollDelta: 2000
  836. },
  837. function: {
  838. before: _58pic_functionBefore
  839. }
  840. }, // 千图网 - 分类/搜索页
  841. _58pic_c: {
  842. SiteTypeID: 0,
  843. pager: {
  844. type: 1,
  845. nextLink: '//div[contains(@class,"page-box")]//a[text()="下一页"][@href]',
  846. pageElement: 'css;.list-box > .qtw-card',
  847. insertPosition: ['css;.list-box', 3],
  848. replaceE: 'css;.page-box',
  849. scrollDelta: 4000
  850. },
  851. function: {
  852. before: _58pic_functionBefore
  853. }
  854. }, // 千图网 - 专题/收藏夹
  855. pixabay: {
  856. SiteTypeID: 0,
  857. host: 'pixabay.com',
  858. pager: {
  859. type: 1,
  860. nextLink: '//a[text()="Next page"][@href]',
  861. pageElement: 'css;[class^="results"] > [class^="container"] > div',
  862. insertPosition: ['css;[class^="results"] > [class^="container"]', 3],
  863. replaceE: '//a[text()="Next page"][@href]',
  864. scrollDelta: 2000
  865. },
  866. function: {
  867. before: pixabay_functionBefore
  868. }
  869. },
  870. _3dmgame: {
  871. SiteTypeID: 0,
  872. host: 'www.3dmgame.com',
  873. pager: {
  874. type: 3,
  875. nextLink: '//li[@class="next"]/a[@href]',
  876. pageElement: 'css;.news_warp_center > *',
  877. insertPosition: ['css;.news_warp_center', 3],
  878. replaceE: 'css;.pagewrap',
  879. scrollElement: '.pagewrap',
  880. scrollDelta: 400
  881. }
  882. },
  883. ali213_www: {
  884. SiteTypeID: 0,
  885. host: 'www.ali213.net',
  886. pager: {
  887. type: 3,
  888. nextLink: 'id("after_this_page")[@href]',
  889. pageElement: 'css;#Content >*:not(.news_ding):not(.page_fenye)',
  890. insertPosition: ['css;.page_fenye', 1],
  891. replaceE: 'css;.page_fenye',
  892. scrollElement: '.page_fenye',
  893. scrollDelta: 400
  894. }
  895. }, // 游侠网
  896. ali213_gl: {
  897. SiteTypeID: 0,
  898. host: 'gl.ali213.net',
  899. functionStart: function() {curSite = DBSite.ali213_gl; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.n_show_b {display: none !important;}';},
  900. pager: {
  901. type: 3,
  902. nextLink: '//a[@class="next n"][@href]',
  903. pageElement: 'css;.c-detail >*',
  904. insertPosition: ['css;.c-detail', 3],
  905. replaceE: 'css;.page_fenye',
  906. scrollElement: '.page_fenye',
  907. scrollDelta: 400
  908. }
  909. }, // 游侠网 - 攻略
  910. ali213_pic: {
  911. SiteTypeID: 0,
  912. host: 'pic.ali213.net',
  913. functionStart: function() {curSite = DBSite.ali213_pic; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'a.prev, a.next {display: none !important;}';},
  914. pager: {
  915. type: 1,
  916. nextLink: 'css;a.next[href]',
  917. pageElement: 'css;#image-show > img',
  918. insertPosition: ['css;#image-show', 3],
  919. replaceE: 'css;#image-show > a',
  920. scrollDelta: 1200
  921. }
  922. }, // 游侠网 - 图库
  923. gamersky_ent: {
  924. SiteTypeID: 0,
  925. host: 'www.gamersky.com',
  926. functionStart: function() {if (location.pathname.indexOf('/ent/') > -1) {curSite = DBSite.gamersky_ent;} else {curSite = DBSite.gamersky_gl;}},
  927. pager: {
  928. type: 3,
  929. nextLink: '//div[@class="page_css"]/a[text()="下一页"][@href]',
  930. pageElement: 'css;.Mid2L_con > *:not(.gs_nc_editor):not(.pagecss):not(.page_css):not(.gs_ccs_solve):not(.post_ding)',
  931. insertPosition: ['css;.page_css', 1],
  932. replaceE: 'css;.page_css',
  933. scrollElement: '.page_css',
  934. scrollDelta: 100
  935. }
  936. }, // 游民星空
  937. gamersky_gl: {
  938. SiteTypeID: 0,
  939. pager: {
  940. type: 3,
  941. nextLink: '//div[@class="page_css"]/a[text()="下一页"][@href]',
  942. pageElement: 'css;.Mid2L_con > *:not(.gs_nc_editor):not(.pagecss):not(.gs_ccs_solve):not(.post_ding)',
  943. insertPosition: ['css;.gs_nc_editor', 1],
  944. replaceE: 'css;.page_css',
  945. scrollElement: '.pagecss',
  946. scrollDelta: -1000
  947. },
  948. function: {
  949. before: gamersky_gl_functionBefore
  950. }
  951. }, // 游民星空 - 攻略
  952. nexusmods: {
  953. SiteTypeID: 0,
  954. host: 'www.nexusmods.com',
  955. pager: {
  956. type: 4,
  957. nextLink: nexusmods_functionNext,
  958. pageElement: 'css;#mod-list > ul.tiles > li',
  959. insertPosition: ['css;#mod-list > ul.tiles', 3],
  960. insertElement: nexusmods_insertElement,
  961. replaceE: 'css;#mod-list .pagination',
  962. scrollDelta: 3000
  963. }
  964. }, // NexusMods
  965. steamcommunity: {
  966. SiteTypeID: 0,
  967. host: 'steamcommunity.com',
  968. pager: {
  969. type: 1,
  970. nextLink: '//a[@class="pagebtn"][last()][@href]',
  971. pageElement: 'css;.workshopBrowseItems > *',
  972. insertPosition: ['css;.workshopBrowseItems', 3],
  973. replaceE: 'css;.workshopBrowsePaging',
  974. scriptType: 2,
  975. scrollDelta: 1500
  976. }
  977. }, // 创意工坊 - 项目列表
  978. yikm: {
  979. SiteTypeID: 0,
  980. host: 'www.yikm.net',
  981. pager: {
  982. type: 1,
  983. nextLink: '//ul[@class="pager"]//a[text()="下一页"]',
  984. pageElement: '//h2[contains(text(), "所有游戏") or contains(text(), "搜索结果")]/following-sibling::div[1]/div',
  985. insertPosition: ['//h2[contains(text(), "所有游戏") or contains(text(), "搜索结果")]/following-sibling::div[1]', 3],
  986. replaceE: 'css;ul.pager',
  987. scrollDelta: 1500
  988. }
  989. }, // 小霸王其乐无穷
  990. cs_rin_ru: {
  991. SiteTypeID: 0,
  992. host: 'cs.rin.ru',
  993. functionStart: function() {if (location.pathname === '/forum/viewforum.php') { // 版块帖子列表
  994. curSite = DBSite.cs_rin_ru;
  995. } else if (location.pathname === '/forum/viewtopic.php') { // 帖子内
  996. if (GM_getValue('menu_discuz_thread_page')) curSite = DBSite.cs_rin_ru_viewtopic;
  997. } else if (location.pathname === '/forum/search.php') { // 搜索结果
  998. curSite = DBSite.cs_rin_ru_search;
  999. }},
  1000. pager: {
  1001. type: 1,
  1002. nextLink: '//td[@class="gensmall"][@align="right"]//a[text()="Next"][@href]',
  1003. pageElement: 'css;#pagecontent > table.tablebg > tbody > tr:not([align])',
  1004. insertPosition: ['css;#pagecontent > table.tablebg > tbody > tr[align]', 1],
  1005. replaceE: 'css;#pagecontent > table:first-child',
  1006. scrollDelta: 1500
  1007. },
  1008. function: {
  1009. before: cs_rin_ru_functionBefore
  1010. }
  1011. }, // 各版块帖子列表
  1012. cs_rin_ru_viewtopic: {
  1013. SiteTypeID: 0,
  1014. pager: {
  1015. type: 1,
  1016. nextLink: 'id("pageheader")/p[@class="gensmall"]//a[text()="Next"][@href]',
  1017. pageElement: 'css;#pagecontent > table.tablebg:not(:nth-last-child(2)):not(:nth-child(2))',
  1018. insertPosition: ['css;#pagecontent > table.tablebg:nth-last-child(2)', 1],
  1019. replaceE: 'css;#pagecontent >table:not(.tablebg), #pageheader p.gensmall',
  1020. scrollDelta: 1500
  1021. }
  1022. }, // 帖子内
  1023. cs_rin_ru_search: {
  1024. SiteTypeID: 0,
  1025. pager: {
  1026. type: 1,
  1027. nextLink: 'id("wrapcentre")/div[@class="nav"]//a[text()="Next"]',
  1028. pageElement: 'css;#wrapcentre > form > table.tablebg > tbody > tr[valign]',
  1029. insertPosition: ['css;#wrapcentre > form > table.tablebg > tbody > tr:last-child', 1],
  1030. replaceE: 'css;#wrapcentre > div',
  1031. scrollDelta: 1500
  1032. }
  1033. }, // 搜索页
  1034. crackhub: {
  1035. SiteTypeID: 0,
  1036. host: 'crackhub.site',
  1037. functionStart: function() {curSite = DBSite.crackhub; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'html.wp-dark-mode-active .inside-article {background-color: var(--wp-dark-mode-bg);}';},
  1038. pager: {
  1039. type: 1,
  1040. nextLink: '//a[@class="next page-numbers"][@href]',
  1041. pageElement: 'css;article[id^="post-"]',
  1042. insertPosition: ['css;nav.paging-navigation', 1],
  1043. replaceE: 'css;nav.paging-navigation',
  1044. scrollDelta: 2000
  1045. }
  1046. },
  1047. fitgirl: {
  1048. SiteTypeID: 0,
  1049. host: 'fitgirl-repacks.site',
  1050. pager: {
  1051. type: 1,
  1052. nextLink: '//a[@class="next page-numbers"][@href]',
  1053. pageElement: 'css;article[id^="post-"]',
  1054. insertPosition: ['css;nav.paging-navigation', 1],
  1055. replaceE: 'css;nav.paging-navigation',
  1056. scrollDelta: 2000
  1057. }
  1058. },
  1059. cupfox: {
  1060. SiteTypeID: 0,
  1061. host: 'www.cupfox.com',
  1062. pager: {
  1063. type: 2,
  1064. nextLink: '.load-more',
  1065. nextText: '点击加载更多',
  1066. scrollDelta: 700
  1067. }
  1068. }, // 茶杯狐
  1069. novipnoad: {
  1070. SiteTypeID: 0,
  1071. host: 'www.novipnoad.com',
  1072. functionStart: function() {if (location.pathname != '/' && location.pathname.indexOf('.html') === -1) {curSite = DBSite.novipnoad;}},
  1073. pager: {
  1074. type: 1,
  1075. nextLink: 'css;a.nextpostslink',
  1076. pageElement: 'css;.video-listing-content .row > div',
  1077. insertPosition: ['css;.video-listing-content .row', 3],
  1078. replaceE: 'css;.wp-pagenavi',
  1079. scrollDelta: 1500
  1080. },
  1081. function: {
  1082. before: src_original_functionBefore
  1083. }
  1084. }, // NO视频
  1085. nfmovies: {
  1086. SiteTypeID: 0,
  1087. host: 'www.nfmovies.com',
  1088. functionStart: function() {if (location.pathname === '/search.php' || location.pathname.indexOf('/list/') > -1) {curSite = DBSite.nfmovies;}},
  1089. pager: {
  1090. type: 1,
  1091. nextLink: '//ul[contains(@class, "myui-page")]/li/a[contains(text(), "下一页")]',
  1092. pageElement: 'css;ul.myui-vodlist > li',
  1093. insertPosition: ['css;ul.myui-vodlist', 3],
  1094. replaceE: 'css;ul.myui-page',
  1095. scrollDelta: 1500
  1096. },
  1097. function: {
  1098. before: nfmovies_functionBefore
  1099. }
  1100. }, // 奈菲影视
  1101. ddrk: {
  1102. SiteTypeID: 0,
  1103. host: 'ddrk.me',
  1104. functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/category/') > -1 || location.pathname.indexOf('/tag/') > -1) {curSite = DBSite.ddrk;}},
  1105. pager: {
  1106. type: 1,
  1107. nextLink: 'css;a.next',
  1108. pageElement: 'css;.post-box-list > article',
  1109. insertPosition: ['css;.post-box-list', 3],
  1110. replaceE: 'css;.pagination_wrap',
  1111. scrollDelta: 1500
  1112. }
  1113. }, // 低端影视
  1114. zhenbuka: {
  1115. SiteTypeID: 0,
  1116. host: ['www.zhenbuka3.com', 'www.zhenbuka5.com'],
  1117. functionStart: function() {if (location.pathname.indexOf('/vodtype/') > -1) {curSite = DBSite.zhenbuka;}},
  1118. pager: {
  1119. type: 1,
  1120. nextLink: '//ul[contains(@class, "stui-page")]/li/a[contains(text(), "下一页")]',
  1121. pageElement: 'css;ul.stui-vodlist > li',
  1122. insertPosition: ['css;ul.stui-vodlist', 3],
  1123. replaceE: 'css;ul.stui-page',
  1124. scrollDelta: 1500
  1125. },
  1126. function: {
  1127. before: nfmovies_functionBefore
  1128. }
  1129. }, // 真不卡影院
  1130. _91mjw: {
  1131. SiteTypeID: 0,
  1132. host: '91mjw.com',
  1133. functionStart: function() {if (location.pathname.indexOf('/video/') === -1 || location.pathname.indexOf('/vplay/') === -1) {curSite = DBSite._91mjw;}},
  1134. pager: {
  1135. type: 1,
  1136. nextLink: 'css;.next-page > a',
  1137. pageElement: 'css;.m-movies > article',
  1138. insertPosition: ['css;.pagination', 1],
  1139. replaceE: 'css;.pagination',
  1140. scrollDelta: 1500
  1141. },
  1142. function: {
  1143. before: src_original_functionBefore
  1144. }
  1145. }, // 91 美剧网
  1146. mypianku: {
  1147. SiteTypeID: 0,
  1148. host: 'www.mypianku.net',
  1149. pager: {
  1150. type: 1,
  1151. nextLink: 'css;a.a1[href]',
  1152. pageElement: 'css;.content-list > li',
  1153. insertPosition: ['css;.content-list', 3],
  1154. replaceE: 'css;.pages',
  1155. scrollDelta: 1500
  1156. },
  1157. function: {
  1158. before: mypianku_functionBefore
  1159. }
  1160. }, // 片库
  1161. yinfans: {
  1162. SiteTypeID: 0,
  1163. host: 'www.yinfans.net',
  1164. pager: {
  1165. type: 1,
  1166. nextLink: 'css;a.next[href]',
  1167. pageElement: 'css;#post_container > li',
  1168. insertPosition: ['css;#post_container', 3],
  1169. replaceE: 'css;.pagination',
  1170. scrollDelta: 1500
  1171. }
  1172. }, // 音范丝
  1173. btbtt: {
  1174. SiteTypeID: 0,
  1175. host: 'btbtt',
  1176. pager: {
  1177. type: 1,
  1178. nextLink: '//div[@class="page"]/a[contains(text(), "▶") or contains(text(), "下一页")]',
  1179. pageElement: 'css;#threadlist > table, #threadlist > hr',
  1180. insertPosition: ['css;#threadlist', 3],
  1181. replaceE: 'css;.page',
  1182. scrollDelta: 2000
  1183. }
  1184. }, // BT 之家
  1185. gaoqing_fm: {
  1186. SiteTypeID: 0,
  1187. host: 'gaoqing.fm',
  1188. pager: {
  1189. type: 2,
  1190. nextLink: '.col-md-12 > a[href], #loadmore > a[href]',
  1191. intervals: 1500,
  1192. scrollDelta: 1000
  1193. }
  1194. }, // 高清电台
  1195. kisssub: {
  1196. SiteTypeID: 0,
  1197. host: 'www.kisssub.org',
  1198. pager: {
  1199. type: 1,
  1200. nextLink: 'css;a.nextprev',
  1201. pageElement: 'css;#data_list > tr',
  1202. insertPosition: ['css;#data_list', 3],
  1203. replaceE: 'css;.pages',
  1204. scrollDelta: 2500
  1205. }
  1206. }, // 爱恋动漫
  1207. nyaa: {
  1208. SiteTypeID: 0,
  1209. host: 'nyaa.si',
  1210. pager: {
  1211. type: 1,
  1212. nextLink: '//a[@rel="next"][@href] | //li[@class="next"]/a[@href]',
  1213. pageElement: 'css;table.torrent-list > tbody > tr',
  1214. insertPosition: ['css;table.torrent-list > tbody', 3],
  1215. replaceE: 'css;ul.pagination',
  1216. scrollDelta: 2000
  1217. }
  1218. }, // Nyaa
  1219. skrbtba: {
  1220. SiteTypeID: 0,
  1221. host: 'skrbtca.xyz',
  1222. functionStart: function() {if (location.pathname === '/search') curSite = DBSite.skrbtba;},
  1223. pager: {
  1224. type: 1,
  1225. nextLink: '//a[@aria-label="Next"]',
  1226. pageElement: 'css;div[class="row"] > .col-md-6 > ul',
  1227. insertPosition: ['css;nav[aria-label*="Page"]', 1],
  1228. replaceE: 'css;ul.pagination',
  1229. scrollDelta: 900
  1230. }
  1231. }, // SkrBT
  1232. rarbgprx: {
  1233. SiteTypeID: 0,
  1234. host: 'rarbgprx.org',
  1235. pager: {
  1236. type: 1,
  1237. nextLink: '(//a[@title="next page"])[1][@href]',
  1238. pageElement: 'css;table.lista2t tr.lista2',
  1239. insertPosition: ['css;table.lista2t > tbody', 3],
  1240. replaceE: 'css;#pager_links',
  1241. scrollDelta: 1000
  1242. }
  1243. }, // RARBG
  1244. subdh: {
  1245. SiteTypeID: 0,
  1246. host: 'subdh.com',
  1247. functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/list/new') > -1) {
  1248. curSite = DBSite.subdh;
  1249. } else if (location.pathname.indexOf('/search') > -1) {
  1250. curSite = DBSite.subdh_search;
  1251. }},
  1252. pager: {
  1253. type: 1,
  1254. nextLink: '//a[@class="page-link"][contains(text(), "下一页")]',
  1255. pageElement: 'css;.col-lg-9 .bg-white.shadow-sm.rounded-3 > .row.gx-0',
  1256. insertPosition: ['css;.col-lg-9 .bg-white.shadow-sm.rounded-3', 3],
  1257. replaceE: 'css;ul.pagination',
  1258. scrollDelta: 1000
  1259. }
  1260. }, // SubDH
  1261. subdh_search: {
  1262. SiteTypeID: 0,
  1263. pager: {
  1264. type: 1,
  1265. nextLink: '//a[@class="page-link"][contains(text(), "下一页")]',
  1266. pageElement: 'css;.col-lg-9 .bg-white.shadow-sm.rounded-3',
  1267. insertPosition: ['css;nav[aria-label="pagination"]', 1],
  1268. replaceE: 'css;ul.pagination',
  1269. scrollDelta: 1000
  1270. }
  1271. }, //SubDH - 搜索页
  1272. subhd: {
  1273. SiteTypeID: 0,
  1274. host: 'subhd.tv',
  1275. functionStart: function() {if (location.pathname === '/forum/forum') {
  1276. curSite = DBSite.subhd_forum;
  1277. } else if (location.pathname != '/' && location.pathname != '/zu' && location.pathname.indexOf('/a/') === -1 && location.pathname.indexOf('/d/') === -1 && location.pathname.indexOf('/forum/') === -1) {
  1278. curSite = DBSite.subhd;
  1279. }},
  1280. pager: {
  1281. type: 1,
  1282. nextLink: '//a[@class="page-link"][contains(text(), "下一页")]',
  1283. pageElement: 'css;.bg-white.shadow-sm.rounded-3',
  1284. insertPosition: ['css;nav.clearfix', 1],
  1285. replaceE: 'css;nav.clearfix',
  1286. scrollDelta: 1000
  1287. }
  1288. }, // SubHD
  1289. subhd_forum: {
  1290. SiteTypeID: 0,
  1291. pager: {
  1292. type: 1,
  1293. nextLink: '//a[@class="page-link"][contains(text(), "下一页")]',
  1294. pageElement: 'css;.bg-white.shadow-sm.rounded-3 > div',
  1295. insertPosition: ['css;.bg-white.shadow-sm.rounded-3', 3],
  1296. replaceE: 'css;nav.clearfix',
  1297. scrollDelta: 800
  1298. }
  1299. }, // SubHD - forum
  1300. baoshuu: {
  1301. SiteTypeID: 0,
  1302. host: 'www.baoshuu.com',
  1303. functionStart: function() {if (location.pathname.indexOf('/TXT/list') > -1) curSite = DBSite.baoshuu;},
  1304. pager: {
  1305. type: 1,
  1306. nextLink: '//div[@class="listl2"]//a[@href][text()="下一页"]',
  1307. pageElement: 'css;.listl2 > ul > li',
  1308. insertPosition: ['css;.listl2 > ul', 3],
  1309. replaceE: 'css;listl2 > dl',
  1310. mimeType: 'text/html; charset=gb2312',
  1311. scrollDelta: 900
  1312. }
  1313. }, // 宝书网(小说)
  1314. baoshuu_m: {
  1315. SiteTypeID: 0,
  1316. host: 'm.baoshuu.com',
  1317. functionStart: function() {if (location.pathname.indexOf('/TXT/list') > -1) curSite = DBSite.baoshuu_m;},
  1318. pager: {
  1319. type: 1,
  1320. nextLink: '//div[@class="man_first"]//a[@href][text()="下一页"]',
  1321. pageElement: 'css;.man_first > ul > li',
  1322. insertPosition: ['css;.man_first > ul', 3],
  1323. replaceE: 'css;.man_first > dl',
  1324. mimeType: 'text/html; charset=gb2312',
  1325. scrollDelta: 900
  1326. }
  1327. }, // 宝书网(小说)- 手机版
  1328. qidian: {
  1329. SiteTypeID: 0,
  1330. host: 'www.qidian.com',
  1331. functionStart: function() {if (location.pathname.indexOf('/all/') > -1) {curSite = DBSite.qidian;}},
  1332. pager: {
  1333. type: 1,
  1334. nextLink: 'css;a[class*="pagination-next"][href]',
  1335. pageElement: 'css;ul.all-img-list > li',
  1336. insertPosition: ['css;ul.all-img-list', 3],
  1337. replaceE: 'css;#page-container',
  1338. scrollDelta: 900
  1339. }
  1340. }, // 起点小说
  1341. qidian_read: {
  1342. SiteTypeID: 0,
  1343. host: 'read.qidian.com',
  1344. functionStart: function() {if (location.pathname.indexOf('/chapter/') > -1) {curSite = DBSite.qidian_read; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.admire-wrap {display: none !important;}';}},
  1345. pager: {
  1346. type: 1,
  1347. nextLink: 'css;a[id$="chapterNext"][href]',
  1348. pageElement: 'css;.main-text-wrap > div:not(.admire-wrap)',
  1349. insertPosition: ['css;.main-text-wrap', 3],
  1350. replaceE: 'css;.chapter-control, title',
  1351. history: true,
  1352. scrollDelta: 900
  1353. }
  1354. }, // 起点小说 - 阅读页
  1355. _423down: {
  1356. SiteTypeID: 0,
  1357. host: 'www.423down.com',
  1358. functionStart: function() {if (location.pathname.indexOf('.html') === -1) curSite = DBSite._423down;},
  1359. pager: {
  1360. type: 1,
  1361. nextLink: '//div[@class="paging"]//a[contains(text(),"下一页")][@href]',
  1362. pageElement: 'css;div.content-wrap ul.excerpt > li',
  1363. insertPosition: ['css;div.content-wrap ul.excerpt', 3],
  1364. replaceE: 'css;div.paging',
  1365. scrollDelta: 1500
  1366. }
  1367. },
  1368. iao_su: {
  1369. SiteTypeID: 0,
  1370. host: 'iao.su',
  1371. pager: {
  1372. type: 1,
  1373. nextLink: '//li[@class="btn btn-primary next"]//a[@href]',
  1374. pageElement: 'css;#index > article, #archive > article',
  1375. insertPosition: ['css;ol.page-navigator', 1],
  1376. replaceE: 'css;ol.page-navigator',
  1377. scrollDelta: 1000
  1378. },
  1379. function: {
  1380. before: iao_su_functionBefore
  1381. }
  1382. }, // 不死鸟
  1383. appinn: {
  1384. SiteTypeID: 0,
  1385. host: 'www.appinn.com',
  1386. pager: {
  1387. type: 1,
  1388. nextLink: '//a[@class="next page-numbers"][@href]',
  1389. pageElement: 'css;section#latest-posts > article',
  1390. insertPosition: ['css;nav.navigation.pagination', 1],
  1391. replaceE: 'css;div.nav-links',
  1392. scrollDelta: 1500
  1393. }
  1394. }, // 小众软件
  1395. chrome_zzzmh: {
  1396. SiteTypeID: 0,
  1397. host: 'chrome.zzzmh.cn',
  1398. pager: {
  1399. type: 2,
  1400. nextLink: 'button.more-btn',
  1401. intervals: 1000,
  1402. scrollDelta: 1500
  1403. }
  1404. }, // 极简插件
  1405. isharepc: {
  1406. SiteTypeID: 0,
  1407. host: 'www.isharepc.com',
  1408. pager: {
  1409. type: 1,
  1410. nextLink: 'css;a.next[href]',
  1411. pageElement: 'css;.content > div',
  1412. insertPosition: ['css;nav.pagination', 1],
  1413. replaceE: 'css;nav.pagination',
  1414. scrollDelta: 1000
  1415. }
  1416. }, // 乐软博客
  1417. pc521: {
  1418. SiteTypeID: 0,
  1419. host: 'www.pc521.net',
  1420. functionStart: function() {if (location.search.slice(0,3) === '?s=') {curSite = DBSite.pc521_search;} else {curSite = DBSite.pc521;}},
  1421. pager: {
  1422. type: 2,
  1423. nextLink: 'div[id^="ias_trigger_"]',
  1424. intervals: 1000,
  1425. scrollDelta: 1000
  1426. }
  1427. }, // 不忘初心
  1428. pc521_search: {
  1429. SiteTypeID: 0,
  1430. pager: {
  1431. type: 1,
  1432. nextLink: 'css;a.next[href]',
  1433. pageElement: 'css;#main > ul > li',
  1434. insertPosition: ['css;#main > ul', 3],
  1435. replaceE: 'css;nav.pagination',
  1436. scrollDelta: 1500
  1437. }
  1438. }, // 不忘初心 - 搜索页
  1439. ghxi: {
  1440. SiteTypeID: 0,
  1441. host: 'www.ghxi.com',
  1442. functionStart: function() {if (location.pathname === '/' && !location.search) {curSite = DBSite.ghxi;} else {curSite = DBSite.ghxi_postlist;}},
  1443. pager: {
  1444. type: 2,
  1445. nextLink: '.load-more',
  1446. intervals: 1000,
  1447. scrollDelta: 5000
  1448. }
  1449. }, // 果核剥壳 - 首页
  1450. ghxi_postlist: {
  1451. SiteTypeID: 0,
  1452. pager: {
  1453. type: 1,
  1454. nextLink: 'css;a.next[href]',
  1455. pageElement: 'css;ul.post-loop > li',
  1456. insertPosition: ['css;ul.post-loop', 3],
  1457. replaceE: 'css;ul.pagination',
  1458. scrollDelta: 1500
  1459. },
  1460. function: {
  1461. before: src_original_functionBefore
  1462. }
  1463. }, // 果核剥壳 - 分类/搜索页
  1464. sixyin: {
  1465. SiteTypeID: 0,
  1466. host: 'www.sixyin.com',
  1467. functionStart: function() {if (location.pathname === '/' && location.search === '') { // 首页
  1468. curSite = DBSite.sixyin;
  1469. } else if (location.pathname.indexOf('.html') === -1) { // 分类页
  1470. curSite = DBSite.sixyin_postlist;
  1471. }},
  1472. pager: {
  1473. type: 2,
  1474. nextLink: '.load-more',
  1475. nextHTML: '点击查看更多',
  1476. scrollDelta: 1500
  1477. }
  1478. }, // 六音软件 - 首页
  1479. sixyin_postlist: {
  1480. SiteTypeID: 0,
  1481. pager: {
  1482. type: 1,
  1483. nextLink: '//a[@class="next"][@href]',
  1484. pageElement: 'css;ul.post-loop > li',
  1485. insertPosition: ['css;ul.post-loop', 3],
  1486. replaceE: 'css;ul.pagination',
  1487. scrollDelta: 1500
  1488. }
  1489. }, // 六音软件 - 分类页
  1490. weidown: {
  1491. SiteTypeID: 0,
  1492. host: 'www.weidown.com',
  1493. functionStart: function() {if (location.pathname.indexOf('/search/') > -1) { //搜索页
  1494. curSite = DBSite.weidown_search;
  1495. } else if (location.pathname.indexOf('/special/') > -1) { // 专题页
  1496. curSite = DBSite.weidown_special;
  1497. } else {
  1498. curSite = DBSite.weidown;
  1499. }},
  1500. pager: {
  1501. type: 1,
  1502. nextLink: '//a[@class="nextpage"][@href]',
  1503. pageElement: 'css;.articleWrapper > .itemArticle, .articleWrapper > .richTextItem.search',
  1504. insertPosition: ['css;.articleWrapper', 3],
  1505. replaceE: 'css;#pageGroup',
  1506. scrollDelta: 1500
  1507. }
  1508. }, // 微当下载
  1509. weidown_search: {
  1510. SiteTypeID: 0,
  1511. pager: {
  1512. type: 1,
  1513. nextLink: '//a[@class="nextpage"][@href]',
  1514. pageElement: 'css;.articleListWrapper > .richTextItem.search',
  1515. insertPosition: ['css;#pageGroup', 1],
  1516. replaceE: 'css;#pageGroup',
  1517. scrollDelta: 700
  1518. }
  1519. }, // 微当下载 - 搜索页
  1520. weidown_special: {
  1521. SiteTypeID: 0,
  1522. pager: {
  1523. type: 1,
  1524. nextLink: '//a[@class="nextpage"][@href]',
  1525. pageElement: 'css;.special > .item',
  1526. insertPosition: ['css;.special', 3],
  1527. replaceE: 'css;#pageGroup',
  1528. scrollDelta: 700
  1529. }
  1530. }, // 微当下载 - 专题页
  1531. th_sjy: {
  1532. SiteTypeID: 0,
  1533. host: 'www.th-sjy.com',
  1534. pager: {
  1535. type: 1,
  1536. nextLink: 'css;li.next-page > a',
  1537. pageElement: 'css;.content > article',
  1538. insertPosition: ['css;.pagination', 1],
  1539. replaceE: 'css;.pagination',
  1540. scrollDelta: 2000
  1541. }
  1542. }, // th-sjy 汉化
  1543. iplaysoft_postslist: {
  1544. SiteTypeID: 0,
  1545. host: 'www.iplaysoft.com',
  1546. functionStart: function() {if (location.pathname.indexOf('.html') > -1 || location.pathname.indexOf('/p/') > -1) { // 文章内
  1547. curSite = DBSite.iplaysoft_postcomments;
  1548. } else { // 其他页面
  1549. curSite = DBSite.iplaysoft_postslist;
  1550. }},
  1551. pager: {
  1552. type: 1,
  1553. nextLink: '//div[@class="pagenavi"]//a[@title="下一页"][@href]',
  1554. pageElement: 'css;#postlist > div.entry',
  1555. insertPosition: ['css;#postlist > .pagenavi-button', 1],
  1556. replaceE: 'css;.pagenavi-button, .pagenavi',
  1557. scrollDelta: 1200
  1558. },
  1559. function: {
  1560. before: iplaysoft_postslist_functionBefore
  1561. }
  1562. }, // 异次元软件世界
  1563. iplaysoft_postcomments: {
  1564. SiteTypeID: 0,
  1565. pager: {
  1566. type: 2,
  1567. nextLink: '#loadHistoryComments',
  1568. nextTextOf: '展开后面',
  1569. scrollDelta: 1200
  1570. }
  1571. }, // 异次元软件世界 - 评论
  1572. mpyit: {
  1573. SiteTypeID: 0,
  1574. host: 'www.mpyit.com',
  1575. functionStart: function() {if (location.pathname === '/' && !location.search) {
  1576. curSite = DBSite.mpyit;
  1577. } else if (location.pathname.indexOf('/category/') > -1 || location.search.indexOf('?s=') > -1) { // 搜索页 / 分类页
  1578. curSite = DBSite.mpyit_category;
  1579. }},
  1580. pager: {
  1581. type: 1,
  1582. nextLink: '//a[@class="page-numbers"][@title="下一页"][@href]',
  1583. pageElement: 'css;#post > div[id^="post-"]',
  1584. insertPosition: ['css;#post > #pagenavi', 1],
  1585. replaceE: 'css;#post > #pagenavi',
  1586. scrollDelta: 1700
  1587. }
  1588. }, // 老殁 | 殁漂遥
  1589. mpyit_category: {
  1590. SiteTypeID: 0,
  1591. pager: {
  1592. type: 1,
  1593. nextLink: '//a[@class="page-numbers"][@title="下一页"][@href]',
  1594. pageElement: 'css;#content > div[class^="entry_box"]',
  1595. insertPosition: ['css;#content > #pagenavi', 1],
  1596. replaceE: 'css;#content > #pagenavi',
  1597. scrollDelta: 1700
  1598. }
  1599. }, // 老殁 | 殁漂遥 - 搜索页/分类页
  1600. yxssp: {
  1601. SiteTypeID: 0,
  1602. host: 'www.yxssp.com',
  1603. pager: {
  1604. type: 1,
  1605. nextLink: '//div[@class="page-nav td-pb-padding-side"]/a[last()][@href]',
  1606. pageElement: 'css;.td-modules-container.td-module-number4 > div',
  1607. insertPosition: ['css;.td-modules-container.td-module-number4', 3],
  1608. replaceE: 'css;.page-nav.td-pb-padding-side',
  1609. scrollDelta: 1000
  1610. }
  1611. }, // 异星软件空间
  1612. sordum: {
  1613. SiteTypeID: 0,
  1614. host: 'www.sordum.org',
  1615. pager: {
  1616. type: 1,
  1617. nextLink: '//a[@class="next page-numbers"][@href]',
  1618. pageElement: 'css;.article > article',
  1619. insertPosition: ['css;nav.navigation.posts-navigation', 1],
  1620. replaceE: 'css;nav.navigation.posts-navigation',
  1621. scrollDelta: 1500
  1622. }
  1623. },
  1624. winaero: {
  1625. SiteTypeID: 0,
  1626. host: 'winaero.com',
  1627. functionStart: function() {if (location.pathname === '/blog/' || location.pathname.indexOf('/category/') > -1) curSite = DBSite.winaero;},
  1628. pager: {
  1629. type: 1,
  1630. nextLink: 'css;.nav-previous > a',
  1631. pageElement: 'css;#content > article',
  1632. insertPosition: ['css;#nav-below', 1],
  1633. replaceE: 'css;#nav-below',
  1634. scrollDelta: 1500
  1635. }
  1636. },
  1637. lrepacks: {
  1638. SiteTypeID: 0,
  1639. host: 'lrepacks.net',
  1640. functionStart: function() {if (location.pathname.indexOf('.html') === -1) curSite = DBSite.lrepacks;},
  1641. pager: {
  1642. type: 1,
  1643. nextLink: 'css;.page_next > a',
  1644. pageElement: 'css;#main .post-list article',
  1645. insertPosition: ['css;.page_nav', 1],
  1646. replaceE: 'css;.page_nav',
  1647. scrollDelta: 1500
  1648. },
  1649. function: {
  1650. before: lrepacks_functionBefore
  1651. }
  1652. },
  1653. winhelponline: {
  1654. SiteTypeID: 0,
  1655. host: 'www.winhelponline.com',
  1656. functionStart: function() {if (location.pathname === '/blog/') {curSite = DBSite.winhelponline;}},
  1657. pager: {
  1658. type: 1,
  1659. nextLink: 'css;span.prev > a[href]',
  1660. pageElement: 'css;#main > article',
  1661. insertPosition: ['css;nav.paging-navigation', 1],
  1662. replaceE: 'css;nav.paging-navigation',
  1663. scrollDelta: 2000
  1664. }
  1665. },
  1666. windowslatest: {
  1667. SiteTypeID: 0,
  1668. host: 'www.windowslatest.com',
  1669. pager: {
  1670. type: 1,
  1671. nextLink: '//div[contains(@class, "page-nav")]/a/i[@class="td-icon-menu-right"]/parent::a',
  1672. pageElement: 'css;.td-ss-main-content > div:not(.td-block-title-wrap):not(.page-nav)',
  1673. insertPosition: ['css;.page-nav', 1],
  1674. replaceE: 'css;.page-nav',
  1675. scrollDelta: 2000
  1676. }
  1677. },
  1678. thewindowsclub: {
  1679. SiteTypeID: 0,
  1680. host: 'www.thewindowsclub.com',
  1681. functionStart: function() {curSite = DBSite.thewindowsclub; if (location.pathname === '/') {curSite.pager.scrollDelta = 2000;}},
  1682. pager: {
  1683. type: 1,
  1684. nextLink: 'css;li.pagination-next > a',
  1685. pageElement: 'css;#genesis-content > article',
  1686. insertPosition: ['css;.pagination', 1],
  1687. replaceE: 'css;.pagination',
  1688. scrollDelta: 1500
  1689. }
  1690. },
  1691. cartoonmad: {
  1692. SiteTypeID: 0,
  1693. host: ['www.cartoonmad.com','www.cartoonmad.cc'],
  1694. functionStart: function() {if (location.pathname.indexOf('/comic/') > -1) {
  1695. document.lastElementChild.appendChild(document.createElement('style')).textContent = 'body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:not(:first-child) {display: none !important;} body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child img {max-width: 100%;height: auto;display: block !important;margin: 0 auto !important;}';
  1696. document.querySelector('body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child > a').href = 'javascript:void(0);'; // 清理图片上的链接
  1697. curSite = DBSite.cartoonmad;
  1698. }},
  1699. pager: {
  1700. type: 1,
  1701. nextLink: cartoonmad_functionNext,
  1702. pageElement: 'css;body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child img',
  1703. insertPosition: ['css;body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child > a', 3],
  1704. replaceE: 'css;body > table > tbody > tr:nth-child(2), body > table > tbody > tr:nth-child(5)',
  1705. mimeType: 'text/html; charset=big5',
  1706. scrollDelta: 2000
  1707. }
  1708. }, // 动漫狂
  1709. manhuacat: {
  1710. SiteTypeID: 0,
  1711. host: 'www.manhuacat.com',
  1712. functionStart: function() {if (location.pathname.split('/').length === 4) {
  1713. if (getCookie('is_pull') == 'true') { // 强制关闭 [下拉] 模式
  1714. document.cookie='is_pull=false; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 关闭 [下拉] 模式
  1715. location.reload(); // 刷新网页
  1716. }
  1717. setTimeout(manhuacat_init, 100);
  1718. curSite = DBSite.manhuacat; document.lastElementChild.appendChild(document.createElement('style')).textContent = '#left, #right, #pull-load, .loading, .pagination, footer {display: none !important;} .img-content > img {display: block !important;margin: 0 auto !important; border: none !important; padding: 0 !important; max-width: 99% !important; height: auto !important;}'; // 隐藏不需要的元素,调整图片
  1719. }},
  1720. pager: {
  1721. type: 4,
  1722. nextLink: manhuacat_functionNext,
  1723. insertPosition: ['css;.img-content', 3],
  1724. insertElement: manhuacat_insertElement,
  1725. replaceE: 'css;.comic-detail > .breadcrumb-bar, .comic-detail >h2.h4, title, .vg-r-data, body > script:not([src])',
  1726. intervals: 2000,
  1727. scrollDelta: 3000
  1728. }
  1729. }, // 漫画猫
  1730. manhuadb: {
  1731. SiteTypeID: 0,
  1732. host: 'www.manhuadb.com',
  1733. functionStart: function() {if (location.pathname.indexOf('/manhua/') > -1 && location.pathname.indexOf('.html') > -1) {
  1734. document.lastElementChild.appendChild(document.createElement('style')).textContent = '.row.m-0.pt-3.ad_2_wrap, .row.m-0.ad_1_wrap, .pagination.justify-content-center, #left, #right {display: none !important;}';
  1735. document.querySelector('img.img-fluid.show-pic').style.display = 'none'; // 隐藏第一个图片(避免重复)
  1736. setTimeout(manhuadb_init, 100);
  1737. curSite = DBSite.manhuadb;
  1738. }},
  1739. pager: {
  1740. type: 4,
  1741. nextLink: manhuadb_functionNext,
  1742. pageElement: 'css;body > script:not([type]):not([src]), .vg-r-data, ol.links-of-books.num_div',
  1743. insertPosition: ['css;.pjax-container', 3],
  1744. insertElement: manhuadb_insertElement,
  1745. intervals: 5000,
  1746. scrollDelta: 3000
  1747. }
  1748. }, // 漫画 DB
  1749. hicomic: {
  1750. SiteTypeID: 0,
  1751. host: 'www.hicomic.net',
  1752. functionStart: function() {if (location.pathname.indexOf('/chapters/') > -1) {
  1753. document.lastElementChild.appendChild(document.createElement('style')).textContent = '.content {height: auto !important;} .footer, .left_cursor, .right_cursor, .finish {display: none !important;} .content > img {display: block !important;margin: 0 auto !important;}';
  1754. setTimeout(hicomic_init, 100);
  1755. curSite = DBSite.hicomic;
  1756. }},
  1757. pager: {
  1758. type: 4,
  1759. nextLink: hicomic_functionNext,
  1760. insertPosition: ['css;.content', 3],
  1761. insertElement: hicomic_insertElement,
  1762. intervals: 5000,
  1763. scrollDelta: 3000
  1764. }
  1765. }, // 嗨漫画
  1766. dmzj: {
  1767. SiteTypeID: 0,
  1768. host: 'www.dmzj.com',
  1769. functionStart: function() {if (location.pathname.indexOf('/view/') > -1) {
  1770. if (getCookie('display_mode') != '1') { // 强制开启 [上下滚动阅读] 模式
  1771. document.cookie='display_mode=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 开启 [上下滚动阅读] 模式
  1772. location.reload(); // 刷新网页
  1773. }
  1774. setTimeout(dmzj_init, 100);
  1775. curSite = DBSite.dmzj; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'p.mh_curr_page, .btmBtnBox, .float_code, #floatCode {display: none !important;} .comic_wraCon > img {display: block !important;margin: 0 auto !important; border: none !important; padding: 0 !important; max-width: 99% !important; height: auto !important;}'; // 隐藏中间的页数信息
  1776. }},
  1777. pager: {
  1778. type: 4,
  1779. nextLink: dmzj_functionNext,
  1780. insertPosition: ['css;.comic_wraCon', 3],
  1781. insertElement: dmzj_insertElement,
  1782. replaceE: 'css;.wrap_last_mid, .wrap_last_head, title',
  1783. intervals: 2000,
  1784. scrollDelta: 3000
  1785. }
  1786. }, // 动漫之家 - 原创
  1787. dmzj_manhua: {
  1788. SiteTypeID: 0,
  1789. host: 'manhua.dmzj.com',
  1790. functionStart: function() {if (location.pathname.indexOf('.shtml') > -1) {
  1791. let chapterScroll = document.getElementById('qiehuan_txt') // 强制为 [上下滚动阅读] 模式
  1792. if (chapterScroll && chapterScroll.textContent === '切换到上下滚动阅读') {chapterScroll.click();}
  1793. setTimeout(dmzj_manhua_init, 100);
  1794. curSite = DBSite.dmzj_manhua; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'p.curr_page, .btmBtnBox, .float_code, #floatCode {display: none !important;} #center_box > img {display: block !important;margin: 0 auto !important; border: none !important; padding: 0 !important; max-width: 99% !important; height: auto !important;}'; // 隐藏中间的页数信息
  1795. }},
  1796. pager: {
  1797. type: 4,
  1798. nextLink: dmzj_manhua_functionNext,
  1799. insertPosition: ['css;#center_box', 3],
  1800. insertElement: dmzj_manhua_insertElement,
  1801. replaceE: 'css;.display_graybg, title',
  1802. intervals: 2000,
  1803. scrollDelta: 3000
  1804. }
  1805. }, // 动漫之家 - 日漫
  1806. copymanga: {
  1807. SiteTypeID: 0,
  1808. host: 'www.copymanga.com',
  1809. functionStart: function() {if (location.pathname.indexOf('/chapter/') > -1) {
  1810. curSite = DBSite.copymanga; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.upMember, .comicContainerAds, .footer {display: none !important;}';
  1811. }},
  1812. pager: {
  1813. type: 4,
  1814. nextLink: copymanga_functionNext,
  1815. insertPosition: ['css;ul.comicContent-image-list > li:first-child', 1],
  1816. insertElement: copymanga_insertElement,
  1817. replaceE: 'css;.disposableData, .disposablePass, .disposableUrlPrefix, .disposableUrlSuffix, .footer, h4.header, title',
  1818. intervals: 5000,
  1819. scrollDelta: 3000
  1820. }
  1821. }, // 拷贝漫画
  1822. gufengmh8: {
  1823. SiteTypeID: 0,
  1824. host: 'www.gufengmh8.com',
  1825. functionStart: function() {if (location.pathname.indexOf('.html') > -1) {
  1826. let chapterScroll = document.getElementById('chapter-scroll') // 强制为 [下拉阅读] 模式
  1827. if (chapterScroll && chapterScroll.className === '') {chapterScroll.click();}
  1828. curSite = DBSite.gufengmh8; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'p.img_info {display: none !important;}'; // 隐藏中间的页数信息
  1829. }},
  1830. pager: {
  1831. type: 4,
  1832. nextLink: gufengmh8_functionNext,
  1833. pageElement: 'css;body > script:first-child',
  1834. insertPosition: ['css;#images', 3],
  1835. insertElement: gufengmh8_insertElement,
  1836. intervals: 5000,
  1837. scrollDelta: 4000
  1838. }
  1839. }, // 古风漫画网
  1840. szcdmj: {
  1841. SiteTypeID: 0,
  1842. host: 'www.szcdmj.com',
  1843. functionStart: function() {if (location.pathname.indexOf('/szcchapter/') > -1) {curSite = DBSite.szcdmj; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.header {opacity: 0.3 !important;}';}},
  1844. pager: {
  1845. type: 1,
  1846. nextLink: '//div[@class="fanye"][1]/a[@href][text()="下一页" or text()="下一话"]',
  1847. pageElement: 'css;.comicpage > div,title',
  1848. insertPosition: ['css;.comicpage', 3],
  1849. replaceE: 'css;.fanye,h1.title',
  1850. scrollDelta: 2000
  1851. },
  1852. function: {
  1853. before: szcdmj_functionBefore
  1854. }
  1855. }, // 砂之船动漫家
  1856. netbian: {
  1857. SiteTypeID: 0,
  1858. host: 'pic.netbian.com',
  1859. functionStart: function() {curSite = DBSite.netbian; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'li.nextpage {display: none !important;}';},
  1860. pager: {
  1861. type: 1,
  1862. nextLink: '//div[@class="page"]/a[contains(text(),"下一页")]',
  1863. pageElement: 'css;.slist ul > li:not(.nextpage)',
  1864. insertPosition: ['css;.slist ul', 3],
  1865. replaceE: 'css;.page',
  1866. mimeType: 'text/html; charset=gbk',
  1867. scrollDelta: 1000
  1868. }
  1869. }, // 彼岸图网
  1870. github_star: {
  1871. SiteTypeID: 0,
  1872. host: 'github.com',
  1873. functionStart: function() {
  1874. if (location.search.indexOf('tab=stars') > -1) {
  1875. curSite = DBSite.github_star;
  1876. } else if (location.pathname.indexOf('/issues') > -1 && location.pathname.indexOf('/issues/') === -1) {
  1877. curSite = DBSite.github_issues;
  1878. } else if (location.pathname === '/search') {
  1879. if (!location.search) return
  1880. if (location.search.indexOf('type=Repositories') > -1 || location.search.indexOf('type=') === -1) {
  1881. curSite = DBSite.github_search;
  1882. } else if (location.search.indexOf('type=code') > -1) {
  1883. curSite = DBSite.github_search_code;
  1884. } else if (location.search.indexOf('type=commits') > -1) {
  1885. curSite = DBSite.github_search_commit;
  1886. } else if (location.search.indexOf('type=issues') > -1 || location.search.indexOf('type=discussions') > -1) {
  1887. curSite = DBSite.github_search_issue;
  1888. } else if (location.search.indexOf('type=registrypackages') > -1) {
  1889. curSite = DBSite.github_search_package;
  1890. } else if (location.search.indexOf('type=marketplace') > -1) {
  1891. curSite = DBSite.github_search_marketplace;
  1892. } else if (location.search.indexOf('type=topics') > -1) {
  1893. curSite = DBSite.github_search_topics;
  1894. } else if (location.search.indexOf('type=wikis') > -1) {
  1895. curSite = DBSite.github_search_wiki;
  1896. } else if (location.search.indexOf('type=users') > -1) {
  1897. curSite = DBSite.github_search_user;
  1898. }
  1899. }},
  1900. pager: {
  1901. type: 1,
  1902. nextLink: '//div[@class="paginate-container"]//a[@href][contains(text(), "Next")]',
  1903. pageElement: 'css;#js-pjax-container .position-relative .col-lg-12 > div:not(.position-relative):not(.paginate-container)',
  1904. insertPosition: ['css;.paginate-container', 1],
  1905. replaceE: 'css;.paginate-container',
  1906. scrollDelta: 2000
  1907. }
  1908. }, // Github - 用户 Star 列表
  1909. github_issues: {
  1910. SiteTypeID: 0,
  1911. pager: {
  1912. type: 1,
  1913. nextLink: 'css;a.next_page',
  1914. pageElement: 'css;.js-navigation-container.js-active-navigation-container > div[id^="issue_"]',
  1915. insertPosition: ['css;.js-navigation-container.js-active-navigation-container', 3],
  1916. replaceE: 'css;.pagination',
  1917. scrollDelta: 1500
  1918. }
  1919. }, // Github - Issues 列表
  1920. github_search: {
  1921. SiteTypeID: 0,
  1922. pager: {
  1923. type: 1,
  1924. nextLink: 'css;a.next_page',
  1925. pageElement: 'css;ul.repo-list > li',
  1926. insertPosition: ['css;ul.repo-list', 3],
  1927. replaceE: 'css;.pagination',
  1928. scrollDelta: 1500
  1929. }
  1930. }, // Github - Search 列表
  1931. github_search_code: {
  1932. SiteTypeID: 0,
  1933. pager: {
  1934. type: 1,
  1935. nextLink: 'css;a.next_page',
  1936. pageElement: 'css;.code-list > div',
  1937. insertPosition: ['css;.code-list', 3],
  1938. replaceE: 'css;.pagination',
  1939. scrollDelta: 1500
  1940. }
  1941. }, // Github - Search 列表 - Code
  1942. github_search_commit: {
  1943. SiteTypeID: 0,
  1944. pager: {
  1945. type: 1,
  1946. nextLink: 'css;a.next_page',
  1947. pageElement: 'css;#commit_search_results > div',
  1948. insertPosition: ['css;#commit_search_results', 3],
  1949. replaceE: 'css;.pagination',
  1950. scrollDelta: 1500
  1951. }
  1952. }, // Github - Search 列表 - Commit
  1953. github_search_issue: {
  1954. SiteTypeID: 0,
  1955. pager: {
  1956. type: 1,
  1957. nextLink: 'css;a.next_page',
  1958. pageElement: 'css;.issue-list > div > div',
  1959. insertPosition: ['css;.issue-list > div', 3],
  1960. replaceE: 'css;.pagination',
  1961. scrollDelta: 1500
  1962. }
  1963. }, // Github - Search 列表 - Issues/Discussions
  1964. github_search_package: {
  1965. SiteTypeID: 0,
  1966. pager: {
  1967. type: 1,
  1968. nextLink: 'css;a.next_page',
  1969. pageElement: 'css;#package_search_results > div',
  1970. insertPosition: ['css;#package_search_results', 3],
  1971. replaceE: 'css;.pagination',
  1972. scrollDelta: 1500
  1973. }
  1974. }, // Github - Search 列表 - Package
  1975. github_search_marketplace: {
  1976. SiteTypeID: 0,
  1977. pager: {
  1978. type: 1,
  1979. nextLink: 'css;a.next_page',
  1980. pageElement: 'css;.issue-list > div',
  1981. insertPosition: ['css;.issue-list', 3],
  1982. replaceE: 'css;.pagination',
  1983. scrollDelta: 1500
  1984. }
  1985. }, // Github - Search 列表 - Marketplace
  1986. github_search_topics: {
  1987. SiteTypeID: 0,
  1988. pager: {
  1989. type: 1,
  1990. nextLink: 'css;a.next_page',
  1991. pageElement: 'css;.topic-list > div',
  1992. insertPosition: ['css;.topic-list', 3],
  1993. replaceE: 'css;.pagination',
  1994. scrollDelta: 1500
  1995. }
  1996. }, // Github - Search 列表 - Topics
  1997. github_search_wiki: {
  1998. SiteTypeID: 0,
  1999. pager: {
  2000. type: 1,
  2001. nextLink: 'css;a.next_page',
  2002. pageElement: 'css;#wiki_search_results > div:first-child > div',
  2003. insertPosition: ['css;#wiki_search_results > div:first-child', 3],
  2004. replaceE: 'css;.pagination',
  2005. scrollDelta: 1500
  2006. }
  2007. }, // Github - Search 列表 - wiki
  2008. github_search_user: {
  2009. SiteTypeID: 0,
  2010. pager: {
  2011. type: 1,
  2012. nextLink: 'css;a.next_page',
  2013. pageElement: 'css;#user_search_results > div:first-child > div',
  2014. insertPosition: ['css;#user_search_results > div:first-child', 3],
  2015. replaceE: 'css;.pagination',
  2016. scrollDelta: 1500
  2017. }
  2018. }, // Github - Search 列表 - user
  2019. pubmed: {
  2020. SiteTypeID: 0,
  2021. host: 'pubmed.ncbi.nlm.nih.gov',
  2022. pager: {
  2023. type: 2,
  2024. nextLink: 'button.load-button.next-page',
  2025. nextText: 'Show more',
  2026. scrollDelta: 1500
  2027. }
  2028. }, // 学术
  2029. wikihow: {
  2030. SiteTypeID: 0,
  2031. host: ['www.wikihow.com', 'zh.wikihow.com'],
  2032. functionStart: function() {if (location.pathname.indexOf('/Category:') > -1) {
  2033. curSite = DBSite.wikihow;
  2034. } else if (location.pathname.indexOf('/wikiHowTo') > -1 && location.search.indexOf('?search=') > -1) {
  2035. curSite = DBSite.wikihow_search;
  2036. }},
  2037. pager: {
  2038. type: 1,
  2039. nextLink: 'css;a.pag_next',
  2040. pageElement: 'css;#cat_all > .cat_grid > div',
  2041. insertPosition: ['css;#cat_all > .cat_grid', 3],
  2042. replaceE: 'css;#large_pagination',
  2043. scriptType: 4,
  2044. scrollDelta: 2000
  2045. }
  2046. }, // 指南
  2047. wikihow_search: {
  2048. SiteTypeID: 0,
  2049. pager: {
  2050. type: 1,
  2051. nextLink: 'css;#searchresults_footer > a.buttonright',
  2052. pageElement: 'css;#searchresults_list > a',
  2053. insertPosition: ['css;#searchresults_list', 3],
  2054. replaceE: 'css;#searchresults_footer',
  2055. scrollDelta: 3000
  2056. }
  2057. }, // 指南 - 搜索页
  2058. afreecatv: {
  2059. SiteTypeID: 0,
  2060. host: 'www.afreecatv.com',
  2061. pager: {
  2062. type: 2,
  2063. nextLink: '.btn-more > button',
  2064. intervals: 2000,
  2065. scrollDelta: 1000
  2066. }
  2067. }, // 直播
  2068. greasyfork: {
  2069. SiteTypeID: 0,
  2070. host: 'gf.qytechs.cn',
  2071. functionStart: function() {if (/\/scripts$/.test(location.pathname) || location.pathname.indexOf('/scripts/by-site/') > -1) {
  2072. curSite = DBSite.greasyfork;
  2073. } else if (/\/feedback$/.test(location.pathname)) {
  2074. curSite = DBSite.greasyfork_feedback;
  2075. } else if (location.pathname.indexOf('/discussions') > -1 && !(/\/\d+/.test(location.pathname))) {
  2076. curSite = DBSite.greasyfork_discussions;
  2077. }},
  2078. pager: {
  2079. type: 1,
  2080. nextLink: '//a[@class="next_page"][@href]',
  2081. pageElement: 'css;ol#browse-script-list > li',
  2082. insertPosition: ['css;ol#browse-script-list', 3],
  2083. replaceE: 'css;.pagination',
  2084. scrollDelta: 1000
  2085. }
  2086. }, // 脚本
  2087. greasyfork_feedback: {
  2088. SiteTypeID: 0,
  2089. pager: {
  2090. type: 1,
  2091. nextLink: '//a[@class="next_page"][@href]',
  2092. pageElement: 'css;.script-discussion-list > div',
  2093. insertPosition: ['css;.script-discussion-list', 3],
  2094. replaceE: 'css;.pagination',
  2095. scrollDelta: 1500
  2096. }
  2097. }, // 脚本 - 反馈页
  2098. greasyfork_discussions: {
  2099. SiteTypeID: 0,
  2100. pager: {
  2101. type: 1,
  2102. nextLink: '//a[@class="next_page"][@href]',
  2103. pageElement: 'css;.discussion-list > div',
  2104. insertPosition: ['css;.discussion-list', 3],
  2105. replaceE: 'css;.pagination',
  2106. scrollDelta: 1000
  2107. }
  2108. }, // 脚本 - 讨论页
  2109. ruyile_xuexiao: {
  2110. SiteTypeID: 0,
  2111. host: 'www.ruyile.com',
  2112. functionStart: function() {
  2113. if (location.pathname === '/xuexiao/') {
  2114. curSite = DBSite.ruyile_xuexiao;
  2115. } else if (location.pathname === '/data/') {
  2116. curSite = DBSite.ruyile_data;
  2117. } else if (location.pathname === '/shijuan/') {
  2118. curSite = DBSite.ruyile_shijuan;
  2119. }},
  2120. pager: {
  2121. type: 1,
  2122. nextLink: '//div[@class="fy"]/a[contains(text(), "下一页")][@href]',
  2123. pageElement: 'css;.xxlb > .sk',
  2124. insertPosition: ['css;.xxlb', 3],
  2125. replaceE: 'css;.fy',
  2126. scrollDelta: 1000
  2127. }
  2128. }, // 如意了教育 - 学校
  2129. ruyile_data: {
  2130. SiteTypeID: 0,
  2131. pager: {
  2132. type: 1,
  2133. nextLink: '//div[@class="fy"]/a[contains(text(), "下一页")][@href]',
  2134. pageElement: 'css;.m1_z > .lbk',
  2135. insertPosition: ['css;.page', 1],
  2136. replaceE: 'css;.fy',
  2137. scrollDelta: 1000
  2138. }
  2139. }, // 如意了教育 - 数据
  2140. ruyile_shijuan: {
  2141. SiteTypeID: 0,
  2142. pager: {
  2143. type: 1,
  2144. nextLink: '//div[@class="fy"]/a[contains(text(), "下一页")][@href]',
  2145. pageElement: 'css;.m1_z > .m2_lb',
  2146. insertPosition: ['css;.page', 1],
  2147. replaceE: 'css;.fy',
  2148. scrollDelta: 1000
  2149. }
  2150. }, // 如意了教育 - 试卷
  2151. kdslife: {
  2152. SiteTypeID: 0,
  2153. host: 'club.kdslife.com',
  2154. functionStart: function() {
  2155. if (location.pathname.indexOf('/f_') > -1) {
  2156. curSite = DBSite.kdslife;
  2157. } else if (location.pathname.indexOf('/t_') > -1) {
  2158. curSite = DBSite.kdslife_t;
  2159. }},
  2160. pager: {
  2161. type: 1,
  2162. nextLink: '//div[@class="fr i3_r"]/a[@href][contains(text(), "后一页")]',
  2163. pageElement: 'css;ul.main_List > li.i2:not(.h_bg)',
  2164. insertPosition: ['css;ul.main_List > li.i3', 1],
  2165. replaceE: 'css;ul.main_List > li.i3',
  2166. scrollDelta: 1000
  2167. }
  2168. }, // 宽带山论坛
  2169. kdslife_t: {
  2170. SiteTypeID: 0,
  2171. pager: {
  2172. type: 1,
  2173. nextLink: '//div[@class="pages"]/a[contains(text(), ">>")]',
  2174. pageElement: 'css;#reply_list_panel > *, script[src*="ui/js/kds.js"]',
  2175. insertPosition: ['css;#reply_list_panel', 3],
  2176. replaceE: 'css;.pages',
  2177. scriptType: 3,
  2178. scrollDelta: 1000
  2179. }
  2180. }, // 宽带山论坛 - 帖子内
  2181. libaclub: {
  2182. SiteTypeID: 0,
  2183. host: 'www.libaclub.com',
  2184. functionStart: function() {
  2185. if (location.pathname === '/' || location.pathname.indexOf('/date_') > -1) {
  2186. curSite = DBSite.libaclub;
  2187. } else if (location.pathname.indexOf('/f_') > -1) {
  2188. curSite = DBSite.libaclub_f;
  2189. } else if (location.pathname.indexOf('/t_') > -1 || location.pathname.indexOf('/reply_') > -1) {
  2190. curSite = DBSite.libaclub_t;
  2191. } else if (location.pathname.indexOf('/prt_') > -1) {
  2192. curSite = DBSite.libaclub_prt;
  2193. } else if (location.pathname === '/facade.php') {
  2194. curSite = DBSite.libaclub_search;
  2195. }
  2196. document.lastElementChild.appendChild(document.createElement('style')).textContent = 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}';},
  2197. pager: {
  2198. type: 1,
  2199. nextLink: '//div[@class="ui-crumbs-more"]/a[@class="fn-link"][1]',
  2200. pageElement: 'css;ul.ui-list > li:not(.ui-list-item-head):not(.ui-list-merchant-ad)',
  2201. insertPosition: ['css;ul.ui-list', 3],
  2202. replaceE: 'css;div.ui-crumbs-more',
  2203. scrollDelta: 1200
  2204. }
  2205. }, // 篱笆网论坛
  2206. libaclub_f: {
  2207. SiteTypeID: 0,
  2208. pager: {
  2209. type: 1,
  2210. nextLink: '//div[@class="ui-paging"]/a[@class="ui-paging-next"]',
  2211. pageElement: 'css;ul.ui-list > li:not(.ui-list-item-head):not(.ui-list-merchant-ad)',
  2212. insertPosition: ['css;ul.ui-list', 3],
  2213. replaceE: 'css;div.ui-paging',
  2214. scrollDelta: 1200
  2215. }
  2216. }, // 篱笆网论坛 - 各版块帖子列表
  2217. libaclub_t: {
  2218. SiteTypeID: 0,
  2219. pager: {
  2220. type: 1,
  2221. nextLink: 'css;a.ui-paging-next',
  2222. pageElement: 'css;.ui-box-content > div.ui-topic, .ui-box-content > a[name]',
  2223. insertPosition: ['css;.ui-box-content', 3],
  2224. replaceE: 'css;div.ui-paging',
  2225. scrollDelta: 1500
  2226. }
  2227. }, // 篱笆网论坛 - 帖子内
  2228. libaclub_prt: {
  2229. SiteTypeID: 0,
  2230. pager: {
  2231. type: 1,
  2232. nextLink: 'css;a.ui-paging-next',
  2233. pageElement: 'css;ul.ui-list > li',
  2234. insertPosition: ['css;ul.ui-list', 3],
  2235. replaceE: 'css;div.ui-paging',
  2236. scrollDelta: 2000
  2237. }
  2238. }, // 篱笆网论坛 - 帖子内 - 打印版
  2239. libaclub_search: {
  2240. SiteTypeID: 0,
  2241. pager: {
  2242. type: 1,
  2243. nextLink: '//div[@class="ui-page"]/a[contains(text(), "下一页")]',
  2244. pageElement: 'css;.ui-box-main > ul.ui-list > li',
  2245. insertPosition: ['css;.ui-box-main > ul.ui-list', 3],
  2246. replaceE: 'css;div.ui-page',
  2247. scrollDelta: 1200
  2248. }
  2249. } // 篱笆网论坛 - 搜索页
  2250. };
  2251. // 生成 SiteTypeID
  2252. generateID();
  2253. // 用于脚本判断(针对部分特殊的网站)
  2254. SiteType = {
  2255. BAIDU_TIEBA: DBSite.baidu_tieba.SiteTypeID,
  2256. GAMERSKY_GL: DBSite.gamersky_gl.SiteTypeID
  2257. };
  2258. }
  2259.  
  2260.  
  2261. if (webType != 1) {
  2262. // < 所有 Discuz!论坛 >
  2263. if (webType === 2) {
  2264. if (location.pathname.indexOf('.html') > -1) { // 判断是不是静态网页(.html 结尾)
  2265. if (location.pathname.indexOf('/forum-') > -1) { // < 各版块帖子列表 >
  2266. if (document.getElementById('autopbn')) { // 判断是否有 [下一页] 按钮
  2267. curSite = DBSite.discuz_forum;
  2268. } else if (document.getElementById('waterfall')) { // 判断是否为图片模式
  2269. curSite = DBSite.discuz_waterfall; waterfallStyle(); // 图片模式列表样式预处理
  2270. } else {
  2271. curSite = DBSite.discuz_guide;
  2272. }
  2273. } else if (location.pathname.indexOf('/thread-') > -1) { // < 帖子内 >
  2274. if (GM_getValue('menu_discuz_thread_page')) {
  2275. curSite = DBSite.discuz_thread;
  2276. hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
  2277. }
  2278. } else if(location.pathname.indexOf('search') > -1) { // < 搜索结果 >
  2279. curSite = DBSite.discuz_search;
  2280. }
  2281. }
  2282. // 如果没有匹配的则继续
  2283. if (curSite.SiteTypeID === 0) {
  2284. if (location.search.indexOf('mod=forumdisplay') > -1 || location.pathname.indexOf('forumdisplay.php') > -1) { // < 各版块帖子列表 >
  2285. if (document.getElementById('autopbn')) { // 判断是否有 [下一页] 按钮
  2286. curSite = DBSite.discuz_forum;
  2287. } else if (document.getElementById('waterfall')) { // 判断是否为图片模式
  2288. curSite = DBSite.discuz_waterfall; waterfallStyle(); // 图片模式列表样式预处理
  2289. } else {
  2290. curSite = DBSite.discuz_guide;
  2291. }
  2292. } else if (location.search.indexOf('mod=viewthread') > -1 || location.pathname.indexOf('viewthread.php') > -1) { // < 帖子内 >
  2293. if (GM_getValue('menu_discuz_thread_page')) {
  2294. curSite = DBSite.discuz_thread;
  2295. hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
  2296. }
  2297. } else if (location.search.indexOf('mod=guide') > -1) { // < 导读帖子列表 >
  2298. curSite = DBSite.discuz_guide;
  2299. } else if(location.search.indexOf('mod=space') > -1 && location.search.indexOf('&view=me') > -1) { // 别人的主题/回复
  2300. curSite = DBSite.discuz_youspace;
  2301. } else if (location.search.indexOf('mod=collection') > -1) { // < 淘贴列表 >
  2302. curSite = DBSite.discuz_collection;
  2303. } else if (location.pathname.indexOf('search') > -1) { // < 搜索结果 >
  2304. curSite = DBSite.discuz_search;
  2305. } else if (document.getElementById('threadlist')) { // < 部分论坛的各板块 URL 是自定义的 >
  2306. curSite = DBSite.discuz_forum;
  2307. } else if (document.getElementById('postlist')) { // < 部分论坛的帖子内 URL 是自定义的 >
  2308. if (GM_getValue('menu_discuz_thread_page')) {
  2309. curSite = DBSite.discuz_thread;
  2310. hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
  2311. }
  2312. }
  2313. }
  2314. // < 所有 Flarum 论坛 >
  2315. } else if (webType === 3) {
  2316. curSite = DBSite.flarum;
  2317. // < 所有使用 WordPress DUX 主题的网站 >
  2318. } else if (webType === 4) {
  2319. if (location.pathname.indexOf('.html') === -1) curSite = DBSite.dux;
  2320. if (location.host === 'apphot.cc') curSite.pager.scrollDelta = 2500; // 对于速度慢的网站,需要增加翻页敏感度
  2321. }
  2322. }
  2323.  
  2324. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  2325. pausePageEvent(); // 左键双击网页空白处暂停翻页
  2326. curSite.pageUrl = ''; // 下一页URL
  2327. //console.log(curSite);
  2328. pageLoading(); // 自动无缝翻页
  2329.  
  2330.  
  2331. // [Discuz! 论坛] 隐藏帖子内的 [下一页] 按钮
  2332. function hidePgbtn() {
  2333. document.lastChild.appendChild(document.createElement('style')).textContent = '.pgbtn {display: none;}';
  2334. }
  2335. // [Discuz! 论坛] 图片模式列表样式预处理
  2336. function waterfallStyle() {
  2337. let width = document.querySelector('#waterfall > li:first-child').style.width;
  2338. document.lastChild.appendChild(document.createElement('style')).textContent = `#waterfall {height: auto !important; width: 100% !important;} #waterfall > li {width: ${width} !important; float: left !important; position: inherit !important; left: auto !important; top: auto !important;}`;
  2339. }
  2340. // [Discuz! 论坛] 的插入前函数(加载图片,仅部分论坛)
  2341. function discuz_thread_functionBefore(pageElems) {
  2342. if (location.hostname === 'bbs.pcbeta.com') { // 仅部分论坛需要处理
  2343. pageElems.forEach(function (one) {
  2344. one.querySelectorAll('img[file]').forEach(function (now) {
  2345. now.src = now.getAttribute('file');
  2346. });
  2347. });
  2348. }
  2349. return pageElems
  2350. }
  2351.  
  2352.  
  2353. // 通用型插入前函数(加载图片 data-original => src)
  2354. function src_original_functionBefore(pageElems) {
  2355. pageElems.forEach(function (one) {
  2356. let now = one.querySelector('img[data-original]')
  2357. if (now) {
  2358. now.src = now.dataset.original;
  2359. }
  2360. });
  2361. return pageElems
  2362. }
  2363.  
  2364.  
  2365. // [DUX] 的插入前函数(加载图片)
  2366. function dux_functionBefore(pageElems) {
  2367. pageElems.forEach(function (one) {
  2368. let now = one.querySelector('img.thumb[data-src]')
  2369. if (now) {now.src = now.dataset.src;}
  2370. });
  2371. return pageElems
  2372. }
  2373.  
  2374.  
  2375. // [头条搜索] 的插入前函数(过滤相关搜索)
  2376. function toutiao_functionBefore(pageElems) {
  2377. for (let i = 0; i < pageElems.length; i++) {
  2378. let now = pageElems[i].querySelector('div[class*="-header"]')
  2379. if (now && now.textContent === '相关搜索') {
  2380. pageElems.splice(i,1)
  2381. }
  2382. }
  2383. return pageElems
  2384. }
  2385.  
  2386.  
  2387. // [360搜索] 的插入前函数(加载图片)
  2388. function so_functionBefore(pageElems) {
  2389. pageElems.forEach(function (one) {
  2390. one.querySelectorAll('img[data-isrc]').forEach(function (now) {
  2391. now.src = now.dataset.isrc;
  2392. now.className = now.className.replace('so-lazyimg','');
  2393. });
  2394. });
  2395. return pageElems
  2396. }
  2397.  
  2398.  
  2399. // [百度贴吧](发帖按钮点击事件)
  2400. function baidu_tieba_1() {
  2401. let button = document.querySelector('.tbui_aside_fbar_button.tbui_fbar_post > a');
  2402. if (button) {
  2403. button.remove();
  2404. document.querySelector('li.tbui_aside_fbar_button.tbui_fbar_down').insertAdjacentHTML(addTo(4), '<li class="tbui_aside_fbar_button tbui_fbar_post"><a href="javascript:void(0);" title="因为 [自动无缝翻页] 的原因,请点击该按钮发帖!"></a></li>')
  2405. button = document.querySelector('.tbui_aside_fbar_button.tbui_fbar_post > a');
  2406. if (button) {
  2407. button.onclick = function(){
  2408. let button2 = document.querySelector('div.edui-btn.edui-btn-fullscreen.edui-btn-name-portrait');
  2409. if (button2) {
  2410. button2.click();
  2411. } else {
  2412. alert('提示:登录(不可用)后才能发帖!');
  2413. }
  2414. return false;
  2415. }
  2416. }
  2417. }
  2418. }
  2419. // [百度贴吧] 的插入前函数(加载图片)
  2420. function baidu_tieba_functionBefore(pageElems) {
  2421. pageElems.forEach(function (one) {
  2422. one.querySelectorAll('img.threadlist_pic[data-original]').forEach(function (now) {
  2423. now.src = now.dataset.original;
  2424. now.style.display = 'inline';
  2425. })
  2426. });
  2427. return pageElems
  2428. }
  2429. // [百度贴吧] 获取下一页地址
  2430. function baidu_tieba_functionNext() {
  2431. let next = document.querySelector('a.next.pagination-item[href]');
  2432. if (next != null && next.nodeType === 1 && next.href && next.href.slice(0,4) === 'http') {
  2433. var url = next.href + '&pagelets=frs-list%2Fpagelet%2Fthread&pagelets_stamp=' + new Date().getTime();
  2434. if (url === curSite.pageUrl) return
  2435. curSite.pageUrl = url;
  2436. getPageElems(curSite.pageUrl);
  2437. };
  2438. }
  2439. // [百度贴吧] 插入数据
  2440. function baidu_tieba_insertElement(newBody, type) {
  2441. if (!newBody) return
  2442. let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody),
  2443. toElement = getAllElements(curSite.pager.insertPosition[0])[0];
  2444. if (pageElems.length >= 0) {
  2445. // 执行插入前函数
  2446. pageElems = curSite.function.before(pageElems);
  2447. // 插入位置
  2448. let addTo1 = addTo(curSite.pager.insertPosition[1]);
  2449. // 获取 <script> 内容
  2450. const scriptElems = getAllElements('//script', newBody, newBody);
  2451. let scriptText = '';
  2452. for (let i = 0; i < scriptElems.length; i++) {
  2453. if (scriptElems[i].textContent.indexOf('Bigpipe.register("frs-list/pagelet/thread_list"') > -1) {
  2454. scriptText = scriptElems[i].textContent.replace('Bigpipe.register("frs-list/pagelet/thread_list", ','');
  2455. break
  2456. }
  2457. }
  2458. if (scriptText) {
  2459. scriptText = scriptText.slice(0, scriptText.indexOf(').')) // 获取主体内容
  2460. let scriptJSON = JSON.parse(scriptText).content; // 字符串转 JSON
  2461. var temp_baidu_tieba = document.createElement('div'); temp_baidu_tieba.innerHTML = scriptJSON; // 字符串转 Element 元素
  2462. pageElems = curSite.function.before(getAllElements(curSite.pager.pageElement, temp_baidu_tieba, temp_baidu_tieba)); // 插入前执行函数
  2463. pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo1, one);}); // 插入元素
  2464. // 当前页码 + 1
  2465. pageNum.now = pageNum._now + 1
  2466. // 替换元素
  2467. let oriE = document.querySelectorAll(curSite.pager.pageElement.replace('css;', '')),
  2468. repE = getAllElements(curSite.pager.replaceE, temp_baidu_tieba, temp_baidu_tieba);
  2469. if (oriE.length === repE.length) {
  2470. for (let i = 0; i < oriE.length; i++) {
  2471. oriE[i].outerHTML = repE[i].outerHTML;
  2472. }
  2473. }
  2474. }
  2475. }
  2476. }
  2477.  
  2478.  
  2479. // [NGA(玩家社区)] 的插入后函数(加载各版块帖子列表样式)
  2480. function nga_thread_functionAfter() {
  2481. document.body.appendChild(document.createElement('script')).textContent = 'commonui.topicArg.loadAll();';
  2482. }
  2483.  
  2484. // [V2EX] 的插入后函数(新标签页打开链接)
  2485. function v2ex_functionAfter(css) {
  2486. let links = document.querySelectorAll(css);if (!links) return
  2487. links.forEach(function (_this) {_this.target = '_blank';});
  2488. }
  2489.  
  2490. // [龙的天空] 获取下一页地址
  2491. function lkong_functionNext() {
  2492. let next = document.querySelector('li.ant-pagination-next'), page;
  2493. if (next && next.getAttribute('aria-disabled') === 'false') {
  2494. page = document.querySelector('li.ant-pagination-item-active[title]');
  2495. if (page && page.title) {
  2496. if (curSite.pager.intervals) {
  2497. let _SiteTypeID = curSite.SiteTypeID; curSite.SiteTypeID = 0;
  2498. setTimeout(function(){curSite.SiteTypeID = _SiteTypeID;}, curSite.pager.intervals)
  2499. }
  2500. return (location.origin + location.pathname + '?page=' + ++page.title);
  2501. }
  2502. }
  2503. return '';
  2504. }
  2505.  
  2506. // [千图网] 的插入前函数(加载图片)
  2507. function _58pic_functionBefore(pageElems) {
  2508. let is_one = document.querySelector('.qtw-card.place-box.is-one');
  2509. if (is_one && is_one.style.display != 'none') {is_one.style.display = 'none';}
  2510. pageElems.forEach(function (one) {
  2511. let now = one.querySelector('img.lazy')
  2512. if (now && now.getAttribute('src') != now.dataset.original) {
  2513. now.src = now.dataset.original;
  2514. now.style.display = 'block';
  2515. }
  2516. });
  2517. return pageElems
  2518. }
  2519.  
  2520.  
  2521. // [Pixabay] 的插入前函数(加载图片)
  2522. function pixabay_functionBefore(pageElems) {
  2523. pageElems.forEach(function (one) {
  2524. let now = one.querySelector('img[data-lazy-src]')
  2525. if (now) {
  2526. now.src = now.dataset.lazySrc;
  2527. now.removeAttribute('data-lazy-src')
  2528. now.removeAttribute('data-lazy-srcset')
  2529. }
  2530. });
  2531. return pageElems
  2532. }
  2533.  
  2534.  
  2535. // [游民星空-攻略] 的插入前函数(移除下一页底部的 "更多相关内容请关注:xxx" 文字)
  2536. function gamersky_gl_functionBefore(pageElems) {
  2537. pageElems.forEach(function (one) {
  2538. if (one.tagName === 'P' && one.textContent.indexOf('更多相关内容请关注') > -1) {one.style.display = 'none';}
  2539. });
  2540. return pageElems
  2541. }
  2542.  
  2543.  
  2544. // [NexusMods] 获取下一页地址
  2545. function nexusmods_functionNext() {
  2546. if (document.querySelector('.nexus-ui-blocker')) return
  2547. let out_items = JSON.stringify(RH_ModList.out_items).replace(/{|}|"/g,''),
  2548. nextNum = getElementByXpath('id("mod-list")/div[contains(@class, "pagenav")][1]//a[contains(@class, "page-selected")]/parent::li/following-sibling::li/a'),
  2549. categories = RH_ModList.out_items.categories, categoriesUrl = '';
  2550. var url = '';
  2551. if (nextNum && nextNum.innerText) {
  2552. nextNum = nextNum.innerText;
  2553. if (out_items.indexOf('page:') > -1) {
  2554. out_items = out_items.replace(/page:\d+/, `page:${nextNum}`)
  2555. } else {
  2556. out_items += `,page:${nextNum}`;
  2557. }
  2558. if (categories && categories != []) {
  2559. for (let i = 0; i < categories.length; i++) {
  2560. categoriesUrl += `,categories[]:${categories[i]}`
  2561. }
  2562. categoriesUrl = categoriesUrl.replace(/,/,'');
  2563. if (out_items.indexOf('categories:') > -1) {
  2564. out_items = out_items.replace(/categories:\[.*\]/, categoriesUrl)
  2565. }
  2566. }
  2567. url = 'https://www.nexusmods.com' + RH_ModList.uri + '?RH_ModList=' + out_items
  2568. //console.log(nextNum, url, curSite.pageUrl, out_items)
  2569. if (url === curSite.pageUrl) return
  2570. curSite.pageUrl = url;
  2571. //console.log(nextNum, curSite.pageUrl, out_items)
  2572. getPageElems(curSite.pageUrl)
  2573. }
  2574. }
  2575. // [NexusMods] 插入数据
  2576. function nexusmods_insertElement(newBody, type) {
  2577. if (!newBody) return
  2578. let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody), // 主体元素
  2579. toElement = getAllElements(curSite.pager.insertPosition[0])[0], // 插入位置的元素
  2580. addTo1 = addTo(curSite.pager.insertPosition[1]); // 插入位置
  2581. // 添加下载数据
  2582. pageElems.forEach(function (one) {
  2583. let now = one.querySelector('.mod-tile-left');
  2584. if (now) {
  2585. let downloadCount = now.querySelector('.downloadcount > span.flex-label');
  2586. if (downloadCount) {
  2587. downloadCount.textContent = shortFormat(parseInt(GlobalModStats[now.dataset.gameId][now.dataset.modId].total));
  2588. }
  2589. }
  2590. });
  2591. // 插入网页
  2592. pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo1, one);});
  2593. // 当前页码 + 1
  2594. pageNum.now = pageNum._now + 1
  2595. // 替换元素
  2596. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  2597. repE = getAllElements(curSite.pager.replaceE, newBody, newBody);
  2598. if (oriE.length === repE.length) {
  2599. for (let i = 0; i < oriE.length; i++) {
  2600. oriE[i].outerHTML = repE[i].outerHTML;
  2601. }
  2602. }
  2603. }
  2604.  
  2605.  
  2606. // [cs_rin_ru] 各版块帖子列表的插入前函数(过滤置顶帖子)
  2607. function cs_rin_ru_functionBefore(pageElems) {
  2608. for (let i = 0; i < pageElems.length; i++) {
  2609. if (pageElems[i].textContent.replace(/\n| /g,'') === 'Topics') {
  2610. pageElems.splice(0,i+1);
  2611. break;
  2612. }
  2613. }
  2614. return pageElems
  2615. }
  2616.  
  2617.  
  2618. // [片库] 的插入前函数(加载图片)
  2619. function mypianku_functionBefore(pageElems) {
  2620. pageElems.forEach(function (one) {
  2621. let now = one.querySelector('img')
  2622. if (now) {
  2623. now.src = now.dataset.src;
  2624. }
  2625. });
  2626. return pageElems
  2627. }
  2628.  
  2629.  
  2630. // [奈菲影视/真不卡影院] 的插入前函数(加载图片)
  2631. function nfmovies_functionBefore(pageElems) {
  2632. pageElems.forEach(function (one) {
  2633. let now = one.querySelector('a.lazyload')
  2634. if (now) {
  2635. now.style.backgroundImage = 'url("' + now.dataset.original + '")';
  2636. }
  2637. });
  2638. return pageElems
  2639. }
  2640.  
  2641.  
  2642. // [不死鸟] 的插入前函数(加载图片)
  2643. function iao_su_functionBefore(pageElems) {
  2644. pageElems.forEach(function (one) {
  2645. let now = one.getElementsByClassName('post-card')[0]
  2646. if (now) {
  2647. now.getElementsByClassName('blog-background')[0].style.backgroundImage = 'url("' + now.getElementsByTagName('script')[0].textContent.split("'")[1] + '")';
  2648. //now.getElementsByClassName('blog-background')[0].style.backgroundImage = 'url("' + RegExp("(?<=loadBannerDirect\\(').*(?=', '',)").exec(now.getElementsByTagName('script')[0].textContent)[0]; + '")';
  2649. }
  2650. });
  2651. return pageElems
  2652. }
  2653.  
  2654.  
  2655. // [异次元软件世界] 的插入前函数(加载图片)
  2656. function iplaysoft_postslist_functionBefore(pageElems) {
  2657. pageElems.forEach(function (one) {
  2658. let now = one.querySelector('img.lazyload')
  2659. if (now && !now.src) {
  2660. now.src = now.dataset.src;
  2661. now.setAttribute('srcset', now.dataset.src)
  2662. now.setAttribute('class', 'lazyloaded')
  2663. }
  2664. });
  2665. return pageElems
  2666. }
  2667.  
  2668.  
  2669. // [LRepacks] 的插入前函数(调整 class)
  2670. function lrepacks_functionBefore(pageElems) {
  2671. pageElems.forEach(function (one) {
  2672. let now = one.querySelector('.slideUp, .elementFade')
  2673. if (now) {
  2674. now.className = now.className.replace('slideUp','slideUpRun').replace('elementFade','elementFadeRun');
  2675. }
  2676. });
  2677. return pageElems
  2678. }
  2679.  
  2680.  
  2681. // [漫画狂] 获取下一页地址
  2682. function cartoonmad_functionNext() {
  2683. let nextXPAHT = '//a[@class="pages"][contains(text(),"下一頁")]',
  2684. nextPXPATH = '//a[@class="pages"][contains(string(),"下一話")]'
  2685. let url = getElementByXpath(nextXPAHT);
  2686. if (url) {
  2687. if (url.getAttribute('href') === 'thend.asp') {
  2688. url = getElementByXpath(nextPXPATH)
  2689. if (url) return url.href;
  2690. pausePage = false;
  2691. GM_notification({text: `注意:该网站早期漫画(如海贼王、柯南)因为网站自身问题而无法翻至下一话(仅限于显示为 [第 X 卷]/[下一卷] 的)。\n因此需要手动去 [目录页] 进入下一卷!`, timeout: 10000});
  2692. } else {
  2693. return url.href;
  2694. }
  2695. }
  2696. return '';
  2697. }
  2698.  
  2699.  
  2700. // [漫画猫] 初始化(显示本话所以图片)
  2701. function manhuacat_init() {
  2702. let _img = '';
  2703. for (let now of img_data_arr) {
  2704. _img += `<img src="${asset_domain}${img_pre}${now}">`;
  2705. }
  2706. document.querySelector('.img-content > img').remove();
  2707. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  2708.  
  2709. }
  2710. // [漫画猫] 获取下一页地址
  2711. function manhuacat_functionNext(pageElems, type) {
  2712. if (type === 'url') {
  2713. if(pageElems.code == '0000') {
  2714. if (pageElems.url === curSite.pageUrl) return
  2715. curSite.pageUrl = pageElems.url;
  2716. getPageElems(curSite.pageUrl); // 真正的下一页链接
  2717. }
  2718. } else {
  2719. let vg_r_data = document.querySelector('.vg-r-data');
  2720. if (vg_r_data) {
  2721. getPageElems(`https://${location.host}/chapter_num?chapter_id=${vg_r_data.dataset.chapter_num}&ctype=1&type=${vg_r_data.dataset.chapterType};`, 'json', 'GET', '', 'url');
  2722. }
  2723. }
  2724. }
  2725. // [漫画猫] 插入数据
  2726. function manhuacat_insertElement(pageElems, type) {
  2727. if (!pageElems) return
  2728. if (type === 'url') { // 获取下一页链接
  2729. manhuacat_functionNext(pageElems, type); return
  2730. }
  2731.  
  2732. // 添加历史记录
  2733. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  2734.  
  2735. // 替换元素
  2736. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  2737. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  2738. if (oriE.length === repE.length) {
  2739. for (let i = 0; i < oriE.length; i++) {
  2740. oriE[i].outerHTML = repE[i].outerHTML;
  2741. }
  2742. }
  2743.  
  2744. // 插入图片
  2745. let _img = '', _img_arr = LZString.decompressFromBase64(getElementByXpath('//body/script[not(@src)][contains(text(), "img_data")]').textContent.split('"')[1]).split(','), vg_r_data = document.querySelector('.vg-r-data');;
  2746. for (let now of _img_arr) {
  2747. _img += `<img src="${vg_r_data.dataset.chapterDomain}${img_pre}${now}">`;
  2748. }
  2749. if (_img) {
  2750. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  2751. // 当前页码 + 1
  2752. pageNum.now = pageNum._now + 1
  2753. }
  2754. }
  2755.  
  2756.  
  2757. // [漫画DB] 初始化(将本话其余图片插入网页中)
  2758. function manhuadb_init() {
  2759. let _img = '',
  2760. data = document.querySelector('.vg-r-data'), imgDate;
  2761. if (!data) return
  2762. document.querySelectorAll(curSite.pager.pageElement.replace('css;', '')).forEach(function (one) {
  2763. if (one.tagName === 'SCRIPT' && one.textContent.indexOf('var img_data =') > -1) {
  2764. let json = JSON.parse(window.atob(one.textContent.split("'")[1]));
  2765. if (json) {
  2766. let _img = '';
  2767. for (let i = 0; i < json.length; i++) { // 遍历图片文件名数组,组合为 img 标签
  2768. let src = data.dataset.host + data.dataset.img_pre + json[i].img;
  2769. _img += `<img class="img-fluid show-pic" src="${src}">`
  2770. }
  2771. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  2772. }
  2773. }
  2774. })
  2775. }
  2776. // [漫画DB] 获取下一页地址
  2777. function manhuadb_functionNext() {
  2778. let nextArr = document.querySelectorAll('a.fixed-a-es'), next;
  2779. var url = '';
  2780. if (nextArr.length == 0) return
  2781. for (let i = 0; i < nextArr.length; i++) {
  2782. if (nextArr[i].className.indexOf('active') > -1) {
  2783. if (nextArr[i+1]) url = nextArr[i+1].href;
  2784. break;
  2785. }
  2786. }
  2787. if (url === curSite.pageUrl) return
  2788. curSite.pageUrl = url
  2789. getPageElems(curSite.pageUrl);
  2790. }
  2791. // [漫画DB] 插入数据
  2792. function manhuadb_insertElement(pageElems, type) {
  2793. if (!pageElems) return
  2794. let oriE = document.querySelectorAll(curSite.pager.pageElement.replace('css;', '')),
  2795. repE = getAllElements(curSite.pager.pageElement, pageElems, pageElems);
  2796. if (oriE.length === repE.length) {
  2797. for (let i = 0; i < oriE.length; i++) {
  2798. oriE[i].outerHTML = repE[i].outerHTML;
  2799. }
  2800. // 当前页码 + 1
  2801. pageNum.now = pageNum._now + 1
  2802. manhuadb_init(); // 将刚刚替换的图片插入网页中
  2803. }
  2804. }
  2805.  
  2806.  
  2807. // [HiComic(嗨漫画)] 初始化(将本话其余图片插入网页中)
  2808. function hicomic_init() {
  2809. let _img = '';
  2810. document.querySelectorAll('.chapter > section:not(:first-child) > section[val]').forEach(function (one) {
  2811. let src = one.getAttribute('val');
  2812. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h'
  2813. _img += `<img src="${src}">`
  2814. })
  2815. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  2816. window.document.title = window.document.title.replace(/(\(第.+\))? - HiComic/, `(${document.querySelector('.chapter_name').textContent}) - HiComic`); // 修改网页标题(加上 第 X 话)
  2817. }
  2818. // [HiComic(嗨漫画)] 获取下一页地址
  2819. function hicomic_functionNext() {
  2820. let nextId;
  2821. nextId = document.querySelector('.next_chapter:not(.end)')
  2822. if (nextId && nextId.id && nextId.id != 'None') {
  2823. curSite.pageUrl = location.href;
  2824. getPageElems(`https://www.hicomic.net/api/web/chapter/${nextId.id}/contents`, 'json');
  2825. }
  2826. }
  2827. // [HiComic(嗨漫画)] 插入数据
  2828. function hicomic_insertElement(pageElems, type) {
  2829. if (!pageElems || pageElems.code != 200) return
  2830. if (pageElems.results.chapter.next) { // 写入下一页的 UUID
  2831. document.querySelector('.next_chapter').id = pageElems.results.chapter.next;
  2832. } else {
  2833. document.querySelector('.next_chapter').id = 'None';
  2834. document.querySelector('.next_chapter').classList.add('end');
  2835. }
  2836. document.querySelector('.chapter_name').textContent = pageElems.results.chapter.name; // 修改漫画标题
  2837. let title = window.document.title.replace(/(\(第.+\))? - HiComic/, `(${pageElems.results.chapter.name}) - HiComic`)
  2838. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, title, curSite.pageUrl); // 添加历史记录
  2839. window.document.title = title; // 修改当前网页标题为下一话的标题
  2840. let _img = '';
  2841. for (let i = 0; i < pageElems.results.chapter.contents.length; i++) { // 遍历图片文件名数组,组合为 img 标签
  2842. let src = pageElems.results.chapter.contents[i].url;
  2843. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h';
  2844. _img += `<img src="${src}">`
  2845. }
  2846. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  2847. // 当前页码 + 1
  2848. pageNum.now = pageNum._now + 1
  2849. }
  2850.  
  2851.  
  2852. // [动漫之家] 初始化(调整本话其余图片)
  2853. function dmzj_init() {
  2854. let _img = '';
  2855. document.querySelectorAll('.comic_wraCon > a > img').forEach(function (one) {
  2856. _img += `<img src="${one.dataset.original}">`;
  2857. one.parentElement.remove();
  2858. })
  2859. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  2860.  
  2861. }
  2862. // [动漫之家] 获取下一页地址
  2863. function dmzj_functionNext() {
  2864. let next;
  2865. next = document.querySelector('span.next > a[href]')
  2866. if (next) {
  2867. if (next.href === curSite.pageUrl) return
  2868. curSite.pageUrl = next.href;
  2869. getPageElems(curSite.pageUrl);
  2870. }
  2871. }
  2872. // [动漫之家] 插入数据
  2873. function dmzj_insertElement(pageElems, type) {
  2874. if (!pageElems) return
  2875. // 插入并运行 <script>
  2876. let scriptElement = pageElems.querySelectorAll('head > script[type]:not([src])'), scriptText = '';
  2877. scriptElement.forEach(function (one) {scriptText += ';' + one.textContent;});
  2878. if (scriptText) document.body.appendChild(document.createElement('script')).textContent = scriptText;
  2879.  
  2880. // 插入图片
  2881. let _img = '', _img_arr;
  2882. if (pages.indexOf('|') === -1) {
  2883. _img_arr = JSON.parse(pages.replace(/\r\n/g,'|')).page_url.split('|');
  2884. } else {
  2885. _img_arr = JSON.parse(pages).page_url.split('|');
  2886. }
  2887. for (let now of _img_arr) {
  2888. _img += `<img src="${img_prefix}${now}">`;
  2889. }
  2890. if (_img) {
  2891. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  2892.  
  2893. // 添加历史记录
  2894. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  2895.  
  2896. // 替换元素
  2897. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  2898. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  2899. if (oriE.length === repE.length) {
  2900. for (let i = 0; i < oriE.length; i++) {
  2901. oriE[i].outerHTML = repE[i].outerHTML;
  2902. }
  2903. // 当前页码 + 1
  2904. pageNum.now = pageNum._now + 1
  2905. }
  2906. }
  2907. }
  2908.  
  2909.  
  2910. // [动漫之家-漫画] 初始化(调整本话其余图片)
  2911. function dmzj_manhua_init() {
  2912. let _img = '';
  2913. document.querySelectorAll('#center_box > .inner_img img[src]').forEach(function (one) {
  2914. _img += `<img src="${one.dataset.original}">`;
  2915. one.parentElement.parentElement.remove();
  2916. })
  2917. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  2918.  
  2919. }
  2920. // [动漫之家-漫画] 获取下一页地址
  2921. function dmzj_manhua_functionNext() {
  2922. let next;
  2923. next = document.getElementById('next_chapter')
  2924. if (next) {
  2925. if (next.href === curSite.pageUrl) return
  2926. curSite.pageUrl = next.href;
  2927. getPageElems(curSite.pageUrl);
  2928. }
  2929. }
  2930. // [动漫之家-漫画] 插入数据
  2931. function dmzj_manhua_insertElement(pageElems, type) {
  2932. if (!pageElems) return
  2933. // 插入并运行 <script>
  2934. let scriptElement = pageElems.querySelectorAll('head > script[type]:not([src])'), scriptText = '';
  2935. scriptElement.forEach(function (one) {scriptText += ';' + one.textContent;});
  2936. if (scriptText) document.body.appendChild(document.createElement('script')).textContent = scriptText;
  2937.  
  2938. // 插入图片
  2939. let _img = '';
  2940. for (let now of arr_pages) {
  2941. _img += `<img src="${img_prefix}${now}">`;
  2942. }
  2943. if (_img) {
  2944. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  2945.  
  2946. // 添加历史记录
  2947. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  2948.  
  2949. // 替换元素
  2950. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  2951. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  2952. if (oriE.length === repE.length) {
  2953. for (let i = 0; i < oriE.length; i++) {
  2954. oriE[i].outerHTML = repE[i].outerHTML;
  2955. }
  2956. // 当前页码 + 1
  2957. pageNum.now = pageNum._now + 1
  2958. }
  2959. }
  2960. }
  2961.  
  2962.  
  2963. // [拷贝漫画] 获取下一页地址
  2964. function copymanga_functionNext() {
  2965. let next;
  2966. next = document.querySelector('.comicContent-next > a[href]')
  2967. if (next) {
  2968. if (next.href === curSite.pageUrl) return
  2969. curSite.pageUrl = next.href;
  2970. getPageElems(curSite.pageUrl);
  2971. }
  2972. }
  2973. // [拷贝漫画] 插入数据
  2974. function copymanga_insertElement(pageElems, type) {
  2975. if (!pageElems) return
  2976. // 添加历史记录
  2977. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  2978. let oldImg = document.querySelector('.comicContent-image-list').innerHTML;
  2979.  
  2980. // 替换元素
  2981. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  2982. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  2983. if (oriE.length === repE.length) {
  2984. for (let i = 0; i < oriE.length; i++) {
  2985. oriE[i].outerHTML = repE[i].outerHTML;
  2986. }
  2987. // 插入并运行 <script>
  2988. document.body.appendChild(document.createElement('script')).src = document.querySelector('body > script[async][src*="comic_content_pass"]').src;
  2989. setTimeout(function(){
  2990. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), oldImg); // 将 img 标签插入到网页中
  2991. }, 100);
  2992. // 当前页码 + 1
  2993. pageNum.now = pageNum._now + 1
  2994. }
  2995. }
  2996.  
  2997.  
  2998. // [古风漫画网] 获取下一页地址
  2999. function gufengmh8_functionNext() {
  3000. let pageElems = document.querySelector(curSite.pager.pageElement.replace('css;', '')); // 寻找数据所在元素
  3001. if (pageElems) {
  3002. let comicUrl, nextId;
  3003. var url = '';
  3004. pageElems.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  3005. //console.log(one)
  3006. if (one.indexOf('comicUrl') > -1) { // 下一页 URL 前半部分
  3007. comicUrl = one.split('"')[1];
  3008. } else if (one.indexOf('nextChapterData') > -1) { // 下一页 URL 的后半部分 ID
  3009. nextId = one.split('"id":')[1].split(',')[0];
  3010. }
  3011. })
  3012. if (comicUrl && nextId && nextId != 'null') { // 组合到一起就是下一页 URL
  3013. url = comicUrl + nextId + '.html'
  3014. if (url === curSite.pageUrl) return
  3015. curSite.pageUrl = url
  3016. getPageElems(curSite.pageUrl); // 访问下一页 URL 获取
  3017. }
  3018. }
  3019. }
  3020. // [古风漫画网] 插入数据
  3021. function gufengmh8_insertElement(pageElems, type) {
  3022. if (pageElems) {
  3023. let url = curSite.pageUrl;
  3024. pageElems = getAllElements(curSite.pager.pageElement, pageElems, pageElems)[0];
  3025. let chapterImages, chapterPath;
  3026. document.querySelector(curSite.pager.pageElement.replace('css;', '')).innerText = pageElems.textContent; // 将当前网页内的数据所在元素内容改为刚刚获取的下一页数据内容,以便循环获取下一页 URL
  3027. pageElems.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  3028. //console.log(one)
  3029. if (one.indexOf('chapterImages') > -1) { // 图片文件名数组
  3030. chapterImages = one.replace(/^.+\[/, '').replace(']', '').replaceAll('"', '').split(',')
  3031. } else if (one.indexOf('chapterPath') > -1) { // 图片文件路径
  3032. chapterPath = one.split('"')[1];
  3033. } else if (one.indexOf('pageTitle') > -1) { // 网页标题
  3034. let title = one.split('"')[1];
  3035. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, title, url); // 添加历史记录
  3036. window.document.title = title; // 修改当前网页标题为下一页的标题
  3037. }
  3038. })
  3039. if (chapterImages && chapterPath) {
  3040. let _img = '';
  3041. chapterImages.forEach(function (one2){ // 遍历图片文件名数组,组合为 img 标签
  3042. _img += '<img src="https://res.xiaoqinre.com/' + chapterPath + one2 + '" data-index="0" style="display: inline-block;">'
  3043. })
  3044. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3045. // 当前页码 + 1
  3046. pageNum.now = pageNum._now + 1
  3047. }
  3048. }
  3049. }
  3050.  
  3051.  
  3052. // [砂之船动漫家] 的插入前函数(加载图片)
  3053. function szcdmj_functionBefore(pageElems) {
  3054. pageElems.forEach(function (one) {
  3055. if (one.tagName === 'TITLE') {
  3056. let title = one.textContent;
  3057. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, title, curSite.pageUrl); // 添加历史记录
  3058. window.document.title = title; // 修改当前网页标题为下一页的标题
  3059. one.style.display = 'none';
  3060. } else {
  3061. let now = one.querySelector('img[data-original]')
  3062. if (now) {
  3063. now.src = now.dataset.original;
  3064. now.style.display = 'inline';
  3065. }
  3066. }
  3067. });
  3068. return pageElems
  3069. }
  3070.  
  3071.  
  3072. // 自动无缝翻页
  3073. function pageLoading() {
  3074. if (curSite.SiteTypeID > 0) {
  3075. windowScroll(function (direction, e) {
  3076. if (direction === 'down' && pausePage === true) { // 下滑/没有暂停翻页时,才准备翻页
  3077. let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop,
  3078. scrollHeight = window.innerHeight || document.documentElement.clientHeight,
  3079. scrollDelta = curSite.pager.scrollDelta;
  3080. if (curSite.pager.type === 3) { // <<<<< 翻页类型 3(依靠元素距离可视区域底部的距离来触发翻页)>>>>>
  3081. let scrollElement = document.querySelector(curSite.pager.scrollElement);
  3082. //console.log(scrollElement.offsetTop - (scrollTop + scrollHeight), scrollDelta, curSite.SiteTypeID)
  3083. if (scrollElement.offsetTop - (scrollTop + scrollHeight) <= scrollDelta) {
  3084. if (curSite.SiteTypeID === SiteType.GAMERSKY_GL) curSite.pager.scrollDelta -= 800 // 游民星空 gl 的比较奇葩,需要特殊处理下
  3085. ShowPager.loadMorePage();
  3086. }
  3087. } else {
  3088. if (document.documentElement.scrollHeight <= scrollHeight + scrollTop + scrollDelta) {
  3089. if (curSite.pager.type === 2) { // <<<<< 翻页类型 2(网站自带了自动无缝翻页功能,只需要点击下一页按钮即可)>>>>>
  3090. if (curSite.SiteTypeID > 0) { // 如果指定了间隔时间,那么就依靠这个判断时间到了没有~
  3091. let autopbn = document.querySelector(curSite.pager.nextLink);
  3092. if (autopbn) { // 寻找下一页链接
  3093. // 避免重复点击翻页按钮
  3094. if (curSite.pager.nextText) { // 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页
  3095. if (autopbn.innerText === curSite.pager.nextText) {autopbn.click(); pageNum.now = pageNum._now + 1;} // 当前页码 + 1
  3096. } else if (curSite.pager.nextTextOf) { // 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页
  3097. if (autopbn.innerText.indexOf(curSite.pager.nextTextOf) > -1) {autopbn.click(); pageNum.now = pageNum._now + 1;} // 当前页码 + 1
  3098. } else if (curSite.pager.nextHTML) { // 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页
  3099. if (autopbn.innerHTML === curSite.pager.nextHTML) {autopbn.click(); pageNum.now = pageNum._now + 1;} // 当前页码 + 1
  3100. } else { // 如果没有指定按钮文字就直接点击
  3101. autopbn.click(); pageNum.now = pageNum._now + 1; // 当前页码 + 1
  3102. // 对于没有按钮文字变化的按钮,可以手动指定间隔时间
  3103. if (curSite.pager.intervals) {
  3104. let _SiteTypeID = curSite.SiteTypeID; curSite.SiteTypeID = 0;
  3105. setTimeout(function(){curSite.SiteTypeID = _SiteTypeID;}, curSite.pager.intervals)
  3106. }
  3107. }
  3108. }
  3109. }
  3110. } else if (curSite.pager.type === 1) { // <<<<< 翻页类型 1(由脚本实现自动无缝翻页)>>>>>
  3111. if (curSite.SiteTypeID > 0) ShowPager.loadMorePage();
  3112. } else if (curSite.pager.type === 4) { // <<<<< 翻页类型 4(部分简单的动态加载类网站)>>>>>
  3113. if (curSite.SiteTypeID > 0) {
  3114. // 为百度贴吧的发帖考虑...
  3115. if (!(document.documentElement.scrollHeight <= scrollHeight + scrollTop + 200 && curSite.SiteTypeID === SiteType.BAIDU_TIEBA)) {
  3116. curSite.pager.nextLink();
  3117. }
  3118. if (curSite.pager.intervals) {
  3119. let _SiteTypeID = curSite.SiteTypeID;
  3120. curSite.SiteTypeID = 0;
  3121. setTimeout(function(){curSite.SiteTypeID = _SiteTypeID;}, curSite.pager.intervals)
  3122. }
  3123. }
  3124. }
  3125. }
  3126. }
  3127. }
  3128. });
  3129. }
  3130. }
  3131.  
  3132.  
  3133. // 启用/禁用 (当前网站)
  3134. function menu_disable(type) {
  3135. switch(type) {
  3136. case 'check':
  3137. if(check()) {return true;} else {return false;}; break;
  3138. case 'add':
  3139. add(); break;
  3140. case 'del':
  3141. del(); break;
  3142. }
  3143.  
  3144. function check() { // 存在返回真,不存在返回假
  3145. let list = GM_getValue('menu_disable'); // 读取网站列表
  3146. if (list.indexOf(location.host) === -1) return false // 不存在返回假
  3147. return true
  3148. }
  3149.  
  3150. function add() {
  3151. if (check()) return
  3152. let list = GM_getValue('menu_disable'); // 读取网站列表
  3153. list.push(location.host); // 追加网站域名
  3154. GM_setValue('menu_disable', list); // 写入配置
  3155. location.reload(); // 刷新网页
  3156. }
  3157.  
  3158. function del() {
  3159. if (!check()) return
  3160. let list = GM_getValue('menu_disable'), // 读取网站列表
  3161. index = list.indexOf(location.host);
  3162. list.splice(index, 1); // 删除网站域名
  3163. GM_setValue('menu_disable', list); // 写入配置
  3164. location.reload(); // 刷新网页
  3165. }
  3166. }
  3167.  
  3168.  
  3169. // 左键双击网页空白处暂停翻页
  3170. function pausePageEvent() {
  3171. if (!GM_getValue('menu_pause_page')) return
  3172. if (curSite.SiteTypeID === 0) return
  3173. document.body.addEventListener('dblclick', function (e) {
  3174. if (pausePage) {
  3175. pausePage = false;
  3176. GM_notification({text: `❌ 已暂停本页 [自动无缝翻页]\n (再次双击可恢复)`, timeout: 2500});
  3177. } else {
  3178. pausePage = true;
  3179. GM_notification({text: `✅ 已恢复本页 [自动无缝翻页]\n (再次双击可暂停)`, timeout: 2500});
  3180. }
  3181. });
  3182. }
  3183.  
  3184.  
  3185. // 显示页码
  3186. function pageNumber(type) {
  3187. if (curSite.SiteTypeID === 0) return
  3188. let status = document.getElementById('Autopage_number');
  3189. switch (type) {
  3190. case 'add':
  3191. add(); break;
  3192. case 'del':
  3193. del(); break;
  3194. case 'set':
  3195. set(); break;
  3196. }
  3197.  
  3198. function add(){
  3199. if (status) {
  3200. if (status.style.display === 'none') {status.style.display = 'flex';}
  3201. return
  3202. }
  3203. // 插入网页
  3204. let _html = `<style>#Autopage_number {top: calc(75vh) !important;left: 0 !important;width: 32px;height: 32px;padding: 6px !important;display: flex;position: fixed !important;opacity: 0.5;transition: .2s;z-index: 1000 !important;cursor: pointer;user-select: none !important;flex-direction: column;align-items: center;justify-content: center;box-sizing: content-box;border-radius: 0 50% 50% 0;transform-origin: center !important;transform: translateX(-8px);background-color: #eeec;-webkit-tap-highlight-color: transparent;box-shadow: 1px 1px 3px 0px #989898 !important;color: #000 !important;} #Autopage_number:hover {opacity: 1;transform: translateX(0);}</style>
  3205. <div id="Autopage_number" title="1. 此处数字为 [当前页码] (可在脚本菜单中关闭)&#10;&#10;2. 鼠标左键点击此处 [临时暂停本页自动无缝翻页](再次点击可恢复)">${pageNum._now}</div>`
  3206. document.body.insertAdjacentHTML('beforeend', _html);
  3207. // 点击事件(临时暂停翻页)
  3208. document.getElementById('Autopage_number').onclick = function () {
  3209. if (pausePage) {pausePage = false; GM_notification({text: `❌ 已暂停本页 [自动无缝翻页]\n (再次点击可恢复)`, timeout: 2500});} else {pausePage = true; GM_notification({text: `✅ 已恢复本页 [自动无缝翻页]\n (再次点击可暂停)`, timeout: 2500});}
  3210. };
  3211. status = document.getElementById('Autopage_number');
  3212. set();
  3213. }
  3214. // 监听储存当前页码的对象值的变化
  3215. function set(){
  3216. Object.defineProperty(pageNum, 'now', {
  3217. set: function(value) {
  3218. this._now = value;
  3219. if (status) status.textContent = value;
  3220. }
  3221. });
  3222. }
  3223. function del(){
  3224. if (!status) return
  3225. status.style.display = 'none';
  3226. }
  3227. }
  3228.  
  3229.  
  3230. // 菜单开关
  3231. function menu_switch(menu_status, Name, Tips) {
  3232. if (menu_status === true){
  3233. GM_setValue(Name, false);
  3234. } else {
  3235. GM_setValue(Name, true);
  3236. }
  3237. if (Name === 'menu_page_number') {
  3238. if (menu_status === true){pageNumber('del');} else {pageNumber('add');}
  3239. registerMenuCommand(); // 重新注册(不可用)脚本菜单
  3240. } else {
  3241. location.reload();}
  3242. };
  3243.  
  3244.  
  3245. // 生成 ID
  3246. function generateID() {
  3247. let num = 0
  3248. for (let val in DBSite) {
  3249. DBSite[val].SiteTypeID = num = num + 1;
  3250. }
  3251. }
  3252.  
  3253.  
  3254. // 判断是支持
  3255. function doesItSupport() {
  3256. setDBSite(); // 配置 DBSite 变量对象
  3257.  
  3258. // 遍历判断是否是某个已支持的网站,顺便直接赋值
  3259. let support = false;
  3260. for (let now in DBSite) { // 遍历对象
  3261. if (!DBSite[now].host) continue; // 如果不存在则继续下一个循环
  3262. if (Array.isArray(DBSite[now].host)) { // 如果是数组
  3263. for (let i of DBSite[now].host) { // 遍历数组
  3264. if (i === location.host) {
  3265. if (DBSite[now].functionStart) {
  3266. DBSite[now].functionStart();
  3267. } else {
  3268. curSite = DBSite[now];
  3269. }
  3270. support = true; break; // 如果找到了就退出循环
  3271. }
  3272. }
  3273. } else if (DBSite[now].host === location.host) {
  3274. if (DBSite[now].functionStart) {
  3275. DBSite[now].functionStart();
  3276. } else {
  3277. curSite = DBSite[now];
  3278. }
  3279. support = true; break; // 如果找到了就退出循环
  3280. }
  3281. }
  3282.  
  3283. if (!support) { // 部分域名额外判断一下
  3284. if (location.host.indexOf(DBSite.btbtt.host) > -1) { // < BT 之家 >
  3285. curSite = DBSite.btbtt;
  3286. support = true;
  3287. }
  3288. }
  3289.  
  3290. if (support) {
  3291. console.info('[自动无缝翻页] - 其他网站(独立规则)'); return 1;
  3292. } else if (document.querySelector('meta[name="author"][content*="Discuz!"], meta[name="generator"][content*="Discuz!"]') || (document.querySelector('a[href*="www.discuz.net"]') && document.querySelector('a[href*="www.discuz.net"]').textContent.indexOf('Discuz!') > -1) || (document.getElementById('ft') && document.getElementById('ft').textContent.indexOf('Discuz!') > -1)) {
  3293. console.info('[自动无缝翻页] - Discuz! 论坛'); return 2;
  3294. } else if (document.getElementById('flarum-loading')) {
  3295. console.info('[自动无缝翻页] - Flarum 论坛'); return 3;
  3296. } else if (document.querySelector('link[href*="themes/dux" i], script[src*="themes/dux" i]')) {
  3297. console.info('[自动无缝翻页] - 使用 WordPress DUX 主题的网站'); return 4;
  3298. }
  3299. return 0;
  3300. }
  3301.  
  3302.  
  3303. // 获取 Cookie
  3304. function getCookie(name) {
  3305. if (!name) return ''
  3306. let arr = document.cookie.split(';');
  3307. name += '='
  3308. for (let i=0; i<arr.length; i++) {
  3309. let now = arr[i].trim();
  3310. if (now.indexOf(name) == 0) return now.substring(name.length, now.length);
  3311. }
  3312. return '';
  3313. }
  3314.  
  3315.  
  3316. // 类型 4 专用
  3317. function getPageElems(url, type = 'text', method = 'GET', data = '', type2) {
  3318. //console.log(url, data)
  3319. let mimeType = '';
  3320. if (curSite.pager.mimeType) mimeType = curSite.pager.mimeType;
  3321. GM_xmlhttpRequest({
  3322. url: url,
  3323. method: method,
  3324. data: data,
  3325. responseType: type,
  3326. overrideMimeType: mimeType,
  3327. headers: {
  3328. "Referer": location.href,
  3329. 'Content-Type': (method === 'POST') ? 'application/x-www-form-urlencoded':''
  3330. },
  3331. timeout: 5000,
  3332. onload: function (response) {
  3333. try {
  3334. //console.log('最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  3335. switch (type) {
  3336. case 'json':
  3337. curSite.pager.insertElement(response.response, type2);
  3338. break;
  3339. default:
  3340. curSite.pager.insertElement(ShowPager.createDocumentByString(response.responseText), type2)
  3341. }
  3342. } catch (e) {
  3343. console.log(e);
  3344. }
  3345. }
  3346. });
  3347. }
  3348.  
  3349.  
  3350. // 插入位置
  3351. function addTo(num) {
  3352. switch (num) {
  3353. case 1:
  3354. return 'beforebegin'; break;
  3355. case 2:
  3356. return 'afterbegin'; break;
  3357. case 3:
  3358. return 'beforeend'; break;
  3359. case 4:
  3360. return 'afterend'; break;
  3361. }
  3362. }
  3363.  
  3364.  
  3365. // 滚动条事件
  3366. function windowScroll(fn1) {
  3367. var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  3368. fn = fn1 || function () {};
  3369. setTimeout(function () { // 延时 1 秒执行,避免刚载入到页面就触发翻页事件
  3370. window.addEventListener('scroll', function (e) {
  3371. var afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  3372. delta = afterScrollTop - beforeScrollTop;
  3373. if (delta == 0) return false;
  3374. fn(delta > 0 ? 'down' : 'up', e);
  3375. beforeScrollTop = afterScrollTop;
  3376. }, false);
  3377. }, 1000)
  3378. }
  3379.  
  3380.  
  3381. // 修改自 https://gf.qytechs.cn/scripts/14178 , https://github.com/machsix/Super-preloader
  3382. var ShowPager = {
  3383. getFullHref: function (e) {
  3384. if (e != null && e.nodeType === 1 && e.href && e.href.slice(0,4) === 'http') return e.href;
  3385. return '';
  3386. },
  3387. createDocumentByString: function (e) {
  3388. if (e) {
  3389. if ('HTML' !== document.documentElement.nodeName) return (new DOMParser).parseFromString(e, 'application/xhtml+xml');
  3390. var t;
  3391. try { t = (new DOMParser).parseFromString(e, 'text/html');} catch (e) {}
  3392. if (t) return t;
  3393. if (document.implementation.createHTMLDocument) {
  3394. t = document.implementation.createHTMLDocument('ADocument');
  3395. } else {
  3396. try {((t = document.cloneNode(!1)).appendChild(t.importNode(document.documentElement, !1)), t.documentElement.appendChild(t.createElement('head')), t.documentElement.appendChild(t.createElement('body')));} catch (e) {}
  3397. }
  3398. if (t) {
  3399. var r = document.createRange(),
  3400. n = r.createContextualFragment(e);
  3401. r.selectNodeContents(document.body);
  3402. t.body.appendChild(n);
  3403. for (var a, o = { TITLE: !0, META: !0, LINK: !0, STYLE: !0, BASE: !0}, i = t.body, s = i.childNodes, c = s.length - 1; c >= 0; c--) o[(a = s[c]).nodeName] && i.removeChild(a);
  3404. return t;
  3405. }
  3406. } else console.error('没有找到要转成 DOM 的字符串');
  3407. },
  3408. loadMorePage: function () {
  3409. if (curSite.pager) {
  3410. var url;
  3411. if (typeof curSite.pager.nextLink == 'function') {
  3412. url = curSite.pager.nextLink();
  3413. } else {
  3414. if (curSite.pager.nextLink.slice(0,4) === 'css;') {
  3415. url = this.getFullHref(getElementByCSS(curSite.pager.nextLink.slice(4)));
  3416. } else {
  3417. url = this.getFullHref(getElementByXpath(curSite.pager.nextLink));
  3418. }
  3419. }
  3420. //console.log(url, curSite.pageUrl);
  3421. if (url === '') return;
  3422. if (curSite.pageUrl === url) return;// 避免重复加载相同的页面
  3423. curSite.pageUrl = url;
  3424. let mimeType = '';
  3425. if (curSite.pager.mimeType) mimeType = curSite.pager.mimeType;
  3426. // 读取下一页的数据
  3427. GM_xmlhttpRequest({
  3428. url: url,
  3429. method: 'GET',
  3430. overrideMimeType: mimeType,
  3431. headers: {
  3432. "Referer": location.href
  3433. },
  3434. timeout: 5000,
  3435. onload: function (response) {
  3436. try {
  3437. //console.log('最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  3438. var newBody = ShowPager.createDocumentByString(response.responseText);
  3439. let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody),
  3440. toElement = getAllElements(curSite.pager.insertPosition[0])[0];
  3441. //console.log(curSite.pager.pageElement, pageElems, curSite.pager.insertPosition, toElement)
  3442.  
  3443. if (pageElems.length >= 0) {
  3444. // 如果有插入前函数就执行函数
  3445. if (curSite.function && curSite.function.before) {
  3446. if (curSite.function.parameter) { // 如果指定了参数
  3447. pageElems = curSite.function.before(curSite.function.parameter);
  3448. } else {
  3449. pageElems = curSite.function.before(pageElems);
  3450. }
  3451. }
  3452.  
  3453. // 插入位置
  3454. let addTo1 = addTo(curSite.pager.insertPosition[1]);
  3455.  
  3456. // 插入新页面元素
  3457. pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo1, one);});
  3458.  
  3459. // 当前页码 + 1
  3460. pageNum.now = pageNum._now + 1
  3461.  
  3462. // 插入 <script> 标签
  3463. if (curSite.pager.scriptType) {
  3464. let scriptText = '';
  3465. if (curSite.pager.scriptType === 1) { // 下一页的所有 <script> 标签
  3466. const scriptElems = getAllElements('//script', newBody, newBody);
  3467. scriptElems.forEach(function (one) {
  3468. if (one.src) {
  3469. toElement.appendChild(document.createElement('script')).src = one.src;
  3470. } else {
  3471. scriptText += ';' + one.textContent;
  3472. }
  3473. });
  3474. toElement.appendChild(document.createElement('script')).textContent = scriptText;
  3475. } else if (curSite.pager.scriptType === 2) { // 下一页主体元素同级 <script> 标签
  3476. pageElems.forEach(function (one) {if (one.tagName === 'SCRIPT') {scriptText += ';' + one.textContent;}});
  3477. if (scriptText) toElement.appendChild(document.createElement('script')).textContent = scriptText;
  3478. } else if (curSite.pager.scriptType === 3) { // 下一页主体元素同级 <script> 标签(远程文件)
  3479. pageElems.forEach(function (one) {if (one.tagName === 'SCRIPT' && one.src) {toElement.appendChild(document.createElement('script')).src = one.src;}});
  3480. } else if (curSite.pager.scriptType === 4) { // 下一页主体元素子元素 <script> 标签
  3481. pageElems.forEach(function (one) {
  3482. const scriptElems = one.querySelectorAll('script');
  3483. scriptElems.forEach(function (script) {scriptText += ';' + script.textContent;});
  3484. });
  3485. if (scriptText) toElement.appendChild(document.createElement('script')).textContent = scriptText;
  3486. }
  3487. }
  3488.  
  3489. // 添加历史记录
  3490. if (curSite.pager.history && curSite.pager.history == true) {
  3491. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, newBody.querySelector('title').textContent, curSite.pageUrl);
  3492. }
  3493.  
  3494. // 替换待替换元素
  3495. try {
  3496. let oriE = getAllElements(curSite.pager.replaceE),
  3497. repE = getAllElements(curSite.pager.replaceE, newBody, newBody);
  3498. //console.log(oriE, repE);
  3499. if (oriE.length === repE.length) {
  3500. for (let i = 0; i < oriE.length; i++) {
  3501. oriE[i].outerHTML = repE[i].outerHTML;
  3502. }
  3503. }
  3504. } catch (e) {
  3505. console.log(e);
  3506. }
  3507. // 如果有插入后函数就执行函数
  3508. if (curSite.function && curSite.function.after) {
  3509. if (curSite.function.parameter) { // 如果指定了参数
  3510. curSite.function.after(curSite.function.parameter);
  3511. } else {
  3512. curSite.function.after();
  3513. }
  3514. }
  3515. }
  3516. } catch (e) {
  3517. console.log(e);
  3518. }
  3519. }
  3520. });
  3521. }
  3522. },
  3523. };
  3524. function getElementByCSS(css, contextNode = document) {
  3525. return contextNode.querySelector(css);
  3526. }
  3527. function getAllElementsByCSS(css, contextNode = document) {
  3528. return [].slice.call(contextNode.querySelectorAll(css));
  3529. }
  3530. function getElementByXpath(xpath, contextNode, doc = document) {
  3531. contextNode = contextNode || doc;
  3532. try {
  3533. const result = doc.evaluate(xpath, contextNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  3534. // 应该总是返回一个元素节点
  3535. return result.singleNodeValue && result.singleNodeValue.nodeType === 1 && result.singleNodeValue;
  3536. } catch (err) {
  3537. throw new Error(`Invalid xpath: ${xpath}`);
  3538. }
  3539. }
  3540. function getAllElementsByXpath(xpath, contextNode, doc = document) {
  3541. contextNode = contextNode || doc;
  3542. const result = [];
  3543. try {
  3544. const query = doc.evaluate(xpath, contextNode, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  3545. for (let i = 0; i < query.snapshotLength; i++) {
  3546. const node = query.snapshotItem(i);
  3547. // 如果是 Element 节点
  3548. if (node.nodeType === 1) result.push(node);
  3549. }
  3550. } catch (err) {
  3551. throw new Error(`无效 Xpath: ${xpath}`);
  3552. }
  3553. return result;
  3554. }
  3555. function getAllElements(selector, contextNode = undefined, doc = document, win = window, _cplink = undefined) {
  3556. if (!selector) return [];
  3557. contextNode = contextNode || doc;
  3558. if (typeof selector === 'string') {
  3559. if (selector.search(/^css;/i) === 0) {
  3560. return getAllElementsByCSS(selector.slice(4), contextNode);
  3561. } else {
  3562. return getAllElementsByXpath(selector, contextNode, doc);
  3563. }
  3564. } else {
  3565. const query = selector(doc, win, _cplink);
  3566. if (!Array.isArray(query)) {
  3567. throw new Error('getAllElements 返回错误类型');
  3568. } else {
  3569. return query;
  3570. }
  3571. }
  3572. }
  3573.  
  3574. /*// 监听 XMLHttpRequest URL
  3575. var _send = window.XMLHttpRequest.prototype.send
  3576. function sendReplacement(data) {
  3577. console.log(data)
  3578. return _send.apply(this, arguments);
  3579. }
  3580. window.XMLHttpRequest.prototype.send = sendReplacement;
  3581. // 监听 XMLHttpRequest 模式(GET/POST)和数据
  3582. var _open = window.XMLHttpRequest.prototype.open
  3583. function openReplacement(data) {
  3584. console.log(data, arguments)
  3585. return _open.apply(this, arguments);
  3586. }
  3587. window.XMLHttpRequest.prototype.open = openReplacement;*/
  3588. })();

QingJ © 2025

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