自动无缝翻页

无缝拼接下一页内容(瀑布流),目前支持:[所有使用「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-03 提交的版本,查看 最新版本

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

QingJ © 2025

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