自动无缝翻页

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

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

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