自动无缝翻页

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

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

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