自动无缝翻页

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

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