自动无缝翻页

无缝拼接下一页内容,目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、贴吧、豆瓣、微博、NGA(玩家社区)、V2EX、看雪论坛、煎蛋网、超能网、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、小霸王其乐无穷、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、真不卡影院、片库、音范丝、BT之家、爱恋动漫、Nyaa、SrkBT、RARBG、423Down、不死鸟、小众软件、极简插件、果核剥壳、六音软件、微当下载、th-sjy 汉化、异次元软件、老殁殁漂遥、异星软件空间、动漫狂、漫画猫、漫画DB、HiComic(嗨漫画)、动漫之家、古风漫画网、砂之船动漫家、PubMed、wikiHow、GreasyFork、CS.RIN.RU、FitGirl(更多的写不下了...

当前为 2021-08-27 提交的版本,查看 最新版本

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