自动无缝翻页

无缝拼接下一页内容(瀑布流),目前支持:[所有使用「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.9
  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. // @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png
  8. // @grant GM_xmlhttpRequest
  9. // @grant GM_registerMenuCommand
  10. // @grant GM_unregisterMenuCommand
  11. // @grant GM_openInTab
  12. // @grant GM_getValue
  13. // @grant GM_setValue
  14. // @grant GM_notification
  15. // @grant unsafeWindow
  16. // @license GPL-3.0 License
  17. // @run-at document-end
  18. // @namespace https://github.com/XIU2/UserScript
  19. // @supportURL https://github.com/XIU2/UserScript
  20. // @homepageURL https://github.com/XIU2/UserScript
  21. // ==/UserScript==
  22.  
  23. (function() {
  24. 'use strict';
  25. var menuAll = [
  26. ['menu_disable', '✅ 已启用 (点击对当前网站禁用)', '❌ 已禁用 (点击对当前网站启用)', []],
  27. ['menu_discuz_thread_page', '帖子内自动翻页 (仅论坛)', '帖子内自动翻页 (仅论坛)', true],
  28. ['menu_page_number', '显示当前页码及点击暂停翻页', '显示当前页码及点击暂停翻页', true],
  29. ['menu_pause_page', '左键双击网页空白处暂停翻页', '左键双击网页空白处暂停翻页', false]
  30. ], 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'];
  31. for (let i=0;i<menuAll.length;i++){ // 如果读取到的值为 null 就写入默认值
  32. if (GM_getValue(menuAll[i][0]) == null){GM_setValue(menuAll[i][0], menuAll[i][3])};
  33. }
  34. registerMenuCommand();
  35. if (menuId.length < 2) {return}
  36. // 注册脚本菜单
  37. function registerMenuCommand() {
  38. if (menuId.length != []){
  39. for (let i=0;i<menuId.length;i++){
  40. GM_unregisterMenuCommand(menuId[i]);
  41. }
  42. }
  43. for (let i=0;i<menuAll.length;i++) { // 循环注册脚本菜单
  44. menuAll[i][3] = GM_getValue(menuAll[i][0]);
  45. if (menuAll[i][0] === 'menu_disable') { // 启用/禁用
  46.  
  47. if (menu_disable('check')) { // 当前网站在禁用列表中
  48. menuId[i] = GM_registerMenuCommand(`${menuAll[i][2]}`, function(){menu_disable('del')});
  49. return
  50. } else { // // 不在禁用列表中
  51. webType = doesItSupport(); // 判断网站类型(即是否支持),顺便直接赋值
  52. if (webType === 0) {
  53. 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});});
  54. console.info('[自动无缝翻页] - 不支持当前网站 [ ' + location.href + ' ],欢迎申请支持: https://github.com/XIU2/UserScript / https://greasyfork.org/zh-CN/scripts/96880/feedback');
  55. return
  56. } else if (webType === -1) {
  57. return
  58. }
  59. menuId[i] = GM_registerMenuCommand(`${menuAll[i][1]}`, function(){menu_disable('add')});
  60. }
  61.  
  62. } else if (menuAll[i][0] === 'menu_discuz_thread_page') { // 帖子内自动翻页 (仅论坛)
  63.  
  64. if (webType === 2 || forumWebsite.indexOf(location.host) > -1) {
  65. menuId[i] = GM_registerMenuCommand(`${menuAll[i][3]?'✅':'❌'} ${menuAll[i][1]}`, function(){menu_switch(menuAll[i][3], menuAll[i][0], menuAll[i][2])});
  66. }
  67.  
  68. } else {
  69. menuId[i] = GM_registerMenuCommand(`${menuAll[i][3]?'✅':'❌'} ${menuAll[i][1]}`, function(){menu_switch(menuAll[i][3], menuAll[i][0], menuAll[i][2])});
  70. }
  71. }
  72. menuId[menuId.length] = GM_registerMenuCommand('💬 反馈 & 欢迎申请支持', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});});
  73. }
  74.  
  75. // 网站规则
  76. function setDBSite() {
  77. /*
  78. 自动翻页规则
  79. locationchange: 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则
  80. type:
  81. 1 = 由脚本实现自动无缝翻页
  82. 2 = 网站自带了自动无缝翻页功能,只需要点击下一页按钮即可
  83. nextText: 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页)
  84. nextTextOf: 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页)
  85. nextHTML: 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页)
  86. intervals: 点击间隔时间,对于没有按钮文字变化的按钮,可以手动指定间隔时间,单位:ms
  87. 3 = 依靠元素距离可视区域底部的距离来触发翻页
  88. 4 = 部分简单的动态加载类网站(暂时)
  89. insertPosition:
  90. 1 = 插入该元素本身的前面;
  91. 2 = 插入该元素当中,第一个子元素前面;
  92. 3 = 插入该元素当中,最后一个子元素后面;
  93. 4 = 插入该元素本身的后面;
  94. mimeType: 网站编码
  95. scriptType: 单独插入 <script> 标签
  96. 1 = 下一页的所有 <script> 标签
  97. 2 = 下一页主体元素同级 <script> 标签
  98. 3 = 下一页主体元素同级 <script> 标签(远程文件)
  99. 4 = 下一页主体元素子元素 <script> 标签
  100. history: 添加历史记录 并 修改当前 URL
  101. forceHTTPS: 下一页链接强制 HTTPS
  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. forceHTTPS: true,
  1124. pageElement: 'css;.Mid2L_con > *:not(.gs_nc_editor):not(.pagecss):not(.gs_ccs_solve):not(.post_ding)',
  1125. insertPosition: ['css;.gs_nc_editor', 1],
  1126. replaceE: 'css;.page_css',
  1127. scrollElement: '.pagecss',
  1128. scrollDelta: -1000
  1129. },
  1130. function: {
  1131. before: gamersky_gl_functionBefore
  1132. }
  1133. }, // 游民星空 - 攻略
  1134. nexusmods: {
  1135. SiteTypeID: 0,
  1136. host: 'www.nexusmods.com',
  1137. pager: {
  1138. type: 4,
  1139. nextLink: nexusmods_functionNext,
  1140. pageElement: 'css;ul.tiles > li',
  1141. insertPosition: ['css;ul.tiles', 3],
  1142. insertElement: nexusmods_insertElement,
  1143. replaceE: 'css;.pagination',
  1144. scrollDelta: 3000
  1145. }
  1146. }, // NexusMods
  1147. steamcommunity: {
  1148. SiteTypeID: 0,
  1149. host: 'steamcommunity.com',
  1150. pager: {
  1151. type: 1,
  1152. nextLink: '//a[@class="pagebtn"][last()][@href]',
  1153. pageElement: 'css;.workshopBrowseItems > *',
  1154. insertPosition: ['css;.workshopBrowseItems', 3],
  1155. replaceE: 'css;.workshopBrowsePaging',
  1156. scriptType: 2,
  1157. scrollDelta: 1500
  1158. }
  1159. }, // 创意工坊 - 项目列表
  1160. yikm: {
  1161. SiteTypeID: 0,
  1162. host: 'www.yikm.net',
  1163. pager: {
  1164. type: 1,
  1165. nextLink: '//ul[@class="pager"]//a[text()="下一页"]',
  1166. pageElement: '//h2[contains(text(), "所有游戏") or contains(text(), "搜索结果")]/following-sibling::div[1]/div',
  1167. insertPosition: ['//h2[contains(text(), "所有游戏") or contains(text(), "搜索结果")]/following-sibling::div[1]', 3],
  1168. replaceE: 'css;ul.pager',
  1169. scrollDelta: 1500
  1170. }
  1171. }, // 小霸王其乐无穷
  1172. cs_rin_ru: {
  1173. SiteTypeID: 0,
  1174. host: 'cs.rin.ru',
  1175. functionStart: function() {if (location.pathname === '/forum/viewforum.php') { // 版块帖子列表
  1176. curSite = DBSite.cs_rin_ru;
  1177. } else if (location.pathname === '/forum/viewtopic.php') { // 帖子内
  1178. if (GM_getValue('menu_discuz_thread_page')) curSite = DBSite.cs_rin_ru_viewtopic;
  1179. } else if (location.pathname === '/forum/search.php') { // 搜索结果
  1180. curSite = DBSite.cs_rin_ru_search;
  1181. }},
  1182. pager: {
  1183. type: 1,
  1184. nextLink: '//td[@class="gensmall"][@align="right"]//a[text()="Next"][@href]',
  1185. pageElement: 'css;#pagecontent > table.tablebg > tbody > tr:not([align])',
  1186. insertPosition: ['css;#pagecontent > table.tablebg > tbody > tr[align]', 1],
  1187. replaceE: 'css;#pagecontent > table:first-child',
  1188. scrollDelta: 1500
  1189. },
  1190. function: {
  1191. before: cs_rin_ru_functionBefore
  1192. }
  1193. }, // cs.rin.ru - 各版块帖子列表
  1194. cs_rin_ru_viewtopic: {
  1195. SiteTypeID: 0,
  1196. pager: {
  1197. type: 1,
  1198. nextLink: 'id("pageheader")/p[@class="gensmall"]//a[text()="Next"][@href]',
  1199. pageElement: 'css;#pagecontent > table.tablebg:not(:nth-last-child(2)):not(:nth-child(2))',
  1200. insertPosition: ['css;#pagecontent > table.tablebg:nth-last-child(2)', 1],
  1201. replaceE: 'css;#pagecontent >table:not(.tablebg), #pageheader p.gensmall',
  1202. scrollDelta: 1500
  1203. }
  1204. }, // cs.rin.ru - 帖子内
  1205. cs_rin_ru_search: {
  1206. SiteTypeID: 0,
  1207. pager: {
  1208. type: 1,
  1209. nextLink: 'id("wrapcentre")/div[@class="nav"]//a[text()="Next"]',
  1210. pageElement: 'css;#wrapcentre > form > table.tablebg > tbody > tr[valign]',
  1211. insertPosition: ['css;#wrapcentre > form > table.tablebg > tbody > tr:last-child', 1],
  1212. replaceE: 'css;#wrapcentre > div',
  1213. scrollDelta: 1500
  1214. }
  1215. }, // cs.rin.ru - 搜索页
  1216. crackhub: {
  1217. SiteTypeID: 0,
  1218. host: 'crackhub.site',
  1219. 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);}';},
  1220. pager: {
  1221. type: 1,
  1222. nextLink: '//a[@class="next page-numbers"][@href]',
  1223. pageElement: 'css;article[id^="post-"]',
  1224. insertPosition: ['css;nav.paging-navigation', 1],
  1225. replaceE: 'css;nav.paging-navigation',
  1226. scrollDelta: 2000
  1227. }
  1228. },
  1229. fitgirl: {
  1230. SiteTypeID: 0,
  1231. host: 'fitgirl-repacks.site',
  1232. pager: {
  1233. type: 1,
  1234. nextLink: '//a[@class="next page-numbers"][@href]',
  1235. pageElement: 'css;article[id^="post-"]',
  1236. insertPosition: ['css;nav.paging-navigation', 1],
  1237. replaceE: 'css;nav.paging-navigation',
  1238. scrollDelta: 2000
  1239. }
  1240. },
  1241. pianku: {
  1242. SiteTypeID: 0,
  1243. host: /pianku/,
  1244. functionStart: function() {if (location.pathname != '/') {curSite = DBSite.pianku;}},
  1245. pager: {
  1246. type: 1,
  1247. nextLink: 'css;a.a1[href]',
  1248. pageElement: 'css;.content-list > li',
  1249. insertPosition: ['css;.content-list', 3],
  1250. replaceE: 'css;.pages',
  1251. scrollDelta: 1500
  1252. },
  1253. function: {
  1254. before: pianku_functionBefore
  1255. }
  1256. }, // 片库
  1257. cupfox: {
  1258. SiteTypeID: 0,
  1259. host: 'www.cupfox.com',
  1260. pager: {
  1261. type: 2,
  1262. nextLink: '.load-more',
  1263. nextText: '点击加载更多',
  1264. scrollDelta: 700
  1265. }
  1266. }, // 茶杯狐
  1267. novipnoad: {
  1268. SiteTypeID: 0,
  1269. host: 'www.novipnoad.com',
  1270. functionStart: function() {if (location.pathname != '/' && location.pathname.indexOf('.html') === -1) {curSite = DBSite.novipnoad;}},
  1271. pager: {
  1272. type: 1,
  1273. nextLink: 'css;a.nextpostslink',
  1274. pageElement: 'css;.video-listing-content .row > div',
  1275. insertPosition: ['css;.video-listing-content .row', 3],
  1276. replaceE: 'css;.wp-pagenavi',
  1277. scrollDelta: 1500
  1278. },
  1279. function: {
  1280. before: src_original_functionBefore
  1281. }
  1282. }, // NO视频
  1283. nfmovies: {
  1284. SiteTypeID: 0,
  1285. host: 'www.nfmovies.com',
  1286. functionStart: function() {if (location.pathname === '/search.php' || location.pathname.indexOf('/list/') > -1) {curSite = DBSite.nfmovies;}},
  1287. pager: {
  1288. type: 1,
  1289. nextLink: '//ul[contains(@class, "myui-page")]/li/a[contains(text(), "下一页")]',
  1290. pageElement: 'css;ul.myui-vodlist > li',
  1291. insertPosition: ['css;ul.myui-vodlist', 3],
  1292. replaceE: 'css;ul.myui-page',
  1293. scrollDelta: 1500
  1294. },
  1295. function: {
  1296. before: nfmovies_functionBefore
  1297. }
  1298. }, // 奈菲影视
  1299. ddrk: {
  1300. SiteTypeID: 0,
  1301. host: 'ddrk.me',
  1302. functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/category/') > -1 || location.pathname.indexOf('/tag/') > -1) {curSite = DBSite.ddrk;}},
  1303. pager: {
  1304. type: 1,
  1305. nextLink: 'css;a.next',
  1306. pageElement: 'css;.post-box-list > article',
  1307. insertPosition: ['css;.post-box-list', 3],
  1308. replaceE: 'css;.pagination_wrap',
  1309. scrollDelta: 1500
  1310. }
  1311. }, // 低端影视
  1312. zxzj: {
  1313. SiteTypeID: 0,
  1314. host: 'www.zxzj.me',
  1315. functionStart: function() {if (location.pathname != '/' && location.pathname.indexOf('/detail/') === -1) {
  1316. curSite = DBSite.zxzj; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'div.stui-page__all {display: none !important;}';
  1317. }},
  1318. pager: {
  1319. type: 1,
  1320. nextLink: '//ul[contains(@class, "stui-page__item")]//a[contains(text(), "下一页")]',
  1321. pageElement: 'css;ul.stui-vodlist > li',
  1322. insertPosition: ['css;ul.stui-vodlist', 3],
  1323. replaceE: 'css;ul.stui-page__item',
  1324. scrollDelta: 1000
  1325. },
  1326. function: {
  1327. before: nfmovies_functionBefore
  1328. }
  1329. }, // 在线之家
  1330. zhenbuka: {
  1331. SiteTypeID: 0,
  1332. host: ['www.zhenbuka3.com', 'www.zhenbuka5.com'],
  1333. functionStart: function() {if (location.pathname.indexOf('/vodtype/') > -1) {curSite = DBSite.zhenbuka;}},
  1334. pager: {
  1335. type: 1,
  1336. nextLink: '//ul[contains(@class, "stui-page")]/li/a[contains(text(), "下一页")]',
  1337. pageElement: 'css;ul.stui-vodlist > li',
  1338. insertPosition: ['css;ul.stui-vodlist', 3],
  1339. replaceE: 'css;ul.stui-page',
  1340. scrollDelta: 1500
  1341. },
  1342. function: {
  1343. before: nfmovies_functionBefore
  1344. }
  1345. }, // 真不卡影院
  1346. _91mjw: {
  1347. SiteTypeID: 0,
  1348. host: '91mjw.com',
  1349. functionStart: function() {if (location.pathname.indexOf('/video/') === -1 || location.pathname.indexOf('/vplay/') === -1) {curSite = DBSite._91mjw;}},
  1350. pager: {
  1351. type: 1,
  1352. nextLink: 'css;.next-page > a',
  1353. pageElement: 'css;.m-movies > article',
  1354. insertPosition: ['css;.pagination', 1],
  1355. replaceE: 'css;.pagination',
  1356. scrollDelta: 1500
  1357. },
  1358. function: {
  1359. before: src_original_functionBefore
  1360. }
  1361. }, // 91 美剧网
  1362. dm233: {
  1363. SiteTypeID: 0,
  1364. host: 'www.dm233.cc',
  1365. functionStart: function() {if (location.pathname.indexOf('/catalog/') > -1 || location.pathname === '/recommend/' || location.pathname === '/search') {
  1366. curSite = DBSite.dm233;
  1367. } else if (location.pathname === '/article/') {
  1368. curSite = DBSite.dm233_article;
  1369. } else if (location.pathname === '/rank/') {
  1370. curSite = DBSite.dm233_rank;
  1371. }},
  1372. pager: {
  1373. type: 1,
  1374. nextLink: '//div[@class="pagelist"]//a[contains(text(), "下一页") or contains(text(), "下一頁")]',
  1375. pageElement: 'css;.dhnew ul > li',
  1376. insertPosition: ['css;.dhnew ul', 3],
  1377. replaceE: 'css;.pagelist',
  1378. scrollDelta: 1000
  1379. }
  1380. }, // 233 动漫
  1381. dm233_article: {
  1382. SiteTypeID: 0,
  1383. pager: {
  1384. type: 1,
  1385. nextLink: '//div[@class="pagelist"]//a[contains(text(), "下一页") or contains(text(), "下一頁")]',
  1386. pageElement: 'css;.xgyd ul > li',
  1387. insertPosition: ['css;.xgyd ul', 3],
  1388. replaceE: 'css;.pagelist',
  1389. scrollDelta: 1000
  1390. }
  1391. }, // 233 动漫 - 动漫情报/资讯
  1392. dm233_rank: {
  1393. SiteTypeID: 0,
  1394. pager: {
  1395. type: 1,
  1396. nextLink: '//div[@class="pagelist"]//a[contains(text(), "下一页") or contains(text(), "下一頁")]',
  1397. pageElement: 'css;.side-update.normal-wai > .normal-nei',
  1398. insertPosition: ['css;.side-update.normal-wai', 3],
  1399. replaceE: 'css;.pagelist',
  1400. scrollDelta: 1000
  1401. }
  1402. }, // 233 动漫 - 排行榜
  1403. agefans: {
  1404. SiteTypeID: 0,
  1405. host: 'www.agefans.cc',
  1406. functionStart: function() {if (location.pathname.indexOf('/catalog/') > -1 || location.pathname === '/search') {
  1407. curSite = DBSite.agefans;
  1408. } else if (location.pathname === '/recommend' || location.pathname === '/update') {
  1409. curSite = DBSite.agefans_;
  1410. } else if (location.pathname === '/rank') {
  1411. curSite = DBSite.agefans_rank;
  1412. }},
  1413. pager: {
  1414. type: 1,
  1415. nextLink: 'id("container")//div[@class="blockcontent"]/div[@style][not(@class)]/li/a[@href][contains(text(), "下一页")]',
  1416. pageElement: 'css;#container .blockcontent1 > div',
  1417. insertPosition: ['css;#container .blockcontent1', 3],
  1418. replaceE: 'css;#container .blockcontent > div[style]:not([class])',
  1419. scrollDelta: 1000
  1420. }
  1421. }, // AGE 动漫 - 全部/搜索
  1422. agefans_: {
  1423. SiteTypeID: 0,
  1424. pager: {
  1425. type: 1,
  1426. nextLink: 'id("container")//div[@class="blockcontent"]/div[@style][not(@class)]/li/a[@href][contains(text(), "下一页")]',
  1427. pageElement: 'css;#container .blockcontent > ul > li',
  1428. insertPosition: ['css;#container .blockcontent > ul', 3],
  1429. replaceE: 'css;#container .blockcontent > div[style]:not([class])',
  1430. scrollDelta: 1000
  1431. }
  1432. }, // AGE 动漫 - 其他页
  1433. agefans_rank: {
  1434. SiteTypeID: 0,
  1435. pager: {
  1436. type: 1,
  1437. nextLink: 'id("container")/ul[@style][not(@class)]/li/a[@href][contains(text(), "下一页")]',
  1438. pageElement: 'css;#container > .div_right .blockcontent.div_right_r_3 > ul',
  1439. insertPosition: ['css;#container > .div_right .blockcontent.div_right_r_3', 3],
  1440. replaceE: 'css;#container > ul[style]:not([class])',
  1441. scrollDelta: 1000
  1442. }
  1443. }, // AGE 动漫 - 排行榜
  1444. yhdm: {
  1445. SiteTypeID: 0,
  1446. host: 'www.imomoe.la',
  1447. functionStart: function() {if (location.pathname.indexOf('/list/') > -1) {
  1448. curSite = DBSite.yhdm;
  1449. } else if (location.pathname === '/so.asp' || location.pathname === '/search.asp') {
  1450. curSite = DBSite.yhdm_;
  1451. }},
  1452. pager: {
  1453. type: 1,
  1454. nextLink: '//div[@class="pages"]/a[@href][contains(text(), "下一页")]',
  1455. pageElement: 'css;#contrainer > .img> ul > li',
  1456. insertPosition: ['css;#contrainer > .img> ul', 3],
  1457. replaceE: 'css;.pages',
  1458. mimeType: 'text/html; charset=gb2312',
  1459. scrollDelta: 1000
  1460. }
  1461. }, // 樱花动漫
  1462. yhdm_: {
  1463. SiteTypeID: 0,
  1464. pager: {
  1465. type: 1,
  1466. nextLink: '//div[@class="pages"]/a[@href][contains(text(), "下一页")]',
  1467. pageElement: 'css;#contrainer .fire .pics > ul > li',
  1468. insertPosition: ['css;#contrainer .fire .pics > ul', 3],
  1469. replaceE: 'css;.pages',
  1470. mimeType: 'text/html; charset=gb2312',
  1471. scrollDelta: 1000
  1472. }
  1473. }, // 樱花动漫 - 搜索页等
  1474. zzzfun: {
  1475. SiteTypeID: 0,
  1476. host: 'www.zzzfun.com',
  1477. functionStart: function() {
  1478. if (location.pathname.indexOf('/vod_type') > -1 || location.pathname.indexOf('/vod_show') > -1) {
  1479. curSite = DBSite.zzzfun;
  1480. } else if (location.pathname.indexOf('/vod_search') > -1) {
  1481. curSite = DBSite.zzzfun_search;
  1482. }},
  1483. pager: {
  1484. type: 1,
  1485. nextLink: 'css;#page a[title="下一页"]',
  1486. pageElement: 'css;ul.search-result > a',
  1487. insertPosition: ['css;ul.search-result', 3],
  1488. replaceE: 'css;#page',
  1489. scrollDelta: 1000
  1490. },
  1491. function: {
  1492. before: src_original_functionBefore
  1493. }
  1494. }, // ZzzFun 动漫
  1495. zzzfun_search: {
  1496. SiteTypeID: 0,
  1497. pager: {
  1498. type: 1,
  1499. nextLink: 'css;#page a[title="下一页"]',
  1500. pageElement: 'css;ul.show-list > li',
  1501. insertPosition: ['css;ul.show-list', 3],
  1502. replaceE: 'css;#page',
  1503. scrollDelta: 1000
  1504. },
  1505. function: {
  1506. before: src_original_functionBefore
  1507. }
  1508. }, // ZzzFun 动漫 - 搜索页
  1509. yinfans: {
  1510. SiteTypeID: 0,
  1511. host: 'www.yinfans.net',
  1512. 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;}';},
  1513. pager: {
  1514. type: 1,
  1515. nextLink: 'css;a.next[href]',
  1516. pageElement: 'css;#post_container > li',
  1517. insertPosition: ['css;#post_container', 3],
  1518. replaceE: 'css;.pagination',
  1519. scrollDelta: 1500
  1520. }
  1521. }, // 音范丝
  1522. btbtt: {
  1523. SiteTypeID: 0,
  1524. host: /btbtt/,
  1525. pager: {
  1526. type: 1,
  1527. nextLink: '//div[@class="page"]/a[contains(text(), "▶") or contains(text(), "下一页")]',
  1528. pageElement: 'css;#threadlist > table, #threadlist > hr',
  1529. insertPosition: ['css;#threadlist', 3],
  1530. replaceE: 'css;.page',
  1531. scrollDelta: 2000
  1532. }
  1533. }, // BT 之家
  1534. bdys: {
  1535. SiteTypeID: 0,
  1536. host: 'www.bd2020.com',
  1537. functionStart: function() {if (location.pathname != '/' && !(/\/\d+\.htm/.test(location.pathname))) {curSite = DBSite.bdys;}},
  1538. pager: {
  1539. type: 2,
  1540. nextLink: 'div.layui-flow-more > a',
  1541. nextText: '加载更多',
  1542. scrollDelta: 1000
  1543. }
  1544. }, // BD 影视
  1545. gaoqing_fm: {
  1546. SiteTypeID: 0,
  1547. host: 'gaoqing.fm',
  1548. pager: {
  1549. type: 2,
  1550. nextLink: '.col-md-12 > a[href], #loadmore > a[href]',
  1551. intervals: 1500,
  1552. scrollDelta: 1000
  1553. }
  1554. }, // 高清电台
  1555. yyds: {
  1556. SiteTypeID: 0,
  1557. host: 'yyds.fans',
  1558. functionStart: function() {
  1559. if (location.search != '' && location.search.indexOf('p=') === -1) {
  1560. curSite = DBSite.yyds;
  1561. }},
  1562. pager: {
  1563. type: 1,
  1564. nextLink: 'css;a.next.page-numbers[href]',
  1565. pageElement: 'css;.list-grouped > div',
  1566. insertPosition: ['css;.list-grouped', 3],
  1567. replaceE: 'css;nav.pagination',
  1568. scrollDelta: 1100
  1569. }
  1570. }, // YYDS 电影
  1571. kisssub: {
  1572. SiteTypeID: 0,
  1573. host: 'www.kisssub.org',
  1574. pager: {
  1575. type: 1,
  1576. nextLink: 'css;a.nextprev',
  1577. pageElement: 'css;#data_list > tr',
  1578. insertPosition: ['css;#data_list', 3],
  1579. replaceE: 'css;.pages',
  1580. scrollDelta: 2500
  1581. }
  1582. }, // 爱恋动漫
  1583. dmhy: {
  1584. SiteTypeID: 0,
  1585. host: ['share.dmhy.org', 'dmhy.anoneko.com'],
  1586. pager: {
  1587. type: 1,
  1588. nextLink: '//div[@class="nav_title"]/a[@href][contains(text(), "下一頁")]',
  1589. pageElement: 'css;#topic_list > tbody > tr',
  1590. insertPosition: ['css;#topic_list > tbody', 3],
  1591. replaceE: 'css;.nav_title',
  1592. scrollDelta: 1500
  1593. },
  1594. function: {
  1595. 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');`;}
  1596. }
  1597. }, // 动漫花园
  1598. futaacg: {
  1599. SiteTypeID: 0,
  1600. host: 'futaacg.com',
  1601. pager: {
  1602. type: 1,
  1603. nextLink: 'css;ul.pagination a[rel="next"]',
  1604. pageElement: 'css;.topic-list > div',
  1605. insertPosition: ['css;.topic-list', 3],
  1606. replaceE: 'css;ul.pagination',
  1607. scrollDelta: 1500
  1608. }
  1609. }, // 扶她动漫
  1610. bangumi: {
  1611. SiteTypeID: 0,
  1612. host: 'bangumi.moe',
  1613. pager: {
  1614. type: 2,
  1615. nextLink: '[torrent-list="lattorrents"] button[ng-click="loadMore()"] ,[torrent-list="torrents"] button[ng-click="loadMore()"]',
  1616. intervals: 1000,
  1617. scrollDelta: 1500
  1618. }
  1619. }, // 萌番组
  1620. nyaa: {
  1621. SiteTypeID: 0,
  1622. host: 'nyaa.si',
  1623. pager: {
  1624. type: 1,
  1625. nextLink: '//a[@rel="next"][@href] | //li[@class="next"]/a[@href]',
  1626. pageElement: 'css;table.torrent-list > tbody > tr',
  1627. insertPosition: ['css;table.torrent-list > tbody', 3],
  1628. replaceE: 'css;ul.pagination',
  1629. scrollDelta: 2000
  1630. }
  1631. }, // Nyaa
  1632. skrbt: {
  1633. SiteTypeID: 0,
  1634. host: /skrbt/,
  1635. functionStart: function() {if (location.pathname === '/search') curSite = DBSite.skrbt;},
  1636. pager: {
  1637. type: 1,
  1638. nextLink: skrbt_functionNext,
  1639. pageElement: 'css;div[class="row"] > .col-md-6 > ul',
  1640. insertPosition: ['css;nav[aria-label*="Page"]', 1],
  1641. replaceE: 'css;ul.pagination',
  1642. scrollDelta: 900
  1643. }
  1644. }, // SkrBT
  1645. rarbgprx: {
  1646. SiteTypeID: 0,
  1647. host: /rarbg/,
  1648. functionStart: function() {if (location.pathname === '/torrents.php') {curSite = DBSite.rarbgprx;}},
  1649. pager: {
  1650. type: 1,
  1651. nextLink: '(//a[@title="next page"])[1][@href]',
  1652. pageElement: 'css;table.lista2t tr.lista2',
  1653. insertPosition: ['css;table.lista2t > tbody', 3],
  1654. replaceE: 'css;#pager_links',
  1655. scrollDelta: 1000
  1656. }
  1657. }, // RARBG
  1658. subdh: {
  1659. SiteTypeID: 0,
  1660. host: 'subdh.com',
  1661. functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/list/new') > -1) {
  1662. curSite = DBSite.subdh;
  1663. } else if (location.pathname.indexOf('/search') > -1) {
  1664. curSite = DBSite.subdh_search;
  1665. }},
  1666. pager: {
  1667. type: 1,
  1668. nextLink: '//a[@class="page-link"][contains(text(), "下一页")]',
  1669. pageElement: 'css;.col-lg-9 .bg-white.shadow-sm.rounded-3 > .row.gx-0',
  1670. insertPosition: ['css;.col-lg-9 .bg-white.shadow-sm.rounded-3', 3],
  1671. replaceE: 'css;ul.pagination',
  1672. scrollDelta: 1000
  1673. }
  1674. }, // SubDH
  1675. subdh_search: {
  1676. SiteTypeID: 0,
  1677. pager: {
  1678. type: 1,
  1679. nextLink: '//a[@class="page-link"][contains(text(), "下一页")]',
  1680. pageElement: 'css;.col-lg-9 .bg-white.shadow-sm.rounded-3',
  1681. insertPosition: ['css;nav[aria-label="pagination"]', 1],
  1682. replaceE: 'css;ul.pagination',
  1683. scrollDelta: 1000
  1684. }
  1685. }, // SubDH - 搜索页
  1686. mini4k: {
  1687. SiteTypeID: 0,
  1688. host: 'www.mini4k.com',
  1689. functionStart: function() {if (location.pathname != '/' && !(/\/\d{3,}/.test(location.pathname))) {curSite = DBSite.mini4k;};},
  1690. pager: {
  1691. type: 1,
  1692. nextLink: 'css;a.pager__item--next[href]',
  1693. pageElement: 'css;div[class*="-item-list"] > ul > li',
  1694. insertPosition: ['css;div[class*="-item-list"] > ul', 3],
  1695. replaceE: 'css;.pagination',
  1696. scrollDelta: 2000
  1697. }
  1698. }, // MINI4K
  1699. bthaha: {
  1700. SiteTypeID: 0,
  1701. host: /bthaha/,
  1702. functionStart: function() {if (location.pathname.indexOf('/search/') > -1) {
  1703. curSite = DBSite.bthaha;
  1704. document.lastElementChild.appendChild(document.createElement('style')).textContent = '[id^="list_top"], [id^="list_bottom"] {display: none !important;}';
  1705. document.querySelectorAll('[id^="list_top"], [id^="list_bottom"]').forEach(function (one) {one.parentElement.parentElement.hidden = true;});
  1706. }},
  1707. pager: {
  1708. type: 1,
  1709. nextLink: '//ul[@class="pagination"]/li/a[contains(text(), "下一页")]',
  1710. pageElement: 'css;table.table > tbody > tr',
  1711. insertPosition: ['css;table.table > tbody', 3],
  1712. replaceE: 'css;ul.pagination',
  1713. scrollDelta: 1000
  1714. },
  1715. function: {
  1716. before: bthaha_functionBefore
  1717. }
  1718. }, // BTHaha
  1719. a4k: {
  1720. SiteTypeID: 0,
  1721. host: 'www.a4k.net',
  1722. functionStart: function() {if (location.pathname.indexOf('/subtitle/') === -1) {curSite = DBSite.a4k;};},
  1723. pager: {
  1724. type: 1,
  1725. nextLink: 'css;a.pager__item--next[href]',
  1726. pageElement: 'css;ul.list > li',
  1727. insertPosition: ['css;ul.list', 3],
  1728. replaceE: 'css;.pagination',
  1729. scrollDelta: 1000
  1730. }
  1731. }, // A4k 字幕网(字幕)
  1732. assrt: {
  1733. SiteTypeID: 0,
  1734. host: 'assrt.net',
  1735. functionStart: function() {if (location.pathname != '/') {curSite = DBSite.assrt;};},
  1736. pager: {
  1737. type: 1,
  1738. nextLink: assrt_functionNext,
  1739. pageElement: 'css;.resultcard > div:not(#top-banner):not(#bottom-banner)',
  1740. insertPosition: ['css;.pagelinkcard', 1],
  1741. replaceE: 'css;.pagelinkcard',
  1742. scrollDelta: 1000
  1743. }
  1744. }, // 射手网(字幕)
  1745. subhd: {
  1746. SiteTypeID: 0,
  1747. host: 'subhd.tv',
  1748. functionStart: function() {if (location.pathname === '/forum/forum') {
  1749. curSite = DBSite.subhd_forum;
  1750. } else if (location.pathname != '/' && location.pathname != '/zu' && location.pathname.indexOf('/a/') === -1 && location.pathname.indexOf('/d/') === -1 && location.pathname.indexOf('/forum/') === -1) {
  1751. curSite = DBSite.subhd;
  1752. }},
  1753. pager: {
  1754. type: 1,
  1755. nextLink: '//a[@class="page-link"][contains(text(), "下一页")]',
  1756. pageElement: 'css;.bg-white.shadow-sm.rounded-3',
  1757. insertPosition: ['css;nav.clearfix', 1],
  1758. replaceE: 'css;nav.clearfix',
  1759. scrollDelta: 1000
  1760. }
  1761. }, // SubHD(字幕)
  1762. subhd_forum: {
  1763. SiteTypeID: 0,
  1764. pager: {
  1765. type: 1,
  1766. nextLink: '//a[@class="page-link"][contains(text(), "下一页")]',
  1767. pageElement: 'css;.bg-white.shadow-sm.rounded-3 > div',
  1768. insertPosition: ['css;.bg-white.shadow-sm.rounded-3', 3],
  1769. replaceE: 'css;nav.clearfix',
  1770. scrollDelta: 800
  1771. }
  1772. }, // SubHD - forum(字幕)
  1773. baoshuu: {
  1774. SiteTypeID: 0,
  1775. host: 'www.baoshuu.com',
  1776. functionStart: function() {if (location.pathname.indexOf('/TXT/list') > -1) curSite = DBSite.baoshuu;},
  1777. pager: {
  1778. type: 1,
  1779. nextLink: '//div[@class="listl2"]//a[@href][text()="下一页"]',
  1780. pageElement: 'css;.listl2 > ul > li',
  1781. insertPosition: ['css;.listl2 > ul', 3],
  1782. replaceE: 'css;listl2 > dl',
  1783. mimeType: 'text/html; charset=gb2312',
  1784. scrollDelta: 900
  1785. }
  1786. }, // 宝书网(小说)
  1787. baoshuu_m: {
  1788. SiteTypeID: 0,
  1789. host: 'm.baoshuu.com',
  1790. functionStart: function() {if (location.pathname.indexOf('/TXT/list') > -1) curSite = DBSite.baoshuu_m;},
  1791. pager: {
  1792. type: 1,
  1793. nextLink: '//div[@class="man_first"]//a[@href][text()="下一页"]',
  1794. pageElement: 'css;.man_first > ul > li',
  1795. insertPosition: ['css;.man_first > ul', 3],
  1796. replaceE: 'css;.man_first > dl',
  1797. mimeType: 'text/html; charset=gb2312',
  1798. scrollDelta: 900
  1799. }
  1800. }, // 宝书网(小说)- 手机版
  1801. qidian: {
  1802. SiteTypeID: 0,
  1803. host: 'www.qidian.com',
  1804. functionStart: function() {if (location.pathname.indexOf('/all/') > -1) {curSite = DBSite.qidian;}},
  1805. pager: {
  1806. type: 1,
  1807. nextLink: 'css;a[class*="pagination-next"][href]',
  1808. pageElement: 'css;ul.all-img-list > li',
  1809. insertPosition: ['css;ul.all-img-list', 3],
  1810. replaceE: 'css;#page-container',
  1811. scrollDelta: 900
  1812. }
  1813. }, // 起点小说
  1814. qidian_read: {
  1815. SiteTypeID: 0,
  1816. host: 'read.qidian.com',
  1817. functionStart: function() {if (location.pathname.indexOf('/chapter/') > -1) {curSite = DBSite.qidian_read; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.admire-wrap {display: none !important;}';}},
  1818. pager: {
  1819. type: 1,
  1820. nextLink: 'css;a[id$="chapterNext"][href]',
  1821. pageElement: 'css;.main-text-wrap > div:not(.admire-wrap)',
  1822. insertPosition: ['css;.main-text-wrap', 3],
  1823. replaceE: 'css;.chapter-control, title',
  1824. history: true,
  1825. scrollDelta: 900
  1826. }
  1827. }, // 起点小说 - 阅读页
  1828. linovel: {
  1829. SiteTypeID: 0,
  1830. host: 'www.linovel.net',
  1831. functionStart: function() {if (/\/book\/\d+\/.+\.html/.test(location.pathname)) {
  1832. document.lastElementChild.appendChild(document.createElement('style')).textContent = '.reward-section {display: none !important;}';
  1833. } else if (location.pathname.indexOf('/cat/') > -1) {
  1834. curSite = DBSite.linovel;
  1835. }},
  1836. pager: {
  1837. type: 1,
  1838. nextLink: '//ul[@class="pagination"]/li/a[contains(text(), "下一页")]',
  1839. pageElement: 'css;.rank-book-list > div',
  1840. insertPosition: ['css;.rank-book-list', 3],
  1841. replaceE: 'css;ul.pagination',
  1842. scrollDelta: 1000
  1843. }
  1844. }, // 轻之文库
  1845. linovelib: {
  1846. SiteTypeID: 0,
  1847. host: 'www.linovelib.com',
  1848. functionStart: function() {if (/\/novel\/\d+\/.+\.html/.test(location.pathname)) {
  1849. curSite = DBSite.linovelib;
  1850. } else if (location.pathname.indexOf('/wenku/') > -1) {
  1851. curSite = DBSite.linovelib_wenku;
  1852. } else if (location.pathname.indexOf('/top/') > -1 || location.pathname.indexOf('/topfull/') > -1 || location.pathname.indexOf('toplist.php') > -1) {
  1853. curSite = DBSite.linovelib_top;
  1854. }},
  1855. pager: {
  1856. type: 1,
  1857. nextLink: '//p[@class="mlfy_page"]/a[@href][contains(text(), "下一页") or contains(text(), "下一章")]',
  1858. pageElement: 'css;#mlfy_main_text > *',
  1859. insertPosition: ['css;#mlfy_main_text', 3],
  1860. replaceE: 'css;p.mlfy_page, head > title',
  1861. history: true,
  1862. scrollDelta: 1000
  1863. }
  1864. }, // 哔哩轻小说
  1865. linovelib_wenku: {
  1866. SiteTypeID: 0,
  1867. pager: {
  1868. type: 1,
  1869. nextLink: 'css;#pagelink > a.next[href]',
  1870. pageElement: 'css;.store_collist > div.bookbox',
  1871. insertPosition: ['css;.store_collist', 3],
  1872. replaceE: 'css;#pagelink',
  1873. scrollDelta: 1000
  1874. },
  1875. function: {
  1876. before: src_original_functionBefore
  1877. }
  1878. }, // 哔哩轻小说 - 文库
  1879. linovelib_top: {
  1880. SiteTypeID: 0,
  1881. pager: {
  1882. type: 1,
  1883. nextLink: 'css;#pagelink > a.next[href]',
  1884. pageElement: 'css;.rankpage_box > div.rank_d_list',
  1885. insertPosition: ['css;div.pages', 1],
  1886. replaceE: 'css;#pagelink',
  1887. scrollDelta: 1000
  1888. },
  1889. function: {
  1890. before: src_original_functionBefore
  1891. }
  1892. }, // 哔哩轻小说 - 全本
  1893. _423down: {
  1894. SiteTypeID: 0,
  1895. host: 'www.423down.com',
  1896. functionStart: function() {if (location.pathname.indexOf('.html') === -1) curSite = DBSite._423down;},
  1897. pager: {
  1898. type: 1,
  1899. nextLink: '//div[@class="paging"]//a[contains(text(),"下一页")][@href]',
  1900. pageElement: 'css;div.content-wrap ul.excerpt > li',
  1901. insertPosition: ['css;div.content-wrap ul.excerpt', 3],
  1902. replaceE: 'css;div.paging',
  1903. scrollDelta: 1500
  1904. }
  1905. },
  1906. iao_su: {
  1907. SiteTypeID: 0,
  1908. host: 'iao.su',
  1909. pager: {
  1910. type: 1,
  1911. nextLink: '//li[@class="btn btn-primary next"]//a[@href]',
  1912. pageElement: 'css;#index > article, #archive > article',
  1913. insertPosition: ['css;ol.page-navigator', 1],
  1914. replaceE: 'css;ol.page-navigator',
  1915. scrollDelta: 1000
  1916. },
  1917. function: {
  1918. before: iao_su_functionBefore
  1919. }
  1920. }, // 不死鸟
  1921. sharerw: {
  1922. SiteTypeID: 0,
  1923. host: 'www.sharerw.com',
  1924. functionStart: function() {if (location.pathname.indexOf('.html') === -1) {
  1925. if (location.pathname === '/search.php') {curSite = DBSite.sharerw_search;} else {curSite = DBSite.sharerw;};};},
  1926. pager: {
  1927. type: 1,
  1928. nextLink: 'css;span.next > a[href]',
  1929. pageElement: 'css;.new-post > article',
  1930. insertPosition: ['css;.new-post', 3],
  1931. replaceE: 'css;.pagebar',
  1932. scrollDelta: 1500
  1933. }
  1934. }, // 分享者
  1935. sharerw_search: {
  1936. SiteTypeID: 0,
  1937. pager: {
  1938. type: 1,
  1939. nextLink: 'css;span.next > a[href]',
  1940. pageElement: 'css;#mainbox > article',
  1941. insertPosition: ['css;.pagebar', 1],
  1942. replaceE: 'css;.pagebar',
  1943. scrollDelta: 1500
  1944. }
  1945. }, // 分享者 - 搜索页
  1946. extfans: {
  1947. SiteTypeID: 0,
  1948. host: 'www.extfans.com',
  1949. functionStart: function() {if (location.pathname != '/') {curSite = DBSite.extfans;}},
  1950. pager: {
  1951. type: 1,
  1952. nextLink: 'css;.page a[data-page="next"]',
  1953. pageElement: 'css;.side-left > ul[class*="-list"] > li',
  1954. insertPosition: ['css;.side-left > ul[class*="-list"]', 3],
  1955. replaceE: 'css;.page',
  1956. scrollDelta: 2000
  1957. }
  1958. }, // 扩展迷
  1959. chrome_zzzmh: {
  1960. SiteTypeID: 0,
  1961. host: 'chrome.zzzmh.cn',
  1962. pager: {
  1963. type: 2,
  1964. nextLink: 'button.more-btn',
  1965. intervals: 1000,
  1966. scrollDelta: 1500
  1967. }
  1968. }, // 极简插件
  1969. appinn: {
  1970. SiteTypeID: 0,
  1971. host: 'www.appinn.com',
  1972. pager: {
  1973. type: 1,
  1974. nextLink: '//a[@class="next page-numbers"][@href]',
  1975. pageElement: 'css;section#latest-posts > article',
  1976. insertPosition: ['css;nav.navigation.pagination', 1],
  1977. replaceE: 'css;div.nav-links',
  1978. scrollDelta: 1500
  1979. }
  1980. }, // 小众软件
  1981. isharepc: {
  1982. SiteTypeID: 0,
  1983. host: 'www.isharepc.com',
  1984. pager: {
  1985. type: 1,
  1986. nextLink: 'css;a.next[href]',
  1987. pageElement: 'css;.content > div',
  1988. insertPosition: ['css;nav.pagination', 1],
  1989. replaceE: 'css;nav.pagination',
  1990. scrollDelta: 1000
  1991. }
  1992. }, // 乐软博客
  1993. pc521: {
  1994. SiteTypeID: 0,
  1995. host: 'www.pc521.net',
  1996. functionStart: function() {if (location.search.slice(0,3) === '?s=') {curSite = DBSite.pc521_search;} else {curSite = DBSite.pc521;}},
  1997. pager: {
  1998. type: 2,
  1999. nextLink: 'div[id^="ias_trigger_"]',
  2000. intervals: 1000,
  2001. scrollDelta: 1000
  2002. }
  2003. }, // 不忘初心
  2004. pc521_search: {
  2005. SiteTypeID: 0,
  2006. pager: {
  2007. type: 1,
  2008. nextLink: 'css;a.next[href]',
  2009. pageElement: 'css;#main > ul > li',
  2010. insertPosition: ['css;#main > ul', 3],
  2011. replaceE: 'css;nav.pagination',
  2012. scrollDelta: 1500
  2013. }
  2014. }, // 不忘初心 - 搜索页
  2015. ghxi: {
  2016. SiteTypeID: 0,
  2017. host: 'www.ghxi.com',
  2018. functionStart: function() {if (location.pathname === '/' && !location.search) {curSite = DBSite.ghxi;} else {curSite = DBSite.ghxi_postlist;}},
  2019. pager: {
  2020. type: 2,
  2021. nextLink: '.load-more',
  2022. intervals: 1000,
  2023. scrollDelta: 5000
  2024. }
  2025. }, // 果核剥壳 - 首页
  2026. ghxi_postlist: {
  2027. SiteTypeID: 0,
  2028. pager: {
  2029. type: 1,
  2030. nextLink: 'css;a.next[href]',
  2031. pageElement: 'css;ul.post-loop > li',
  2032. insertPosition: ['css;ul.post-loop', 3],
  2033. replaceE: 'css;ul.pagination',
  2034. scrollDelta: 1500
  2035. },
  2036. function: {
  2037. before: src_original_functionBefore
  2038. }
  2039. }, // 果核剥壳 - 分类/搜索页
  2040. sixyin: {
  2041. SiteTypeID: 0,
  2042. host: 'www.sixyin.com',
  2043. functionStart: function() {if (location.pathname === '/' && location.search === '') { // 首页
  2044. curSite = DBSite.sixyin;
  2045. } else if (location.pathname.indexOf('.html') === -1) { // 分类页
  2046. curSite = DBSite.sixyin_postlist;
  2047. }},
  2048. pager: {
  2049. type: 2,
  2050. nextLink: '.load-more',
  2051. nextHTML: '点击查看更多',
  2052. scrollDelta: 1500
  2053. }
  2054. }, // 六音软件 - 首页
  2055. sixyin_postlist: {
  2056. SiteTypeID: 0,
  2057. pager: {
  2058. type: 1,
  2059. nextLink: '//a[@class="next"][@href]',
  2060. pageElement: 'css;ul.post-loop > li',
  2061. insertPosition: ['css;ul.post-loop', 3],
  2062. replaceE: 'css;ul.pagination',
  2063. scrollDelta: 1500
  2064. }
  2065. }, // 六音软件 - 分类页
  2066. weidown: {
  2067. SiteTypeID: 0,
  2068. host: 'www.weidown.com',
  2069. functionStart: function() {if (location.pathname.indexOf('/search/') > -1) { //搜索页
  2070. curSite = DBSite.weidown_search;
  2071. } else if (location.pathname.indexOf('/special/') > -1) { // 专题页
  2072. curSite = DBSite.weidown_special;
  2073. } else {
  2074. curSite = DBSite.weidown;
  2075. }},
  2076. pager: {
  2077. type: 1,
  2078. nextLink: '//a[@class="nextpage"][@href]',
  2079. pageElement: 'css;.articleWrapper > .itemArticle, .articleWrapper > .richTextItem.search',
  2080. insertPosition: ['css;.articleWrapper', 3],
  2081. replaceE: 'css;#pageGroup',
  2082. scrollDelta: 1500
  2083. }
  2084. }, // 微当下载
  2085. weidown_search: {
  2086. SiteTypeID: 0,
  2087. pager: {
  2088. type: 1,
  2089. nextLink: '//a[@class="nextpage"][@href]',
  2090. pageElement: 'css;.articleListWrapper > .richTextItem.search',
  2091. insertPosition: ['css;#pageGroup', 1],
  2092. replaceE: 'css;#pageGroup',
  2093. scrollDelta: 700
  2094. }
  2095. }, // 微当下载 - 搜索页
  2096. weidown_special: {
  2097. SiteTypeID: 0,
  2098. pager: {
  2099. type: 1,
  2100. nextLink: '//a[@class="nextpage"][@href]',
  2101. pageElement: 'css;.special > .item',
  2102. insertPosition: ['css;.special', 3],
  2103. replaceE: 'css;#pageGroup',
  2104. scrollDelta: 700
  2105. }
  2106. }, // 微当下载 - 专题页
  2107. th_sjy: {
  2108. SiteTypeID: 0,
  2109. host: 'www.th-sjy.com',
  2110. pager: {
  2111. type: 1,
  2112. nextLink: 'css;li.next-page > a',
  2113. pageElement: 'css;.content > article',
  2114. insertPosition: ['css;.pagination', 1],
  2115. replaceE: 'css;.pagination',
  2116. scrollDelta: 2000
  2117. }
  2118. }, // th-sjy 汉化
  2119. fsylr: {
  2120. SiteTypeID: 0,
  2121. host: 'fsylr.com',
  2122. functionStart: function() {if (location.pathname.indexOf('.html') === -1) {curSite = DBSite.fsylr;}},
  2123. pager: {
  2124. type: 1,
  2125. nextLink: 'css;a.next.page-numbers[href]',
  2126. pageElement: 'css;.posts-con > div:not([class*="posts-"])',
  2127. insertPosition: ['css;.posts-con', 3],
  2128. replaceE: 'css;nav.pagination',
  2129. scrollDelta: 1000
  2130. }
  2131. }, // 发烧友绿软
  2132. iplaysoft_postslist: {
  2133. SiteTypeID: 0,
  2134. host: 'www.iplaysoft.com',
  2135. functionStart: function() {if (location.pathname.indexOf('.html') > -1 || location.pathname.indexOf('/p/') > -1) { // 文章内
  2136. curSite = DBSite.iplaysoft_postcomments;
  2137. } else { // 其他页面
  2138. curSite = DBSite.iplaysoft_postslist;
  2139. }},
  2140. pager: {
  2141. type: 1,
  2142. nextLink: '//div[@class="pagenavi"]//a[@title="下一页"][@href]',
  2143. pageElement: 'css;#postlist > div.entry',
  2144. insertPosition: ['css;#postlist > .pagenavi-button', 1],
  2145. replaceE: 'css;.pagenavi-button, .pagenavi',
  2146. scrollDelta: 1200
  2147. },
  2148. function: {
  2149. before: iplaysoft_postslist_functionBefore
  2150. }
  2151. }, // 异次元软件
  2152. iplaysoft_postcomments: {
  2153. SiteTypeID: 0,
  2154. pager: {
  2155. type: 2,
  2156. nextLink: '#loadHistoryComments',
  2157. nextTextOf: '展开后面',
  2158. scrollDelta: 1200
  2159. }
  2160. }, // 异次元软件 - 评论
  2161. mpyit: {
  2162. SiteTypeID: 0,
  2163. host: 'www.mpyit.com',
  2164. functionStart: function() {if (location.pathname === '/' && !location.search) {
  2165. curSite = DBSite.mpyit;
  2166. } else if (location.pathname.indexOf('/category/') > -1 || location.search.indexOf('?s=') > -1) { // 搜索页 / 分类页
  2167. curSite = DBSite.mpyit_category;
  2168. }},
  2169. pager: {
  2170. type: 1,
  2171. nextLink: '//a[@class="page-numbers"][@title="下一页"][@href]',
  2172. pageElement: 'css;#post > div[id^="post-"]',
  2173. insertPosition: ['css;#post > #pagenavi', 1],
  2174. replaceE: 'css;#post > #pagenavi',
  2175. scrollDelta: 1700
  2176. }
  2177. }, // 老殁 | 殁漂遥
  2178. mpyit_category: {
  2179. SiteTypeID: 0,
  2180. pager: {
  2181. type: 1,
  2182. nextLink: '//a[@class="page-numbers"][@title="下一页"][@href]',
  2183. pageElement: 'css;#content > div[class^="entry_box"]',
  2184. insertPosition: ['css;#content > #pagenavi', 1],
  2185. replaceE: 'css;#content > #pagenavi',
  2186. scrollDelta: 1700
  2187. }
  2188. }, // 老殁 | 殁漂遥 - 搜索页/分类页
  2189. yxssp: {
  2190. SiteTypeID: 0,
  2191. host: 'www.yxssp.com',
  2192. pager: {
  2193. type: 1,
  2194. nextLink: '//div[@class="page-nav td-pb-padding-side"]/a[last()][@href]',
  2195. pageElement: 'css;.td-modules-container.td-module-number4 > div',
  2196. insertPosition: ['css;.td-modules-container.td-module-number4', 3],
  2197. replaceE: 'css;.page-nav.td-pb-padding-side',
  2198. scrollDelta: 1000
  2199. }
  2200. }, // 异星软件空间
  2201. sordum: {
  2202. SiteTypeID: 0,
  2203. host: 'www.sordum.org',
  2204. pager: {
  2205. type: 1,
  2206. nextLink: '//a[@class="next page-numbers"][@href]',
  2207. pageElement: 'css;.article > article',
  2208. insertPosition: ['css;nav.navigation.posts-navigation', 1],
  2209. replaceE: 'css;nav.navigation.posts-navigation',
  2210. scrollDelta: 1500
  2211. }
  2212. }, // 下面这几个都是国外博客网站
  2213. winaero: {
  2214. SiteTypeID: 0,
  2215. host: 'winaero.com',
  2216. functionStart: function() {if (location.pathname === '/blog/' || location.pathname.indexOf('/category/') > -1) curSite = DBSite.winaero;},
  2217. pager: {
  2218. type: 1,
  2219. nextLink: 'css;.nav-previous > a',
  2220. pageElement: 'css;#content > article',
  2221. insertPosition: ['css;#nav-below', 1],
  2222. replaceE: 'css;#nav-below',
  2223. scrollDelta: 1500
  2224. }
  2225. },
  2226. lrepacks: {
  2227. SiteTypeID: 0,
  2228. host: 'lrepacks.net',
  2229. functionStart: function() {if (location.pathname.indexOf('.html') === -1) curSite = DBSite.lrepacks;},
  2230. pager: {
  2231. type: 1,
  2232. nextLink: 'css;.page_next > a',
  2233. pageElement: 'css;#main .post-list article',
  2234. insertPosition: ['css;.page_nav', 1],
  2235. replaceE: 'css;.page_nav',
  2236. scrollDelta: 1500
  2237. },
  2238. function: {
  2239. before: lrepacks_functionBefore
  2240. }
  2241. },
  2242. winhelponline: {
  2243. SiteTypeID: 0,
  2244. host: 'www.winhelponline.com',
  2245. functionStart: function() {if (location.pathname === '/blog/') {curSite = DBSite.winhelponline;}},
  2246. pager: {
  2247. type: 1,
  2248. nextLink: 'css;span.prev > a[href]',
  2249. pageElement: 'css;#main > article',
  2250. insertPosition: ['css;nav.paging-navigation', 1],
  2251. replaceE: 'css;nav.paging-navigation',
  2252. scrollDelta: 2000
  2253. }
  2254. },
  2255. windowslatest: {
  2256. SiteTypeID: 0,
  2257. host: 'www.windowslatest.com',
  2258. pager: {
  2259. type: 1,
  2260. nextLink: '//div[contains(@class, "page-nav")]/a/i[@class="td-icon-menu-right"]/parent::a',
  2261. pageElement: 'css;.td-ss-main-content > div:not(.td-block-title-wrap):not(.page-nav)',
  2262. insertPosition: ['css;.page-nav', 1],
  2263. replaceE: 'css;.page-nav',
  2264. scrollDelta: 2000
  2265. }
  2266. },
  2267. thewindowsclub: {
  2268. SiteTypeID: 0,
  2269. host: 'www.thewindowsclub.com',
  2270. functionStart: function() {curSite = DBSite.thewindowsclub; if (location.pathname === '/') {curSite.pager.scrollDelta = 2000;}},
  2271. pager: {
  2272. type: 1,
  2273. nextLink: 'css;li.pagination-next > a',
  2274. pageElement: 'css;#genesis-content > article',
  2275. insertPosition: ['css;.pagination', 1],
  2276. replaceE: 'css;.pagination',
  2277. scrollDelta: 1500
  2278. }
  2279. },
  2280. cartoonmad: {
  2281. SiteTypeID: 0,
  2282. host: ['www.cartoonmad.com','www.cartoonmad.cc'],
  2283. functionStart: function() {if (location.pathname.indexOf('/comic/') > -1) {
  2284. 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;}';
  2285. document.querySelector('body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child > a').href = 'javascript:void(0);'; // 清理图片上的链接
  2286. curSite = DBSite.cartoonmad;
  2287. } else if (location.pathname != '/') {
  2288. curSite = DBSite.cartoonmad_list;
  2289. }},
  2290. pager: {
  2291. type: 1,
  2292. nextLink: cartoonmad_functionNext,
  2293. pageElement: 'css;body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child img',
  2294. insertPosition: ['css;body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child > a', 3],
  2295. replaceE: 'css;body > table > tbody > tr:nth-child(2), body > table > tbody > tr:nth-child(5)',
  2296. mimeType: 'text/html; charset=big5',
  2297. scrollDelta: 2000
  2298. }
  2299. }, // 动漫狂
  2300. cartoonmad_list: {
  2301. SiteTypeID: 0,
  2302. pager: {
  2303. type: 1,
  2304. nextLink: '//a[@class="pages"][contains(text(), "下一頁")]',
  2305. pageElement: 'css;td[background="/image/content_box4.gif"]+td > table > tbody > tr',
  2306. insertPosition: ['css;td[background="/image/content_box4.gif"]+td > table > tbody', 3],
  2307. replaceE: '//a[@class="pages"]/parent::td/parent::tr | //font[contains(text(), "目前在第")]',
  2308. mimeType: 'text/html; charset=big5',
  2309. scrollDelta: 1000
  2310. }
  2311. }, // 动漫狂 - 分类/搜索页
  2312. manhuacat: {
  2313. SiteTypeID: 0,
  2314. host: 'www.manhuacat.com',
  2315. functionStart: function() {if (/\/manga\/\d+\/.+\.html/.test(location.pathname)) {
  2316. if (getCookie('is_pull') == 'true') { // 强制关闭 [下拉] 模式
  2317. document.cookie='is_pull=false; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 关闭 [下拉] 模式
  2318. location.reload(); // 刷新网页
  2319. }
  2320. setTimeout(manhuacat_init, 100);
  2321. 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;}'; // 隐藏不需要的元素,调整图片
  2322. } else if (location.pathname.indexOf('/list') > -1) {
  2323. curSite = DBSite.manhuacat_list;
  2324. } else if (location.pathname.indexOf('/search') > -1 || location.pathname.indexOf('/update') > -1) {
  2325. curSite = DBSite.manhuacat_search;
  2326. }},
  2327. pager: {
  2328. type: 4,
  2329. nextLink: manhuacat_functionNext,
  2330. insertPosition: ['css;.img-content', 3],
  2331. insertElement: manhuacat_insertElement,
  2332. replaceE: 'css;.comic-detail > .breadcrumb-bar, .comic-detail >h2.h4, title, .vg-r-data, body > script:not([src])',
  2333. intervals: 2000,
  2334. scrollDelta: 3000
  2335. }
  2336. }, // 漫画猫
  2337. manhuacat_list: {
  2338. SiteTypeID: 0,
  2339. pager: {
  2340. type: 1,
  2341. nextLink: '//div[contains(@class, "pagination")]//a[@href][contains(text(), "下一页") or contains(text(), "下页")]',
  2342. pageElement: 'css;.comic-main-section > *',
  2343. insertPosition: ['css;.comic-main-section', 3],
  2344. replaceE: 'css;.pagination',
  2345. scrollDelta: 1000
  2346. },
  2347. function: {
  2348. before: src_original_functionBefore
  2349. }
  2350. }, // 漫画猫 - 分类页
  2351. manhuacat_search: {
  2352. SiteTypeID: 0,
  2353. pager: {
  2354. type: 1,
  2355. nextLink: '//div[contains(@class, "pagination")]//a[@href][contains(text(), "下一页") or contains(text(), "下页")]',
  2356. pageElement: 'css;.comic-main-section .row > div',
  2357. insertPosition: ['css;.comic-main-section .row', 3],
  2358. replaceE: 'css;.pagination',
  2359. scrollDelta: 1000
  2360. }
  2361. }, // 漫画猫 - 搜索页
  2362. manhuadb: {
  2363. SiteTypeID: 0,
  2364. host: 'www.manhuadb.com',
  2365. functionStart: function() {if (/\/manhua\/\d+\/.+\.html/.test(location.pathname)) {
  2366. 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;}';
  2367. if (document.querySelector('img.img-fluid.show-pic')) document.querySelector('img.img-fluid.show-pic').style.display = 'none'; // 隐藏第一个图片(避免重复)
  2368. setTimeout(manhuadb_init, 100);
  2369. curSite = DBSite.manhuadb;
  2370. } else if (location.pathname.indexOf('/list') > -1) {
  2371. curSite = DBSite.manhuacat_list;
  2372. } else if (location.pathname.indexOf('/search') > -1 || location.pathname.indexOf('/update') > -1) {
  2373. curSite = DBSite.manhuacat_search;
  2374. }},
  2375. pager: {
  2376. type: 4,
  2377. nextLink: manhuadb_functionNext,
  2378. pageElement: 'css;body > script:not([type]):not([src]), .vg-r-data, ol.links-of-books.num_div',
  2379. insertPosition: ['css;.pjax-container', 3],
  2380. insertElement: manhuadb_insertElement,
  2381. intervals: 5000,
  2382. scrollDelta: 3000
  2383. }
  2384. }, // 漫画 DB
  2385. hicomic: {
  2386. SiteTypeID: 0,
  2387. host: 'www.hicomic.net',
  2388. functionStart: function() {if (location.pathname.indexOf('/chapters/') > -1) {
  2389. 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;}';
  2390. setTimeout(hicomic_init, 100);
  2391. curSite = DBSite.hicomic;
  2392. }},
  2393. pager: {
  2394. type: 4,
  2395. nextLink: hicomic_functionNext,
  2396. insertPosition: ['css;.content', 3],
  2397. insertElement: hicomic_insertElement,
  2398. intervals: 5000,
  2399. scrollDelta: 3000
  2400. }
  2401. }, // 嗨漫画
  2402. dmzj: {
  2403. SiteTypeID: 0,
  2404. host: 'www.dmzj.com',
  2405. functionStart: function() {if (location.pathname.indexOf('/view/') > -1) {
  2406. if (getCookie('display_mode') != '1') { // 强制开启 [上下滚动阅读] 模式
  2407. document.cookie='display_mode=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 开启 [上下滚动阅读] 模式
  2408. location.reload(); // 刷新网页
  2409. }
  2410. setTimeout(dmzj_init, 100);
  2411. 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;}'; // 隐藏中间的页数信息
  2412. } else if (location.pathname.indexOf('/category') > -1 || location.pathname.indexOf('/update') > -1) {
  2413. curSite = DBSite.dmzj_list; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.wrap_mhlist_l.con_left, .wrap_list {height: auto!important;}';
  2414. } else if (location.pathname.indexOf('/rank') > -1) {
  2415. curSite = DBSite.dmzj_rank; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.wrap_mhlist_l.con_left {height: auto!important;}';
  2416. }},
  2417. pager: {
  2418. type: 4,
  2419. nextLink: dmzj_functionNext,
  2420. insertPosition: ['css;.comic_wraCon', 3],
  2421. insertElement: dmzj_insertElement,
  2422. replaceE: 'css;.wrap_last_mid, .wrap_last_head, title',
  2423. intervals: 2000,
  2424. scrollDelta: 3000
  2425. }
  2426. }, // 动漫之家 - 原创
  2427. dmzj_list: {
  2428. SiteTypeID: 0,
  2429. pager: {
  2430. type: 1,
  2431. nextLink: 'css;a.pg_next[href]',
  2432. pageElement: 'css;ul.list_con_li > li',
  2433. insertPosition: ['css;ul.list_con_li', 3],
  2434. replaceE: 'css;.page',
  2435. scrollDelta: 1000
  2436. }
  2437. }, // 动漫之家 - 原创 - 分类页
  2438. dmzj_rank: {
  2439. SiteTypeID: 0,
  2440. pager: {
  2441. type: 1,
  2442. nextLink: 'css;a.pg_next[href]',
  2443. pageElement: 'css;.ph_r_con_li > div:not(.ad_column)',
  2444. insertPosition: ['css;.ph_r_con_li', 3],
  2445. replaceE: 'css;.page',
  2446. scrollDelta: 1000
  2447. }
  2448. }, // 动漫之家 - 原创 - 排行榜
  2449. dmzj_manhua: {
  2450. SiteTypeID: 0,
  2451. host: 'manhua.dmzj.com',
  2452. functionStart: function() {if (/\/\d+\.shtml/.test(location.pathname)) {
  2453. let chapterScroll = document.getElementById('qiehuan_txt') // 强制为 [上下滚动阅读] 模式
  2454. if (chapterScroll && chapterScroll.textContent === '切换到上下滚动阅读') {chapterScroll.click();}
  2455. setTimeout(dmzj_manhua_init, 100);
  2456. 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;}'; // 隐藏中间的页数信息
  2457. /*} else if (location.pathname.indexOf('/tags/search') > -1) {
  2458. curSite = DBSite.dmzj_manhua_search;
  2459. } else if (location.pathname.indexOf('/tags/') > -1) {
  2460. curSite = DBSite.dmzj_manhua_list;*/
  2461. } else if (location.pathname.indexOf('/update') > -1) {
  2462. curSite = DBSite.dmzj_manhua_update;
  2463. }},
  2464. pager: {
  2465. type: 4,
  2466. nextLink: dmzj_manhua_functionNext,
  2467. insertPosition: ['css;#center_box', 3],
  2468. insertElement: dmzj_manhua_insertElement,
  2469. replaceE: 'css;.display_graybg, title',
  2470. intervals: 2000,
  2471. scrollDelta: 3000
  2472. }
  2473. }, // 动漫之家 - 日漫
  2474. dmzj_manhua_search: {
  2475. SiteTypeID: 0,
  2476. pager: {
  2477. type: 1,
  2478. nextLink: '//div[@class="pages"]/a[contains(text(), "下一页")]',
  2479. forceHTTPS: true,
  2480. pageElement: 'css;.tcaricature_block ul',
  2481. insertPosition: ['css;.tcaricature_block', 3],
  2482. replaceE: 'css;.pages',
  2483. scrollDelta: 1000
  2484. },
  2485. function: {
  2486. after: function() {
  2487. document.body.appendChild(document.createElement('script')).src = document.querySelector('head > script[src*="/js/ps.js"]').src;
  2488. }
  2489. }
  2490. }, //动漫之家 - 日漫 - 搜索页
  2491. dmzj_manhua_list: {
  2492. SiteTypeID: 0,
  2493. pager: {
  2494. type: 1,
  2495. nextLink: '//div[@class="pages"]/a[contains(text(), "下一页")]',
  2496. forceHTTPS: true,
  2497. pageElement: 'css;.tcaricature_block ul',
  2498. insertPosition: ['css;.pages', 1],
  2499. replaceE: 'css;.pages',
  2500. scrollDelta: 1000
  2501. },
  2502. function: {
  2503. after: function() {
  2504. document.body.appendChild(document.createElement('script')).src = document.querySelector('head > script[src*="/js/csearch.js"]').src;
  2505. }
  2506. }
  2507. }, // 动漫之家 - 日漫 - 分类页
  2508. dmzj_manhua_update: {
  2509. SiteTypeID: 0,
  2510. pager: {
  2511. type: 1,
  2512. nextLink: '//div[@class="pages"]/a[contains(text(), "下一页")]',
  2513. pageElement: 'css;.newpic_content > *:not(.pages)',
  2514. insertPosition: ['css;.newpic_content', 3],
  2515. replaceE: 'css;.pages',
  2516. scrollDelta: 1000
  2517. }
  2518. }, //动漫之家 - 日漫 - 最新更新
  2519. copymanga: {
  2520. SiteTypeID: 0,
  2521. host: 'www.copymanga.com',
  2522. functionStart: function() {if (location.pathname.indexOf('/chapter/') > -1) {
  2523. curSite = DBSite.copymanga; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.upMember, .comicContainerAds, .footer {display: none !important;}';
  2524. } else if (location.pathname.indexOf('/comics') > -1) {
  2525. curSite = DBSite.copymanga_list;
  2526. }},
  2527. pager: {
  2528. type: 4,
  2529. nextLink: copymanga_functionNext,
  2530. insertPosition: ['css;ul.comicContent-image-list > li:first-child', 1],
  2531. insertElement: copymanga_insertElement,
  2532. replaceE: 'css;.disposableData, .disposablePass, .disposableUrlPrefix, .disposableUrlSuffix, .footer, h4.header, title',
  2533. intervals: 5000,
  2534. scrollDelta: 3000
  2535. }
  2536. }, // 拷贝漫画
  2537. copymanga_list: {
  2538. SiteTypeID: 0,
  2539. pager: {
  2540. type: 1,
  2541. nextLink: 'css;li.next > a[href]',
  2542. pageElement: 'css;.exemptComic-box > div',
  2543. insertPosition: ['css;.exemptComic-box', 3],
  2544. replaceE: 'css;ul.page-all',
  2545. scrollDelta: 1500
  2546. },
  2547. function: {
  2548. before: src_src_functionBefore
  2549. }
  2550. }, // 拷贝漫画 - 分类页
  2551. gufengmh: {
  2552. SiteTypeID: 0,
  2553. host: /gufengmh/,
  2554. functionStart: function() {if (/\/\d+.+\.html/.test(location.pathname)) {
  2555. let chapterScroll = document.getElementById('chapter-scroll') // 强制为 [下拉阅读] 模式
  2556. if (chapterScroll && chapterScroll.className === '') {chapterScroll.click();}
  2557. curSite = DBSite.gufengmh; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'p.img_info {display: none !important;}'; // 隐藏中间的页数信息
  2558. } else if (location.pathname.indexOf('/update') > -1 || location.pathname.indexOf('/list') > -1 || location.pathname.indexOf('/search') > -1) {
  2559. curSite = DBSite.gufengmh_list;
  2560. }},
  2561. pager: {
  2562. type: 4,
  2563. nextLink: gufengmh_functionNext,
  2564. pageElement: 'css;body > script:first-child',
  2565. insertPosition: ['css;#images', 3],
  2566. insertElement: gufengmh_insertElement,
  2567. intervals: 5000,
  2568. scrollDelta: 4000
  2569. }
  2570. }, // 古风漫画网
  2571. gufengmh_list: {
  2572. SiteTypeID: 0,
  2573. pager: {
  2574. type: 1,
  2575. nextLink: 'css;li.next > a[href]',
  2576. pageElement: 'css;ul.book-list > li',
  2577. insertPosition: ['css;ul.book-list', 3],
  2578. replaceE: 'css;ul.pagination',
  2579. scrollDelta: 1000
  2580. }
  2581. }, // 古风漫画网 - 分类页
  2582. szcdmj: {
  2583. SiteTypeID: 0,
  2584. host: 'www.szcdmj.com',
  2585. functionStart: function() {if (location.pathname.indexOf('/szcchapter/') > -1) {curSite = DBSite.szcdmj; document.lastElementChild.appendChild(document.createElement('style')).textContent = '.header {opacity: 0.3 !important;}';}},
  2586. pager: {
  2587. type: 1,
  2588. nextLink: '//div[@class="fanye"][1]/a[@href][text()="下一页" or text()="下一话"]',
  2589. pageElement: 'css;.comicpage > div,title',
  2590. insertPosition: ['css;.comicpage', 3],
  2591. replaceE: 'css;.fanye,h1.title',
  2592. scrollDelta: 2000
  2593. },
  2594. function: {
  2595. before: szcdmj_functionBefore
  2596. }
  2597. }, // 砂之船动漫家
  2598. mangabz: {
  2599. SiteTypeID: 0,
  2600. host: 'mangabz.com',
  2601. functionStart: function() {if (/\/m\d+/.test(location.pathname)) {
  2602. setTimeout(mangabz_init, 500);
  2603. curSite = DBSite.mangabz;
  2604. document.lastElementChild.appendChild(document.createElement('style')).textContent = 'body > .container > div:not([id]) {display: none !important;} .top-bar {opacity: 0.3 !important;} #cp_img > img{display: block !important;margin: 0 auto !important;width: auto !important; height: auto !important;}';
  2605. } else if (/\/\d+bz\//.test(location.pathname)) {
  2606. if (document.querySelector('.detail-list-form-more')) document.querySelector('.detail-list-form-more').click();
  2607. } else if (location.pathname.indexOf('/manga-list') > -1 || location.pathname === '/search') {
  2608. curSite = DBSite.mangabz_list;
  2609. }},
  2610. pager: {
  2611. type: 4,
  2612. nextLink: mangabz_functionNext,
  2613. insertPosition: ['css;#cp_img', 3],
  2614. insertElement: mangabz_insertElement,
  2615. replaceE: 'css;p.top-title, body > .container > div:not([id]), title',
  2616. intervals: 500,
  2617. scrollDelta: 1000
  2618. }
  2619. }, // Mangabz 漫画
  2620. mangabz_list: {
  2621. SiteTypeID: 0,
  2622. pager: {
  2623. type: 1,
  2624. nextLink: '//div[@class="page-pagination"]//a[@href][contains(text(), ">")]',
  2625. pageElement: 'css;ul.mh-list > li',
  2626. insertPosition: ['css;ul.mh-list', 3],
  2627. replaceE: 'css;.page-pagination',
  2628. scrollDelta: 800
  2629. }
  2630. }, // Mangabz 漫画 - 分类/搜索页
  2631. netbian: {
  2632. SiteTypeID: 0,
  2633. host: 'pic.netbian.com',
  2634. functionStart: function() {curSite = DBSite.netbian; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'li.nextpage {display: none !important;}';},
  2635. pager: {
  2636. type: 1,
  2637. nextLink: '//div[@class="page"]/a[contains(text(),"下一页")]',
  2638. pageElement: 'css;.slist ul > li:not(.nextpage)',
  2639. insertPosition: ['css;.slist ul', 3],
  2640. replaceE: 'css;.page',
  2641. mimeType: 'text/html; charset=gbk',
  2642. scrollDelta: 1000
  2643. }
  2644. }, // 彼岸图网
  2645. ioliu: {
  2646. SiteTypeID: 0,
  2647. host: 'bing.ioliu.cn',
  2648. functionStart: function() {if (location.pathname.indexOf('/photo/') === -1 && location.pathname.indexOf('.html') === -1) {curSite = DBSite.ioliu; document.head.appendChild(document.createElement('base')).target = '_blank';}},
  2649. pager: {
  2650. type: 1,
  2651. nextLink: '//div[@class="page"]/a[@href][contains(text(), "下一页")]',
  2652. pageElement: 'css;body > .container > div.item',
  2653. insertPosition: ['css;body > .container', 3],
  2654. replaceE: 'css;.page',
  2655. scrollDelta: 1000
  2656. },
  2657. function: {
  2658. before: ioliu_functionBefore
  2659. }
  2660. }, // 必应壁纸
  2661. github_star: {
  2662. SiteTypeID: 0,
  2663. host: 'github.com',
  2664. functionStart: function() {locationchange = true;
  2665. if (location.search.indexOf('tab=stars') > -1) {
  2666. curSite = DBSite.github_star;
  2667. } else if ((location.pathname.indexOf('/issues') > -1 && location.pathname.indexOf('/issues/') === -1) || (location.pathname.indexOf('/pulls') > -1 && location.pathname.indexOf('/pulls/') === -1)) {
  2668. curSite = DBSite.github_issues;
  2669. } else if (location.pathname.indexOf('/discussions') > -1 && !(/\/discussions\/\d+/.test(location.pathname))) {
  2670. curSite = DBSite.github_discussions;
  2671. } else if (location.pathname.indexOf('/search') > -1) {
  2672. if (!location.search) return
  2673. if (location.search.indexOf('type=Repositories') > -1 || location.search.indexOf('type=') === -1) {
  2674. curSite = DBSite.github_search;
  2675. } else if (location.search.indexOf('type=code') > -1) {
  2676. curSite = DBSite.github_search_code;
  2677. } else if (location.search.indexOf('type=commits') > -1) {
  2678. curSite = DBSite.github_search_commit;
  2679. } else if (location.search.indexOf('type=issues') > -1 || location.search.indexOf('type=discussions') > -1) {
  2680. curSite = DBSite.github_search_issue;
  2681. } else if (location.search.indexOf('type=registrypackages') > -1) {
  2682. curSite = DBSite.github_search_package;
  2683. } else if (location.search.indexOf('type=marketplace') > -1) {
  2684. curSite = DBSite.github_search_marketplace;
  2685. } else if (location.search.indexOf('type=topics') > -1) {
  2686. curSite = DBSite.github_search_topics;
  2687. } else if (location.search.indexOf('type=wikis') > -1) {
  2688. curSite = DBSite.github_search_wiki;
  2689. } else if (location.search.indexOf('type=users') > -1) {
  2690. curSite = DBSite.github_search_user;
  2691. }
  2692. }},
  2693. pager: {
  2694. type: 1,
  2695. nextLink: '//div[@class="paginate-container"]//a[@href][contains(text(), "Next")]',
  2696. pageElement: 'css;#js-pjax-container .position-relative div[class^="col-lg-"] > div:not(.position-relative):not(.paginate-container)',
  2697. insertPosition: ['css;.paginate-container', 1],
  2698. replaceE: 'css;.paginate-container',
  2699. scrollDelta: 3000
  2700. }
  2701. }, // Github - 用户 Star 列表
  2702. github_issues: {
  2703. SiteTypeID: 0,
  2704. pager: {
  2705. type: 1,
  2706. nextLink: 'css;a.next_page',
  2707. pageElement: 'css;.js-navigation-container.js-active-navigation-container > div[id^="issue_"]',
  2708. insertPosition: ['css;.js-navigation-container.js-active-navigation-container', 3],
  2709. replaceE: 'css;.pagination',
  2710. scrollDelta: 3000
  2711. }
  2712. }, // Github - Issues 列表 / PR 列表
  2713. github_discussions: {
  2714. SiteTypeID: 0,
  2715. pager: {
  2716. type: 1,
  2717. nextLink: 'css;a.next_page',
  2718. pageElement: 'css;#repo-content-pjax-container div[data-discussion-hovercards-enabled] > div',
  2719. insertPosition: ['css;#repo-content-pjax-container div[data-discussion-hovercards-enabled]', 3],
  2720. replaceE: 'css;.pagination',
  2721. scrollDelta: 3000
  2722. }
  2723. }, // Github - Discussions 列表
  2724. github_search: {
  2725. SiteTypeID: 0,
  2726. pager: {
  2727. type: 1,
  2728. nextLink: 'css;a.next_page',
  2729. pageElement: 'css;ul.repo-list > li',
  2730. insertPosition: ['css;ul.repo-list', 3],
  2731. replaceE: 'css;.pagination',
  2732. scrollDelta: 1500
  2733. }
  2734. }, // Github - Search 列表
  2735. github_search_code: {
  2736. SiteTypeID: 0,
  2737. pager: {
  2738. type: 1,
  2739. nextLink: 'css;a.next_page',
  2740. pageElement: 'css;.code-list > div',
  2741. insertPosition: ['css;.code-list', 3],
  2742. replaceE: 'css;.pagination',
  2743. scrollDelta: 1500
  2744. }
  2745. }, // Github - Search 列表 - Code
  2746. github_search_commit: {
  2747. SiteTypeID: 0,
  2748. pager: {
  2749. type: 1,
  2750. nextLink: 'css;a.next_page',
  2751. pageElement: 'css;#commit_search_results > div',
  2752. insertPosition: ['css;#commit_search_results', 3],
  2753. replaceE: 'css;.pagination',
  2754. scrollDelta: 1500
  2755. }
  2756. }, // Github - Search 列表 - Commit
  2757. github_search_issue: {
  2758. SiteTypeID: 0,
  2759. pager: {
  2760. type: 1,
  2761. nextLink: 'css;a.next_page',
  2762. pageElement: 'css;.issue-list > div > div',
  2763. insertPosition: ['css;.issue-list > div', 3],
  2764. replaceE: 'css;.pagination',
  2765. scrollDelta: 1500
  2766. }
  2767. }, // Github - Search 列表 - Issues/Discussions
  2768. github_search_package: {
  2769. SiteTypeID: 0,
  2770. pager: {
  2771. type: 1,
  2772. nextLink: 'css;a.next_page',
  2773. pageElement: 'css;#package_search_results > div',
  2774. insertPosition: ['css;#package_search_results', 3],
  2775. replaceE: 'css;.pagination',
  2776. scrollDelta: 1500
  2777. }
  2778. }, // Github - Search 列表 - Package
  2779. github_search_marketplace: {
  2780. SiteTypeID: 0,
  2781. pager: {
  2782. type: 1,
  2783. nextLink: 'css;a.next_page',
  2784. pageElement: 'css;.issue-list > div',
  2785. insertPosition: ['css;.issue-list', 3],
  2786. replaceE: 'css;.pagination',
  2787. scrollDelta: 1500
  2788. }
  2789. }, // Github - Search 列表 - Marketplace
  2790. github_search_topics: {
  2791. SiteTypeID: 0,
  2792. pager: {
  2793. type: 1,
  2794. nextLink: 'css;a.next_page',
  2795. pageElement: 'css;.topic-list > div',
  2796. insertPosition: ['css;.topic-list', 3],
  2797. replaceE: 'css;.pagination',
  2798. scrollDelta: 1500
  2799. }
  2800. }, // Github - Search 列表 - Topics
  2801. github_search_wiki: {
  2802. SiteTypeID: 0,
  2803. pager: {
  2804. type: 1,
  2805. nextLink: 'css;a.next_page',
  2806. pageElement: 'css;#wiki_search_results > div:first-child > div',
  2807. insertPosition: ['css;#wiki_search_results > div:first-child', 3],
  2808. replaceE: 'css;.pagination',
  2809. scrollDelta: 1500
  2810. }
  2811. }, // Github - Search 列表 - wiki
  2812. github_search_user: {
  2813. SiteTypeID: 0,
  2814. pager: {
  2815. type: 1,
  2816. nextLink: 'css;a.next_page',
  2817. pageElement: 'css;#user_search_results > div:first-child > div',
  2818. insertPosition: ['css;#user_search_results > div:first-child', 3],
  2819. replaceE: 'css;.pagination',
  2820. scrollDelta: 1500
  2821. }
  2822. }, // Github - Search 列表 - user
  2823. stackoverflow: {
  2824. SiteTypeID: 0,
  2825. host: 'stackoverflow.com',
  2826. functionStart: function() {if (location.pathname.indexOf('/questions') > -1) {
  2827. curSite = DBSite.stackoverflow;
  2828. } else if (location.pathname === '/search') {
  2829. curSite = DBSite.stackoverflow_search;
  2830. } else if (location.pathname === '/tags') {
  2831. curSite = DBSite.stackoverflow_tags;
  2832. } else if (location.pathname === '/users') {
  2833. curSite = DBSite.stackoverflow_users;
  2834. }},
  2835. pager: {
  2836. type: 1,
  2837. nextLink: 'css;a[href][rel="next"]',
  2838. pageElement: 'css;#questions > div',
  2839. insertPosition: ['css;#questions', 3],
  2840. replaceE: 'css;.pager',
  2841. scrollDelta: 1500
  2842. }
  2843. }, // StackOverflow - Questions
  2844. stackoverflow_tags: {
  2845. SiteTypeID: 0,
  2846. pager: {
  2847. type: 1,
  2848. nextLink: 'css;a[href][rel="next"]',
  2849. pageElement: 'css;#tags-browser > div',
  2850. insertPosition: ['css;#tags-browser', 3],
  2851. replaceE: 'css;.pager',
  2852. scrollDelta: 1500
  2853. }
  2854. }, // StackOverflow - Tags
  2855. stackoverflow_users: {
  2856. SiteTypeID: 0,
  2857. pager: {
  2858. type: 1,
  2859. nextLink: 'css;a[href][rel="next"]',
  2860. pageElement: 'css;#user-browser > div:first-child > div',
  2861. insertPosition: ['css;#user-browser > div:first-child', 3],
  2862. replaceE: 'css;.pager',
  2863. scrollDelta: 1500
  2864. }
  2865. }, // StackOverflow - Users
  2866. stackoverflow_search: {
  2867. SiteTypeID: 0,
  2868. pager: {
  2869. type: 1,
  2870. nextLink: 'css;a[href][rel="next"]',
  2871. pageElement: 'css;.js-search-results > div:first-child > div',
  2872. insertPosition: ['css;.js-search-results > div:first-child', 3],
  2873. replaceE: 'css;.pager',
  2874. scrollDelta: 1500
  2875. }
  2876. }, // StackOverflow - Search
  2877. segmentfault: {
  2878. SiteTypeID: 0,
  2879. host: 'segmentfault.com',
  2880. functionStart: function() {locationchange = true;
  2881. if (location.pathname.indexOf('/questions') > -1) {
  2882. curSite = DBSite.segmentfault;
  2883. } else if (location.pathname === '/search') {
  2884. curSite = DBSite.segmentfault_search;
  2885. }},
  2886. pager: {
  2887. type: 1,
  2888. nextLink: '//a[@class="page-link"][contains(text(), "下一页")]',
  2889. pageElement: 'css;ul.list-group > li',
  2890. insertPosition: ['css;ul.list-group', 3],
  2891. replaceE: 'css;ul.pagination',
  2892. scrollDelta: 1000
  2893. }
  2894. }, // SegmentFault - Questions
  2895. segmentfault_search: {
  2896. SiteTypeID: 0,
  2897. pager: {
  2898. type: 1,
  2899. nextLink: 'css;a[href][rel="next"]',
  2900. pageElement: 'css;.search-result > section',
  2901. insertPosition: ['css;.search-result > div:last-child', 1],
  2902. replaceE: 'css;ul.pagination',
  2903. scrollDelta: 1000
  2904. }
  2905. }, // SegmentFault - Search
  2906. pubmed: {
  2907. SiteTypeID: 0,
  2908. host: 'pubmed.ncbi.nlm.nih.gov',
  2909. pager: {
  2910. type: 2,
  2911. nextLink: 'button.load-button.next-page',
  2912. nextText: 'Show more',
  2913. scrollDelta: 1500
  2914. }
  2915. }, // 学术
  2916. libgen: {
  2917. SiteTypeID: 0,
  2918. host: /libgen/,
  2919. functionStart: function() {if (location.pathname === '/search.php') {curSite = DBSite.libgen;}},
  2920. pager: {
  2921. type: 1,
  2922. nextLink: '//font/a[@href][contains(text(), "►")]',
  2923. pageElement: 'css;table[rules="rows"] > tbody > tr:nth-of-type(n+2), .paginator+script:not([src])',
  2924. insertPosition: ['css;table[rules="rows"] > tbody', 3],
  2925. replaceE: '//td[./font/a[@href][contains(text(), "►")]]',
  2926. scriptType: 2,
  2927. history: true,
  2928. scrollDelta: 2000
  2929. }
  2930. }, // 学术
  2931. baidu_xueshu: {
  2932. SiteTypeID: 0,
  2933. host: 'xueshu.baidu.com',
  2934. functionStart: function() {if (location.pathname === '/s') {
  2935. curSite = DBSite.baidu_xueshu;
  2936. } else if (location.pathname.indexOf('journal/navigation') > -1) {
  2937. curSite = DBSite.baidu_xueshu_journal;
  2938. } else if (location.pathname.indexOf('paper/show') > -1) {
  2939. curSite = DBSite.baidu_xueshu_paper;
  2940. }},
  2941. pager: {
  2942. type: 1,
  2943. nextLink: 'id("page")/a[./i[@class="c-icon-pager-next"]][@href]',
  2944. pageElement: 'css;#bdxs_result_lists > div.result',
  2945. insertPosition: ['css;#bdxs_result_lists', 3],
  2946. replaceE: 'css;#page',
  2947. history: true,
  2948. scrollDelta: 1000
  2949. }
  2950. }, // 百度学术
  2951. baidu_xueshu_journal: {
  2952. SiteTypeID: 0,
  2953. pager: {
  2954. type: 1,
  2955. nextLink: 'css;a.res-page-next[href]',
  2956. pageElement: 'css;#journaldetail > div',
  2957. insertPosition: ['css;#journaldetail', 3],
  2958. replaceE: 'css;.res-page',
  2959. history: true,
  2960. scrollDelta: 1000
  2961. }
  2962. }, // 百度学术
  2963. baidu_xueshu_paper: {
  2964. SiteTypeID: 0,
  2965. pager: {
  2966. type: 2,
  2967. nextLink: 'div:not([style*="display: none"]) > .more_btn',
  2968. nextText: '加载更多',
  2969. scrollDelta: 1000
  2970. }
  2971. }, // 百度学术
  2972. wikihow: {
  2973. SiteTypeID: 0,
  2974. host: ['www.wikihow.com', 'zh.wikihow.com'],
  2975. functionStart: function() {if (location.pathname.indexOf('/Category:') > -1) {
  2976. curSite = DBSite.wikihow;
  2977. } else if (location.pathname.indexOf('/wikiHowTo') > -1 && location.search.indexOf('?search=') > -1) {
  2978. curSite = DBSite.wikihow_search;
  2979. }},
  2980. pager: {
  2981. type: 1,
  2982. nextLink: 'css;a.pag_next',
  2983. pageElement: 'css;#cat_all > .cat_grid > div',
  2984. insertPosition: ['css;#cat_all > .cat_grid', 3],
  2985. replaceE: 'css;#large_pagination',
  2986. scriptType: 4,
  2987. scrollDelta: 2000
  2988. }
  2989. }, // 指南
  2990. wikihow_search: {
  2991. SiteTypeID: 0,
  2992. pager: {
  2993. type: 1,
  2994. nextLink: 'css;#searchresults_footer > a.buttonright',
  2995. pageElement: 'css;#searchresults_list > a',
  2996. insertPosition: ['css;#searchresults_list', 3],
  2997. replaceE: 'css;#searchresults_footer',
  2998. scrollDelta: 3000
  2999. }
  3000. }, // 指南 - 搜索页
  3001. afreecatv: {
  3002. SiteTypeID: 0,
  3003. host: 'www.afreecatv.com',
  3004. pager: {
  3005. type: 2,
  3006. nextLink: '.btn-more > button',
  3007. intervals: 2000,
  3008. scrollDelta: 1000
  3009. }
  3010. }, // 直播
  3011. greasyfork: {
  3012. SiteTypeID: 0,
  3013. host: 'greasyfork.org',
  3014. functionStart: function() {if (/\/scripts$/.test(location.pathname) || location.pathname.indexOf('/scripts/by-site/') > -1) {
  3015. curSite = DBSite.greasyfork;
  3016. } else if (/\/feedback$/.test(location.pathname)) {
  3017. curSite = DBSite.greasyfork_feedback;
  3018. } else if (location.pathname.indexOf('/discussions') > -1 && !(/\/\d+/.test(location.pathname))) {
  3019. curSite = DBSite.greasyfork_discussions;
  3020. }},
  3021. pager: {
  3022. type: 1,
  3023. nextLink: '//a[@class="next_page"][@href]',
  3024. pageElement: 'css;ol#browse-script-list > li',
  3025. insertPosition: ['css;ol#browse-script-list', 3],
  3026. replaceE: 'css;.pagination',
  3027. scrollDelta: 1000
  3028. }
  3029. }, // 脚本
  3030. greasyfork_feedback: {
  3031. SiteTypeID: 0,
  3032. pager: {
  3033. type: 1,
  3034. nextLink: '//a[@class="next_page"][@href]',
  3035. pageElement: 'css;.script-discussion-list > div',
  3036. insertPosition: ['css;.script-discussion-list', 3],
  3037. replaceE: 'css;.pagination',
  3038. scrollDelta: 1500
  3039. }
  3040. }, // 脚本 - 反馈页
  3041. greasyfork_discussions: {
  3042. SiteTypeID: 0,
  3043. pager: {
  3044. type: 1,
  3045. nextLink: '//a[@class="next_page"][@href]',
  3046. pageElement: 'css;.discussion-list > div',
  3047. insertPosition: ['css;.discussion-list', 3],
  3048. replaceE: 'css;.pagination',
  3049. scrollDelta: 1000
  3050. }
  3051. }, // 脚本 - 讨论页
  3052. ruyile_xuexiao: {
  3053. SiteTypeID: 0,
  3054. host: 'www.ruyile.com',
  3055. functionStart: function() {
  3056. if (location.pathname === '/xuexiao/') {
  3057. curSite = DBSite.ruyile_xuexiao;
  3058. } else if (location.pathname === '/data/') {
  3059. curSite = DBSite.ruyile_data;
  3060. } else if (location.pathname === '/shijuan/') {
  3061. curSite = DBSite.ruyile_shijuan;
  3062. }},
  3063. pager: {
  3064. type: 1,
  3065. nextLink: '//div[@class="fy"]/a[contains(text(), "下一页")][@href]',
  3066. pageElement: 'css;.xxlb > .sk',
  3067. insertPosition: ['css;.xxlb', 3],
  3068. replaceE: 'css;.fy',
  3069. scrollDelta: 1000
  3070. }
  3071. }, // 如意了教育 - 学校
  3072. ruyile_data: {
  3073. SiteTypeID: 0,
  3074. pager: {
  3075. type: 1,
  3076. nextLink: '//div[@class="fy"]/a[contains(text(), "下一页")][@href]',
  3077. pageElement: 'css;.m1_z > .lbk',
  3078. insertPosition: ['css;.page', 1],
  3079. replaceE: 'css;.fy',
  3080. scrollDelta: 1000
  3081. }
  3082. }, // 如意了教育 - 数据
  3083. ruyile_shijuan: {
  3084. SiteTypeID: 0,
  3085. pager: {
  3086. type: 1,
  3087. nextLink: '//div[@class="fy"]/a[contains(text(), "下一页")][@href]',
  3088. pageElement: 'css;.m1_z > .m2_lb',
  3089. insertPosition: ['css;.page', 1],
  3090. replaceE: 'css;.fy',
  3091. scrollDelta: 1000
  3092. }
  3093. }, // 如意了教育 - 试卷
  3094. kdslife: {
  3095. SiteTypeID: 0,
  3096. host: 'club.kdslife.com',
  3097. functionStart: function() {
  3098. if (location.pathname.indexOf('/f_') > -1) {
  3099. curSite = DBSite.kdslife;
  3100. } else if (location.pathname.indexOf('/t_') > -1) {
  3101. curSite = DBSite.kdslife_t;
  3102. }},
  3103. pager: {
  3104. type: 1,
  3105. nextLink: '//div[@class="fr i3_r"]/a[@href][contains(text(), "后一页")]',
  3106. pageElement: 'css;ul.main_List > li.i2:not(.h_bg)',
  3107. insertPosition: ['css;ul.main_List > li.i3', 1],
  3108. replaceE: 'css;ul.main_List > li.i3',
  3109. scrollDelta: 1000
  3110. }
  3111. }, // 宽带山论坛
  3112. kdslife_t: {
  3113. SiteTypeID: 0,
  3114. pager: {
  3115. type: 1,
  3116. nextLink: '//div[@class="pages"]/a[contains(text(), ">>")]',
  3117. pageElement: 'css;#reply_list_panel > *, script[src*="ui/js/kds.js"]',
  3118. insertPosition: ['css;#reply_list_panel', 3],
  3119. replaceE: 'css;.pages',
  3120. scriptType: 3,
  3121. scrollDelta: 1000
  3122. }
  3123. }, // 宽带山论坛 - 帖子内
  3124. libaclub: {
  3125. SiteTypeID: 0,
  3126. host: 'www.libaclub.com',
  3127. functionStart: function() {
  3128. if (location.pathname === '/' || location.pathname.indexOf('/date_') > -1) {
  3129. curSite = DBSite.libaclub;
  3130. } else if (location.pathname.indexOf('/f_') > -1) {
  3131. curSite = DBSite.libaclub_f;
  3132. } else if (location.pathname.indexOf('/t_') > -1 || location.pathname.indexOf('/reply_') > -1) {
  3133. curSite = DBSite.libaclub_t;
  3134. } else if (location.pathname.indexOf('/prt_') > -1) {
  3135. curSite = DBSite.libaclub_prt;
  3136. } else if (location.pathname === '/facade.php') {
  3137. curSite = DBSite.libaclub_search;
  3138. }
  3139. document.lastElementChild.appendChild(document.createElement('style')).textContent = 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}';},
  3140. pager: {
  3141. type: 1,
  3142. nextLink: '//div[@class="ui-crumbs-more"]/a[@class="fn-link"][1]',
  3143. pageElement: 'css;ul.ui-list > li:not(.ui-list-item-head):not(.ui-list-merchant-ad)',
  3144. insertPosition: ['css;ul.ui-list', 3],
  3145. replaceE: 'css;div.ui-crumbs-more',
  3146. scrollDelta: 1200
  3147. }
  3148. }, // 篱笆网论坛
  3149. libaclub_f: {
  3150. SiteTypeID: 0,
  3151. pager: {
  3152. type: 1,
  3153. nextLink: '//div[@class="ui-paging"]/a[@class="ui-paging-next"]',
  3154. pageElement: 'css;ul.ui-list > li:not(.ui-list-item-head):not(.ui-list-merchant-ad)',
  3155. insertPosition: ['css;ul.ui-list', 3],
  3156. replaceE: 'css;div.ui-paging',
  3157. scrollDelta: 1200
  3158. }
  3159. }, // 篱笆网论坛 - 各版块帖子列表
  3160. libaclub_t: {
  3161. SiteTypeID: 0,
  3162. pager: {
  3163. type: 1,
  3164. nextLink: 'css;a.ui-paging-next',
  3165. pageElement: 'css;.ui-box-content > div.ui-topic, .ui-box-content > a[name]',
  3166. insertPosition: ['css;.ui-box-content', 3],
  3167. replaceE: 'css;div.ui-paging',
  3168. scrollDelta: 1500
  3169. }
  3170. }, // 篱笆网论坛 - 帖子内
  3171. libaclub_prt: {
  3172. SiteTypeID: 0,
  3173. pager: {
  3174. type: 1,
  3175. nextLink: 'css;a.ui-paging-next',
  3176. pageElement: 'css;ul.ui-list > li',
  3177. insertPosition: ['css;ul.ui-list', 3],
  3178. replaceE: 'css;div.ui-paging',
  3179. scrollDelta: 2000
  3180. }
  3181. }, // 篱笆网论坛 - 帖子内 - 打印版
  3182. libaclub_search: {
  3183. SiteTypeID: 0,
  3184. pager: {
  3185. type: 1,
  3186. nextLink: '//div[@class="ui-page"]/a[contains(text(), "下一页")]',
  3187. pageElement: 'css;.ui-box-main > ul.ui-list > li',
  3188. insertPosition: ['css;.ui-box-main > ul.ui-list', 3],
  3189. replaceE: 'css;div.ui-page',
  3190. scrollDelta: 1200
  3191. }
  3192. } // 篱笆网论坛 - 搜索页
  3193. };
  3194. // 生成 SiteTypeID
  3195. generateID();
  3196. // 用于脚本判断(针对部分特殊的网站)
  3197. SiteType = {
  3198. BAIDU_TIEBA: DBSite.baidu_tieba.SiteTypeID,
  3199. GAMERSKY_GL: DBSite.gamersky_gl.SiteTypeID
  3200. };
  3201. }
  3202.  
  3203.  
  3204. if (webType != 1) {
  3205. // < 所有 Discuz!论坛 >
  3206. if (webType === 2) {
  3207. if (location.pathname.indexOf('.html') > -1) { // 判断是不是静态网页(.html 结尾)
  3208. if (location.pathname.indexOf('/forum-') > -1) { // < 各版块帖子列表 >
  3209. if (document.getElementById('autopbn')) { // 判断是否有 [下一页] 按钮
  3210. curSite = DBSite.discuz_forum;
  3211. } else if (document.getElementById('waterfall')) { // 判断是否为图片模式
  3212. curSite = DBSite.discuz_waterfall; waterfallStyle(); // 图片模式列表样式预处理
  3213. } else {
  3214. curSite = DBSite.discuz_guide;
  3215. }
  3216. } else if (location.pathname.indexOf('/thread-') > -1) { // < 帖子内 >
  3217. if (GM_getValue('menu_discuz_thread_page')) {
  3218. curSite = DBSite.discuz_thread;
  3219. hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
  3220. }
  3221. } else if(location.pathname.indexOf('search') > -1) { // < 搜索结果 >
  3222. curSite = DBSite.discuz_search;
  3223. }
  3224. }
  3225. // 如果没有匹配的则继续
  3226. if (curSite.SiteTypeID === 0) {
  3227. if (location.search.indexOf('mod=forumdisplay') > -1 || location.pathname.indexOf('forumdisplay.php') > -1) { // < 各版块帖子列表 >
  3228. if (document.getElementById('autopbn')) { // 判断是否有 [下一页] 按钮
  3229. curSite = DBSite.discuz_forum;
  3230. } else if (document.getElementById('waterfall')) { // 判断是否为图片模式
  3231. curSite = DBSite.discuz_waterfall; waterfallStyle(); // 图片模式列表样式预处理
  3232. } else {
  3233. curSite = DBSite.discuz_guide;
  3234. }
  3235. } else if (location.search.indexOf('mod=viewthread') > -1 || location.pathname.indexOf('viewthread.php') > -1) { // < 帖子内 >
  3236. if (GM_getValue('menu_discuz_thread_page')) {
  3237. curSite = DBSite.discuz_thread;
  3238. hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
  3239. }
  3240. } else if (location.search.indexOf('mod=guide') > -1) { // < 导读帖子列表 >
  3241. curSite = DBSite.discuz_guide;
  3242. } else if(location.search.indexOf('mod=space') > -1 && location.search.indexOf('&view=me') > -1) { // 别人的主题/回复
  3243. curSite = DBSite.discuz_youspace;
  3244. } else if (location.search.indexOf('mod=collection') > -1) { // < 淘贴列表 >
  3245. curSite = DBSite.discuz_collection;
  3246. } else if (location.pathname.indexOf('search') > -1) { // < 搜索结果 >
  3247. curSite = DBSite.discuz_search;
  3248. } else if (document.getElementById('threadlist')) { // < 部分论坛的各板块 URL 是自定义的 >
  3249. curSite = DBSite.discuz_forum;
  3250. } else if (document.getElementById('postlist')) { // < 部分论坛的帖子内 URL 是自定义的 >
  3251. if (GM_getValue('menu_discuz_thread_page')) {
  3252. curSite = DBSite.discuz_thread;
  3253. hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
  3254. }
  3255. }
  3256. }
  3257. // < 所有 Flarum 论坛 >
  3258. } else if (webType === 3) {
  3259. DBSite.flarum.functionStart()
  3260. // < 所有使用 WordPress DUX 主题的网站 >
  3261. } else if (webType === 4) {
  3262. if (location.pathname.indexOf('.html') === -1) curSite = DBSite.dux;
  3263. if (location.host === 'apphot.cc') curSite.pager.scrollDelta = 2500; // 对于速度慢的网站,需要增加翻页敏感度
  3264. }
  3265. }
  3266.  
  3267. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  3268. pausePageEvent(); // 左键双击网页空白处暂停翻页
  3269.  
  3270. if (locationchange) { // 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则
  3271. nowLocation = location.href
  3272. addLocationchange(); // 自定义 locationchange 事件
  3273. if (webType === 1) {
  3274. window.addEventListener('locationchange', function(){
  3275. if (nowLocation != location.href) {
  3276. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  3277. registerMenuCommand(); // 重新判断规则
  3278. curSite.pageUrl = ''; // 下一页URL
  3279. pageLoading(); // 自动无缝翻页
  3280.  
  3281. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  3282. pausePageEvent(); // 左键双击网页空白处暂停翻页
  3283. }
  3284. })
  3285. } else if (webType === 3) {
  3286. window.addEventListener('locationchange', function(){
  3287. if (nowLocation != location.href) {
  3288. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  3289. DBSite.flarum.functionStart(); // 重新判断规则
  3290. pageLoading(); // 自动无缝翻页
  3291.  
  3292. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  3293. pausePageEvent(); // 左键双击网页空白处暂停翻页
  3294. }
  3295. })
  3296. }
  3297. }
  3298.  
  3299. curSite.pageUrl = ''; // 下一页URL
  3300. //console.log(curSite);
  3301. pageLoading(); // 自动无缝翻页
  3302.  
  3303.  
  3304. // [Discuz! 论坛] 隐藏帖子内的 [下一页] 按钮
  3305. function hidePgbtn() {
  3306. document.lastElementChild.appendChild(document.createElement('style')).textContent = '.pgbtn {display: none;}';
  3307. }
  3308. // [Discuz! 论坛] 图片模式列表样式预处理
  3309. function waterfallStyle() {
  3310. let width = document.querySelector('#waterfall > li:first-child').style.width;
  3311. 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;}`;
  3312. }
  3313. // [Discuz! 论坛] 的插入前函数(加载图片,仅部分论坛)
  3314. function discuz_thread_functionBefore(pageElems) {
  3315. if (location.hostname === 'bbs.pcbeta.com') { // 仅部分论坛需要处理
  3316. pageElems.forEach(function (one) {
  3317. one.querySelectorAll('img[file]').forEach(function (now) {
  3318. now.src = now.getAttribute('file');
  3319. });
  3320. });
  3321. }
  3322. return pageElems
  3323. }
  3324.  
  3325.  
  3326. // 通用型插入前函数(加载图片 data-original => src)
  3327. function src_original_functionBefore(pageElems) {
  3328. pageElems.forEach(function (one) {
  3329. let now = one.querySelector('img[data-original]')
  3330. if (now) {
  3331. now.src = now.dataset.original;
  3332. }
  3333. });
  3334. return pageElems
  3335. }
  3336. // 通用型插入前函数(加载图片 data-src => src)
  3337. function src_src_functionBefore(pageElems) {
  3338. pageElems.forEach(function (one) {
  3339. let now = one.querySelector('img[data-src]')
  3340. if (now) {
  3341. now.src = now.dataset.src;
  3342. }
  3343. });
  3344. return pageElems
  3345. }
  3346.  
  3347.  
  3348. // [DUX] 的插入前函数(加载图片)
  3349. function dux_functionBefore(pageElems) {
  3350. pageElems.forEach(function (one) {
  3351. let now = one.querySelector('img.thumb[data-src]')
  3352. if (now) {now.src = now.dataset.src;}
  3353. });
  3354. return pageElems
  3355. }
  3356.  
  3357.  
  3358. // [头条搜索] 的插入前函数(过滤相关搜索)
  3359. function toutiao_functionBefore(pageElems) {
  3360. for (let i = 0; i < pageElems.length; i++) {
  3361. let now = pageElems[i].querySelector('div[class*="-header"]')
  3362. if (now && now.textContent === '相关搜索') {
  3363. pageElems.splice(i,1)
  3364. }
  3365. }
  3366. return pageElems
  3367. }
  3368.  
  3369.  
  3370. // [360搜索] 的插入前函数(加载图片)
  3371. function so_functionBefore(pageElems) {
  3372. pageElems.forEach(function (one) {
  3373. one.querySelectorAll('img[data-isrc]').forEach(function (now) {
  3374. now.src = now.dataset.isrc;
  3375. now.className = now.className.replace('so-lazyimg','');
  3376. });
  3377. });
  3378. return pageElems
  3379. }
  3380.  
  3381.  
  3382. // [百度贴吧](发帖按钮点击事件)
  3383. function baidu_tieba_1() {
  3384. let button = document.querySelector('.tbui_aside_fbar_button.tbui_fbar_post > a');
  3385. if (button) {
  3386. button.remove();
  3387. 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>')
  3388. button = document.querySelector('.tbui_aside_fbar_button.tbui_fbar_post > a');
  3389. if (button) {
  3390. button.onclick = function(){
  3391. let button2 = document.querySelector('div.edui-btn.edui-btn-fullscreen.edui-btn-name-portrait');
  3392. if (button2) {
  3393. button2.click();
  3394. } else {
  3395. alert('提示:登录后才能发帖!');
  3396. }
  3397. return false;
  3398. }
  3399. }
  3400. }
  3401. }
  3402. // [百度贴吧] 的插入前函数(加载图片)
  3403. function baidu_tieba_functionBefore(pageElems) {
  3404. pageElems.forEach(function (one) {
  3405. one.querySelectorAll('img.threadlist_pic[data-original]').forEach(function (now) {
  3406. now.src = now.dataset.original;
  3407. now.style.display = 'inline';
  3408. })
  3409. });
  3410. return pageElems
  3411. }
  3412. // [百度贴吧] 获取下一页地址
  3413. function baidu_tieba_functionNext() {
  3414. let next = document.querySelector('a.next.pagination-item[href]');
  3415. if (next != null && next.nodeType === 1 && next.href && next.href.slice(0,4) === 'http') {
  3416. var url = next.href + '&pagelets=frs-list%2Fpagelet%2Fthread&pagelets_stamp=' + new Date().getTime();
  3417. if (url === curSite.pageUrl) return
  3418. curSite.pageUrl = url;
  3419. getPageElems(curSite.pageUrl);
  3420. };
  3421. }
  3422. // [百度贴吧] 插入数据
  3423. function baidu_tieba_insertElement(newBody, type) {
  3424. if (!newBody) return
  3425. let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody),
  3426. toElement = getAllElements(curSite.pager.insertPosition[0])[0];
  3427. if (pageElems.length >= 0) {
  3428. // 执行插入前函数
  3429. pageElems = curSite.function.before(pageElems);
  3430. // 插入位置
  3431. let addTo1 = addTo(curSite.pager.insertPosition[1]);
  3432. // 获取 <script> 内容
  3433. const scriptElems = getAllElements('//script', newBody, newBody);
  3434. let scriptText = '';
  3435. for (let i = 0; i < scriptElems.length; i++) {
  3436. if (scriptElems[i].textContent.indexOf('Bigpipe.register("frs-list/pagelet/thread_list"') > -1) {
  3437. scriptText = scriptElems[i].textContent.replace('Bigpipe.register("frs-list/pagelet/thread_list", ','');
  3438. break
  3439. }
  3440. }
  3441. if (scriptText) {
  3442. scriptText = scriptText.slice(0, scriptText.indexOf(').')) // 获取主体内容
  3443. let scriptJSON = JSON.parse(scriptText).content; // 字符串转 JSON
  3444. var temp_baidu_tieba = document.createElement('div'); temp_baidu_tieba.innerHTML = scriptJSON; // 字符串转 Element 元素
  3445. pageElems = curSite.function.before(getAllElements(curSite.pager.pageElement, temp_baidu_tieba, temp_baidu_tieba)); // 插入前执行函数
  3446. pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo1, one);}); // 插入元素
  3447. // 当前页码 + 1
  3448. pageNum.now = pageNum._now + 1
  3449. // 替换元素
  3450. let oriE = document.querySelectorAll(curSite.pager.pageElement.replace('css;', '')),
  3451. repE = getAllElements(curSite.pager.replaceE, temp_baidu_tieba, temp_baidu_tieba);
  3452. if (oriE.length === repE.length) {
  3453. for (let i = 0; i < oriE.length; i++) {
  3454. oriE[i].outerHTML = repE[i].outerHTML;
  3455. }
  3456. }
  3457. }
  3458. }
  3459. }
  3460.  
  3461.  
  3462. // [NGA(玩家社区)] 的插入后函数(加载各版块帖子列表样式)
  3463. function nga_thread_functionAfter() {
  3464. document.body.appendChild(document.createElement('script')).textContent = 'commonui.topicArg.loadAll();';
  3465. }
  3466.  
  3467.  
  3468. // [V2EX] 的插入后函数(新标签页打开链接)
  3469. function v2ex_functionAfter(css) {
  3470. let links = document.querySelectorAll(css);if (!links) return
  3471. links.forEach(function (_this) {_this.target = '_blank';});
  3472. }
  3473.  
  3474.  
  3475. // [龙的天空] 获取下一页地址
  3476. function lkong_functionNext() {
  3477. let next = document.querySelector('li.ant-pagination-next'), page;
  3478. if (next && next.getAttribute('aria-disabled') === 'false') {
  3479. page = document.querySelector('li.ant-pagination-item-active[title]');
  3480. if (page && page.title) {
  3481. if (curSite.pager.intervals) {
  3482. let _SiteTypeID = curSite.SiteTypeID; curSite.SiteTypeID = 0;
  3483. setTimeout(function(){curSite.SiteTypeID = _SiteTypeID;}, curSite.pager.intervals)
  3484. }
  3485. return (location.origin + location.pathname + '?page=' + ++page.title);
  3486. }
  3487. }
  3488. return '';
  3489. }
  3490.  
  3491.  
  3492. // [千图网] 的插入前函数(加载图片)
  3493. function _58pic_functionBefore(pageElems) {
  3494. let is_one = document.querySelector('.qtw-card.place-box.is-one');
  3495. if (is_one && is_one.style.display != 'none') {is_one.style.display = 'none';}
  3496. pageElems.forEach(function (one) {
  3497. let now = one.querySelector('img.lazy')
  3498. if (now && now.getAttribute('src') != now.dataset.original) {
  3499. now.src = now.dataset.original;
  3500. now.style.display = 'block';
  3501. }
  3502. });
  3503. return pageElems
  3504. }
  3505.  
  3506.  
  3507. // [Pixabay] 的插入前函数(加载图片)
  3508. function pixabay_functionBefore(pageElems) {
  3509. pageElems.forEach(function (one) {
  3510. let now = one.querySelector('img[data-lazy-src]')
  3511. if (now) {
  3512. now.src = now.dataset.lazySrc;
  3513. now.removeAttribute('data-lazy-src')
  3514. now.removeAttribute('data-lazy-srcset')
  3515. }
  3516. });
  3517. return pageElems
  3518. }
  3519.  
  3520.  
  3521. // [3DM MOD] 获取下一页地址
  3522. function _3dmgame_mod_functionNext() {
  3523. let nextNum = getElementByXpath('//li[@class="page-list active"]/following-sibling::li[contains(@class, "page-list")]/a');
  3524. var url = '';
  3525. if (nextNum && nextNum.textContent) {
  3526. nextNum = 'Page=' + nextNum.textContent;
  3527. if (location.search) {
  3528. let search = location.search.replace(/(&)?Page=\d+(&)?/, '');
  3529. if (search === '?') {
  3530. url += location.origin + location.pathname + search + nextNum;
  3531. } else {
  3532. url += location.origin + location.pathname + search + '&' + nextNum;
  3533. }
  3534. } else {
  3535. url += location.origin + location.pathname + '?' + nextNum;
  3536. }
  3537. }
  3538. //console.log(url)
  3539. return url
  3540. }
  3541.  
  3542.  
  3543. // [游民星空-攻略] 的插入前函数(移除下一页底部的 "更多相关内容请关注:xxx" 文字)
  3544. function gamersky_gl_functionBefore(pageElems) {
  3545. pageElems.forEach(function (one) {
  3546. if (one.tagName === 'P' && one.textContent.indexOf('更多相关内容请关注') > -1) {one.style.display = 'none';}
  3547. });
  3548. return pageElems
  3549. }
  3550.  
  3551.  
  3552. // [NexusMods] 获取下一页地址
  3553. function nexusmods_functionNext() {
  3554. if (document.querySelector('.nexus-ui-blocker')) return
  3555. let modList;
  3556. if (location.pathname.indexOf('/news') > -1) {modList = RH_NewsTabContent;} else {modList = RH_ModList;}
  3557. let out_items = JSON.stringify(modList.out_items).replace(/{|}|"/g,''),
  3558. nextNum = getElementByXpath('//div[contains(@class, "pagenav")][1]//a[contains(@class, "page-selected")]/parent::li/following-sibling::li/a'),
  3559. categories = modList.out_items.categories, categoriesUrl = '';
  3560. var url = '';
  3561. if (nextNum && nextNum.innerText) {
  3562. nextNum = nextNum.innerText;
  3563. if (out_items.indexOf('page:') > -1) {
  3564. out_items = out_items.replace(/page:\d+/, `page:${nextNum}`)
  3565. } else {
  3566. out_items += `,page:${nextNum}`;
  3567. }
  3568. if (categories && categories != []) {
  3569. for (let i = 0; i < categories.length; i++) {
  3570. categoriesUrl += `,categories[]:${categories[i]}`
  3571. }
  3572. categoriesUrl = categoriesUrl.replace(/,/,'');
  3573. if (out_items.indexOf('categories:') > -1) {
  3574. out_items = out_items.replace(/categories:\[.*\]/, categoriesUrl)
  3575. }
  3576. }
  3577. url = `https://www.nexusmods.com${modList.uri}?RH_${modList.id}=${out_items}`
  3578. //console.log(nextNum, url, curSite.pageUrl, out_items)
  3579. if (url === curSite.pageUrl) return
  3580. curSite.pageUrl = url;
  3581. //console.log(nextNum, curSite.pageUrl, out_items)
  3582. getPageElems(curSite.pageUrl)
  3583. }
  3584. }
  3585. // [NexusMods] 插入数据
  3586. function nexusmods_insertElement(newBody, type) {
  3587. if (!newBody) return
  3588. let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody), // 主体元素
  3589. toElement = getAllElements(curSite.pager.insertPosition[0])[0], // 插入位置的元素
  3590. addTo1 = addTo(curSite.pager.insertPosition[1]); // 插入位置
  3591. // 添加下载数据
  3592. pageElems.forEach(function (one) {
  3593. let now = one.querySelector('.mod-tile-left');
  3594. if (now) {
  3595. let downloadCount = now.querySelector('.downloadcount > span.flex-label');
  3596. if (downloadCount) {
  3597. console.log(now.dataset.gameId, now.dataset.modId)
  3598. if (GlobalModStats[now.dataset.gameId] && GlobalModStats[now.dataset.gameId][now.dataset.modId]) {
  3599. downloadCount.textContent = shortFormat(parseInt(GlobalModStats[now.dataset.gameId][now.dataset.modId].total));
  3600. }
  3601. }
  3602. }
  3603. });
  3604. // 插入网页
  3605. pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo1, one);});
  3606. // 当前页码 + 1
  3607. pageNum.now = pageNum._now + 1
  3608. // 替换元素
  3609. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  3610. repE = getAllElements(curSite.pager.replaceE, newBody, newBody);
  3611. if (oriE.length === repE.length) {
  3612. for (let i = 0; i < oriE.length; i++) {
  3613. oriE[i].outerHTML = repE[i].outerHTML;
  3614. }
  3615. }
  3616. }
  3617.  
  3618.  
  3619. // [cs_rin_ru] 各版块帖子列表的插入前函数(过滤置顶帖子)
  3620. function cs_rin_ru_functionBefore(pageElems) {
  3621. for (let i = 0; i < pageElems.length; i++) {
  3622. if (pageElems[i].textContent.replace(/\n| /g,'') === 'Topics') {
  3623. pageElems.splice(0,i+1);
  3624. break;
  3625. }
  3626. }
  3627. return pageElems
  3628. }
  3629.  
  3630.  
  3631. // [片库] 的插入前函数(加载图片)
  3632. function pianku_functionBefore(pageElems) {
  3633. pageElems.forEach(function (one) {
  3634. let now = one.querySelector('img')
  3635. if (now) {
  3636. now.src = now.dataset.src;
  3637. }
  3638. });
  3639. return pageElems
  3640. }
  3641.  
  3642.  
  3643. // [奈菲影视/在线之家/真不卡影院] 的插入前函数(加载图片)
  3644. function nfmovies_functionBefore(pageElems) {
  3645. pageElems.forEach(function (one) {
  3646. let now = one.querySelector('a.lazyload')
  3647. if (now) {
  3648. now.style.backgroundImage = 'url("' + now.dataset.original + '")';
  3649. }
  3650. });
  3651. return pageElems
  3652. }
  3653.  
  3654.  
  3655. // [SkrBT] 获取下一页地址
  3656. function skrbt_functionNext() {
  3657. let page = document.querySelector('a[onclick][aria-label="Next"]');
  3658. if (page) {page = /(?<=\()\d+(?=\))/.exec(page.onclick)[0];} else {return '';} // 获取下一页页码
  3659. if (page) {
  3660. let action = document.getElementById('search-form').action, value = ''; // 获取提交表单 URL
  3661. document.querySelectorAll('#search-form input[name]').forEach(function(input) { // 生成表单参数
  3662. value += input.name + '=' + input.value + '&'
  3663. })
  3664. value = encodeURI(value.replace(/&$/,'').replace(/p=\d+/,'p=' + page)); // 清理最后一个 & 符号,并替换页码
  3665. if (action && value) {
  3666. //console.log(action + '?' + value)
  3667. return (action + '?' + value)
  3668. }
  3669. }
  3670. return '';
  3671. }
  3672.  
  3673.  
  3674. // [BTHaha] 的插入前函数(加载图片)
  3675. function bthaha_functionBefore(pageElems) {
  3676. pageElems.forEach(function (one) {
  3677. let now = one.querySelector('[id^="list_top"], [id^="list_bottom"]')
  3678. if (now) {one.hidden = true;}
  3679. });
  3680. return pageElems
  3681. }
  3682.  
  3683.  
  3684. // [射手网] 获取下一页地址
  3685. function assrt_functionNext() {
  3686. let nextXPAHT = '//a[@id="pl-nav"][@href][contains(text(), ">")]'
  3687. let url = getElementByXpath(nextXPAHT);
  3688. if (url) {
  3689. url = /(?<=\()\d+(?=,)/.exec(url.href)[0]
  3690. if (url) {
  3691. return (location.origin + location.pathname + location.search.replace(/(&)?page=\d+$/,'') + '&page=' + url);
  3692. }
  3693. }
  3694. return '';
  3695. }
  3696.  
  3697.  
  3698. // [不死鸟] 的插入前函数(加载图片)
  3699. function iao_su_functionBefore(pageElems) {
  3700. pageElems.forEach(function (one) {
  3701. let now = one.getElementsByClassName('post-card')[0]
  3702. if (now) {
  3703. now.getElementsByClassName('blog-background')[0].style.backgroundImage = 'url("' + now.getElementsByTagName('script')[0].textContent.split("'")[1] + '")';
  3704. //now.getElementsByClassName('blog-background')[0].style.backgroundImage = 'url("' + RegExp("(?<=loadBannerDirect\\(').*(?=', '',)").exec(now.getElementsByTagName('script')[0].textContent)[0]; + '")';
  3705. }
  3706. });
  3707. return pageElems
  3708. }
  3709.  
  3710.  
  3711. // [异次元软件世界] 的插入前函数(加载图片)
  3712. function iplaysoft_postslist_functionBefore(pageElems) {
  3713. pageElems.forEach(function (one) {
  3714. let now = one.querySelector('img.lazyload')
  3715. if (now && !now.src) {
  3716. now.src = now.dataset.src;
  3717. now.setAttribute('srcset', now.dataset.src)
  3718. now.setAttribute('class', 'lazyloaded')
  3719. }
  3720. });
  3721. return pageElems
  3722. }
  3723.  
  3724.  
  3725. // [LRepacks] 的插入前函数(调整 class)
  3726. function lrepacks_functionBefore(pageElems) {
  3727. pageElems.forEach(function (one) {
  3728. let now = one.querySelector('.slideUp, .elementFade')
  3729. if (now) {
  3730. now.className = now.className.replace('slideUp','slideUpRun').replace('elementFade','elementFadeRun');
  3731. }
  3732. });
  3733. return pageElems
  3734. }
  3735.  
  3736.  
  3737. // [必应壁纸] 的插入前函数(加载图片)
  3738. function ioliu_functionBefore(pageElems) {
  3739. pageElems.forEach(function (one) {
  3740. let now = one.querySelector('img.progressive--not-loaded')
  3741. if (now) {
  3742. now.className = now.className.replace('progressive--not-loaded','progressive--is-loaded');
  3743. }
  3744. });
  3745. return pageElems
  3746. }
  3747.  
  3748.  
  3749. // [漫画狂] 获取下一页地址
  3750. function cartoonmad_functionNext() {
  3751. let nextXPAHT = '//a[@class="pages"][contains(text(),"下一頁")]',
  3752. nextPXPATH = '//a[@class="pages"][contains(string(),"下一話")]'
  3753. let url = getElementByXpath(nextXPAHT);
  3754. if (url) {
  3755. if (url.getAttribute('href') === 'thend.asp') {
  3756. url = getElementByXpath(nextPXPATH)
  3757. if (url) return url.href;
  3758. pausePage = false;
  3759. GM_notification({text: `注意:该网站早期漫画(如海贼王、柯南)因为网站自身问题而无法翻至下一话(仅限于显示为 [第 X 卷]/[下一卷] 的)。\n因此需要手动去 [目录页] 进入下一卷!`, timeout: 10000});
  3760. } else {
  3761. return url.href;
  3762. }
  3763. }
  3764. return '';
  3765. }
  3766.  
  3767.  
  3768. // [漫画猫] 初始化(显示本话所以图片)
  3769. function manhuacat_init() {
  3770. let _img = '';
  3771. for (let now of img_data_arr) {
  3772. _img += `<img src="${asset_domain}${img_pre}${now}">`;
  3773. }
  3774. document.querySelector('.img-content > img').remove();
  3775. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3776.  
  3777. }
  3778. // [漫画猫] 获取下一页地址
  3779. function manhuacat_functionNext(pageElems, type) {
  3780. if (type === 'url') {
  3781. if(pageElems.code == '0000') {
  3782. if (pageElems.url === curSite.pageUrl) return
  3783. curSite.pageUrl = pageElems.url;
  3784. getPageElems(curSite.pageUrl); // 真正的下一页链接
  3785. }
  3786. } else {
  3787. let vg_r_data = document.querySelector('.vg-r-data');
  3788. if (vg_r_data) {
  3789. 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');
  3790. }
  3791. }
  3792. }
  3793. // [漫画猫] 插入数据
  3794. function manhuacat_insertElement(pageElems, type) {
  3795. if (!pageElems) return
  3796. if (type === 'url') { // 获取下一页链接
  3797. manhuacat_functionNext(pageElems, type); return
  3798. }
  3799.  
  3800. // 添加历史记录
  3801. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  3802.  
  3803. // 替换元素
  3804. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  3805. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  3806. if (oriE.length === repE.length) {
  3807. for (let i = 0; i < oriE.length; i++) {
  3808. oriE[i].outerHTML = repE[i].outerHTML;
  3809. }
  3810. }
  3811.  
  3812. // 插入图片
  3813. 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');;
  3814. for (let now of _img_arr) {
  3815. _img += `<img src="${vg_r_data.dataset.chapterDomain}${img_pre}${now}">`;
  3816. }
  3817. if (_img) {
  3818. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3819. // 当前页码 + 1
  3820. pageNum.now = pageNum._now + 1
  3821. }
  3822. }
  3823.  
  3824.  
  3825. // [漫画DB] 初始化(将本话其余图片插入网页中)
  3826. function manhuadb_init() {
  3827. let _img = '',
  3828. data = document.querySelector('.vg-r-data'), imgDate;
  3829. if (!data) return
  3830. document.querySelectorAll(curSite.pager.pageElement.replace('css;', '')).forEach(function (one) {
  3831. if (one.tagName === 'SCRIPT' && one.textContent.indexOf('var img_data =') > -1) {
  3832. let json = JSON.parse(window.atob(one.textContent.split("'")[1]));
  3833. if (json) {
  3834. let _img = '';
  3835. for (let i = 0; i < json.length; i++) { // 遍历图片文件名数组,组合为 img 标签
  3836. let src = data.dataset.host + data.dataset.img_pre + json[i].img;
  3837. _img += `<img class="img-fluid show-pic" src="${src}">`
  3838. }
  3839. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3840. }
  3841. }
  3842. })
  3843. }
  3844. // [漫画DB] 获取下一页地址
  3845. function manhuadb_functionNext() {
  3846. let nextArr = document.querySelectorAll('a.fixed-a-es'), next;
  3847. var url = '';
  3848. if (nextArr.length == 0) return
  3849. for (let i = 0; i < nextArr.length; i++) {
  3850. if (nextArr[i].className.indexOf('active') > -1) {
  3851. if (nextArr[i+1]) url = nextArr[i+1].href;
  3852. break;
  3853. }
  3854. }
  3855. if (url === curSite.pageUrl) return
  3856. curSite.pageUrl = url
  3857. getPageElems(curSite.pageUrl);
  3858. }
  3859. // [漫画DB] 插入数据
  3860. function manhuadb_insertElement(pageElems, type) {
  3861. if (!pageElems) return
  3862. let oriE = document.querySelectorAll(curSite.pager.pageElement.replace('css;', '')),
  3863. repE = getAllElements(curSite.pager.pageElement, pageElems, pageElems);
  3864. if (oriE.length === repE.length) {
  3865. for (let i = 0; i < oriE.length; i++) {
  3866. oriE[i].outerHTML = repE[i].outerHTML;
  3867. }
  3868. // 当前页码 + 1
  3869. pageNum.now = pageNum._now + 1
  3870. manhuadb_init(); // 将刚刚替换的图片插入网页中
  3871. }
  3872. }
  3873.  
  3874.  
  3875. // [HiComic(嗨漫画)] 初始化(将本话其余图片插入网页中)
  3876. function hicomic_init() {
  3877. let _img = '';
  3878. document.querySelectorAll('.chapter > section:not(:first-child) > section[val]').forEach(function (one) {
  3879. let src = one.getAttribute('val');
  3880. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h'
  3881. _img += `<img src="${src}">`
  3882. })
  3883. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3884. window.document.title = window.document.title.replace(/(\(第.+\))? - HiComic/, `(${document.querySelector('.chapter_name').textContent}) - HiComic`); // 修改网页标题(加上 第 X 话)
  3885. }
  3886. // [HiComic(嗨漫画)] 获取下一页地址
  3887. function hicomic_functionNext() {
  3888. let nextId;
  3889. nextId = document.querySelector('.next_chapter:not(.end)')
  3890. if (nextId && nextId.id && nextId.id != 'None') {
  3891. curSite.pageUrl = location.href;
  3892. getPageElems(`https://www.hicomic.net/api/web/chapter/${nextId.id}/contents`, 'json');
  3893. }
  3894. }
  3895. // [HiComic(嗨漫画)] 插入数据
  3896. function hicomic_insertElement(pageElems, type) {
  3897. if (!pageElems || pageElems.code != 200) return
  3898. if (pageElems.results.chapter.next) { // 写入下一页的 UUID
  3899. document.querySelector('.next_chapter').id = pageElems.results.chapter.next;
  3900. } else {
  3901. document.querySelector('.next_chapter').id = 'None';
  3902. document.querySelector('.next_chapter').classList.add('end');
  3903. }
  3904. document.querySelector('.chapter_name').textContent = pageElems.results.chapter.name; // 修改漫画标题
  3905. let title = window.document.title.replace(/(\(第.+\))? - HiComic/, `(${pageElems.results.chapter.name}) - HiComic`)
  3906. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, title, curSite.pageUrl); // 添加历史记录
  3907. window.document.title = title; // 修改当前网页标题为下一话的标题
  3908. let _img = '';
  3909. for (let i = 0; i < pageElems.results.chapter.contents.length; i++) { // 遍历图片文件名数组,组合为 img 标签
  3910. let src = pageElems.results.chapter.contents[i].url;
  3911. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h';
  3912. _img += `<img src="${src}">`
  3913. }
  3914. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3915. // 当前页码 + 1
  3916. pageNum.now = pageNum._now + 1
  3917. }
  3918.  
  3919.  
  3920. // [动漫之家] 初始化(调整本话其余图片)
  3921. function dmzj_init() {
  3922. let _img = '';
  3923. document.querySelectorAll('.comic_wraCon > a > img').forEach(function (one) {
  3924. _img += `<img src="${one.dataset.original}">`;
  3925. one.parentElement.remove();
  3926. })
  3927. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3928.  
  3929. }
  3930. // [动漫之家] 获取下一页地址
  3931. function dmzj_functionNext() {
  3932. let next;
  3933. next = document.querySelector('span.next > a[href]')
  3934. if (next) {
  3935. if (next.href === curSite.pageUrl) return
  3936. curSite.pageUrl = next.href;
  3937. getPageElems(curSite.pageUrl);
  3938. }
  3939. }
  3940. // [动漫之家] 插入数据
  3941. function dmzj_insertElement(pageElems, type) {
  3942. if (!pageElems) return
  3943. // 插入并运行 <script>
  3944. let scriptElement = pageElems.querySelectorAll('head > script[type]:not([src])'), scriptText = '';
  3945. scriptElement.forEach(function (one) {scriptText += ';' + one.textContent;});
  3946. if (scriptText) document.body.appendChild(document.createElement('script')).textContent = scriptText;
  3947.  
  3948. // 插入图片
  3949. let _img = '', _img_arr;
  3950. if (pages.indexOf('|') === -1) {
  3951. _img_arr = JSON.parse(pages.replace(/\r\n/g,'|')).page_url.split('|');
  3952. } else {
  3953. _img_arr = JSON.parse(pages).page_url.split('|');
  3954. }
  3955. for (let now of _img_arr) {
  3956. _img += `<img src="${img_prefix}${now}">`;
  3957. }
  3958. if (_img) {
  3959. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3960.  
  3961. // 添加历史记录
  3962. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  3963.  
  3964. // 替换元素
  3965. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  3966. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  3967. if (oriE.length === repE.length) {
  3968. for (let i = 0; i < oriE.length; i++) {
  3969. oriE[i].outerHTML = repE[i].outerHTML;
  3970. }
  3971. // 当前页码 + 1
  3972. pageNum.now = pageNum._now + 1
  3973. }
  3974. }
  3975. }
  3976.  
  3977.  
  3978. // [动漫之家-漫画] 初始化(调整本话其余图片)
  3979. function dmzj_manhua_init() {
  3980. let _img = '';
  3981. document.querySelectorAll('#center_box > .inner_img img[src]').forEach(function (one) {
  3982. _img += `<img src="${one.dataset.original}">`;
  3983. one.parentElement.parentElement.remove();
  3984. })
  3985. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3986.  
  3987. }
  3988. // [动漫之家-漫画] 获取下一页地址
  3989. function dmzj_manhua_functionNext() {
  3990. let next;
  3991. next = document.getElementById('next_chapter')
  3992. if (next) {
  3993. if (next.href === curSite.pageUrl) return
  3994. curSite.pageUrl = next.href;
  3995. getPageElems(curSite.pageUrl);
  3996. }
  3997. }
  3998. // [动漫之家-漫画] 插入数据
  3999. function dmzj_manhua_insertElement(pageElems, type) {
  4000. if (!pageElems) return
  4001. // 插入并运行 <script>
  4002. let scriptElement = pageElems.querySelectorAll('head > script[type]:not([src])'), scriptText = '';
  4003. scriptElement.forEach(function (one) {scriptText += ';' + one.textContent;});
  4004. if (scriptText) document.body.appendChild(document.createElement('script')).textContent = scriptText;
  4005.  
  4006. // 插入图片
  4007. let _img = '';
  4008. for (let now of arr_pages) {
  4009. _img += `<img src="${img_prefix}${now}">`;
  4010. }
  4011. if (_img) {
  4012. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  4013.  
  4014. // 添加历史记录
  4015. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  4016.  
  4017. // 替换元素
  4018. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  4019. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  4020. if (oriE.length === repE.length) {
  4021. for (let i = 0; i < oriE.length; i++) {
  4022. oriE[i].outerHTML = repE[i].outerHTML;
  4023. }
  4024. // 当前页码 + 1
  4025. pageNum.now = pageNum._now + 1
  4026. }
  4027. }
  4028. }
  4029.  
  4030.  
  4031. // [拷贝漫画] 获取下一页地址
  4032. function copymanga_functionNext() {
  4033. let next;
  4034. next = document.querySelector('.comicContent-next > a[href]')
  4035. if (next) {
  4036. if (next.href === curSite.pageUrl) return
  4037. curSite.pageUrl = next.href;
  4038. getPageElems(curSite.pageUrl);
  4039. }
  4040. }
  4041. // [拷贝漫画] 插入数据
  4042. function copymanga_insertElement(pageElems, type) {
  4043. if (!pageElems) return
  4044. // 添加历史记录
  4045. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  4046. let oldImg = document.querySelector('.comicContent-image-list').innerHTML;
  4047.  
  4048. // 替换元素
  4049. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  4050. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  4051. if (oriE.length === repE.length) {
  4052. for (let i = 0; i < oriE.length; i++) {
  4053. oriE[i].outerHTML = repE[i].outerHTML;
  4054. }
  4055. // 插入并运行 <script>
  4056. document.body.appendChild(document.createElement('script')).src = document.querySelector('body > script[async][src*="comic_content_pass"]').src;
  4057. setTimeout(function(){
  4058. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), oldImg); // 将 img 标签插入到网页中
  4059. }, 100);
  4060. // 当前页码 + 1
  4061. pageNum.now = pageNum._now + 1
  4062. }
  4063. }
  4064.  
  4065.  
  4066. // [古风漫画网] 获取下一页地址
  4067. function gufengmh_functionNext() {
  4068. let pageElems = document.querySelector(curSite.pager.pageElement.replace('css;', '')); // 寻找数据所在元素
  4069. if (pageElems) {
  4070. let comicUrl, nextId;
  4071. var url = '';
  4072. pageElems.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  4073. //console.log(one)
  4074. if (one.indexOf('comicUrl') > -1) { // 下一页 URL 前半部分
  4075. comicUrl = one.split('"')[1];
  4076. } else if (one.indexOf('nextChapterData') > -1) { // 下一页 URL 的后半部分 ID
  4077. nextId = one.split('"id":')[1].split(',')[0];
  4078. }
  4079. })
  4080. if (comicUrl && nextId && nextId != 'null') { // 组合到一起就是下一页 URL
  4081. url = comicUrl + nextId + '.html'
  4082. if (url === curSite.pageUrl) return
  4083. curSite.pageUrl = url
  4084. getPageElems(curSite.pageUrl); // 访问下一页 URL 获取
  4085. }
  4086. }
  4087. }
  4088. // [古风漫画网] 插入数据
  4089. function gufengmh_insertElement(pageElems, type) {
  4090. if (pageElems) {
  4091. let url = curSite.pageUrl;
  4092. pageElems = getAllElements(curSite.pager.pageElement, pageElems, pageElems)[0];
  4093. let chapterImages, chapterPath;
  4094. document.querySelector(curSite.pager.pageElement.replace('css;', '')).innerText = pageElems.textContent; // 将当前网页内的数据所在元素内容改为刚刚获取的下一页数据内容,以便循环获取下一页 URL
  4095. pageElems.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  4096. //console.log(one)
  4097. if (one.indexOf('chapterImages') > -1) { // 图片文件名数组
  4098. chapterImages = one.replace(/^.+\[/, '').replace(']', '').replaceAll('"', '').split(',')
  4099. } else if (one.indexOf('chapterPath') > -1) { // 图片文件路径
  4100. chapterPath = one.split('"')[1];
  4101. } else if (one.indexOf('pageTitle') > -1) { // 网页标题
  4102. let title = one.split('"')[1];
  4103. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, title, url); // 添加历史记录
  4104. window.document.title = title; // 修改当前网页标题为下一页的标题
  4105. }
  4106. })
  4107. if (chapterImages && chapterPath) {
  4108. let _img = '';
  4109. chapterImages.forEach(function (one2){ // 遍历图片文件名数组,组合为 img 标签
  4110. _img += '<img src="https://res.xiaoqinre.com/' + chapterPath + one2 + '" data-index="0" style="display: inline-block;">'
  4111. })
  4112. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  4113. // 当前页码 + 1
  4114. pageNum.now = pageNum._now + 1
  4115. }
  4116. }
  4117. }
  4118.  
  4119.  
  4120. // [砂之船动漫家] 的插入前函数(加载图片)
  4121. function szcdmj_functionBefore(pageElems) {
  4122. pageElems.forEach(function (one) {
  4123. if (one.tagName === 'TITLE') {
  4124. let title = one.textContent;
  4125. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, title, curSite.pageUrl); // 添加历史记录
  4126. window.document.title = title; // 修改当前网页标题为下一页的标题
  4127. one.style.display = 'none';
  4128. } else {
  4129. let now = one.querySelector('img[data-original]')
  4130. if (now) {
  4131. now.src = now.dataset.original;
  4132. now.style.display = 'inline';
  4133. }
  4134. }
  4135. });
  4136. return pageElems
  4137. }
  4138.  
  4139.  
  4140. // [Mangabz 漫画] 初始化(调整本话图片)
  4141. function mangabz_init() {
  4142. pageNumber('del');
  4143. let showimage = document.getElementById('showimage'),
  4144. cp_img = document.getElementById('cp_img'),
  4145. cp_image = document.getElementById('cp_image');
  4146. if (showimage) {showimage.removeAttribute('oncontextmenu');}
  4147. if (cp_img) {cp_img.removeAttribute('oncontextmenu');}
  4148. if (cp_image) {
  4149. cp_image.removeAttribute('oncontextmenu');
  4150. cp_image.removeAttribute('id');
  4151. cp_image.removeAttribute('style');
  4152. }
  4153. }
  4154. // [Mangabz 漫画] 获取下一页地址
  4155. function mangabz_functionNext() {
  4156. var url = '';
  4157. if (MANGABZ_PAGE === MANGABZ_IMAGE_COUNT) { // 下一话
  4158. url = getElementByXpath('//a[./img[contains(@src, "icon_xiayizhang")]]')
  4159. if (url === curSite.pageUrl) return
  4160. curSite.pageUrl = url
  4161. //console.log(curSite.pageUrl)
  4162. getPageElems(curSite.pageUrl); // 访问下一话 URL 获取
  4163. } else { // 下一页
  4164. if (!mkey) var mkey = '';
  4165. url = location.origin + location.pathname + 'chapterimage.ashx' + `?cid=${MANGABZ_CID}&page=${MANGABZ_PAGE + 1}&key=${(mkey)}&_cid=${MANGABZ_CID}&_mid=${MANGABZ_MID}&_dt=${MANGABZ_VIEWSIGN_DT}&_sign=${MANGABZ_VIEWSIGN}`
  4166. if (url === curSite.pageUrl) return
  4167. curSite.pageUrl = url
  4168. //console.log(curSite.pageUrl)
  4169. getPageElems(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
  4170. }
  4171. }
  4172. // [Mangabz 漫画] 插入数据
  4173. function mangabz_insertElement(pageElems, type) {
  4174. if (pageElems) {
  4175. if (type === 'Next') {
  4176. let imgArr = eval(pageElems),
  4177. _img = '';
  4178. for (let now of imgArr) {
  4179. _img += `<img src="${now}">`;
  4180. }
  4181. if (_img) {
  4182. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  4183.  
  4184. // 添加历史记录
  4185. MANGABZ_PAGE += imgArr.length;
  4186. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, document.title, location.origin + MANGABZ_CURL.substring(0, MANGABZ_CURL.length - 1) + '-p' + MANGABZ_PAGE + '/');
  4187. }
  4188. } else {
  4189. // 插入 <script> 标签
  4190. let scriptElement = pageElems.querySelectorAll('html:not([dir]) > head > script:not([src])'), scriptText = '';
  4191. scriptElement.forEach(function (one) {scriptText += ';' + one.textContent;});
  4192. if (scriptText) {
  4193. document.body.appendChild(document.createElement('script')).textContent = scriptText;
  4194.  
  4195. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  4196.  
  4197. // 替换待替换元素
  4198. let oriE = getAllElements(curSite.pager.replaceE),
  4199. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  4200. if (oriE.length === repE.length) {
  4201. for (let i = 0; i < oriE.length; i++) {
  4202. oriE[i].outerHTML = repE[i].outerHTML;
  4203. }
  4204. }
  4205. MANGABZ_PAGE = 0;
  4206. mangabz_functionNext();
  4207. }
  4208. }
  4209. }
  4210. }
  4211.  
  4212.  
  4213. // 自动无缝翻页
  4214. function pageLoading() {
  4215. if (curSite.SiteTypeID > 0) {
  4216. windowScroll(function (direction, e) {
  4217. if (direction === 'down' && pausePage === true) { // 下滑/没有暂停翻页时,才准备翻页
  4218. let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop,
  4219. scrollHeight = window.innerHeight || document.documentElement.clientHeight,
  4220. scrollDelta = curSite.pager.scrollDelta;
  4221. if (curSite.pager.type === 3) { // <<<<< 翻页类型 3(依靠元素距离可视区域底部的距离来触发翻页)>>>>>
  4222. let scrollElement = document.querySelector(curSite.pager.scrollElement);
  4223. //console.log(scrollElement.offsetTop - (scrollTop + scrollHeight), scrollDelta, curSite.SiteTypeID)
  4224. if (scrollElement.offsetTop - (scrollTop + scrollHeight) <= scrollDelta) {
  4225. if (curSite.SiteTypeID === SiteType.GAMERSKY_GL) curSite.pager.scrollDelta -= 800 // 游民星空 gl 的比较奇葩,需要特殊处理下
  4226. ShowPager.loadMorePage();
  4227. }
  4228. } else {
  4229. if (document.documentElement.scrollHeight <= scrollHeight + scrollTop + scrollDelta) {
  4230. if (curSite.pager.type === 2) { // <<<<< 翻页类型 2(网站自带了自动无缝翻页功能,只需要点击下一页按钮即可)>>>>>
  4231. if (curSite.SiteTypeID > 0) { // 如果指定了间隔时间,那么就依靠这个判断时间到了没有~
  4232. let autopbn = document.querySelector(curSite.pager.nextLink);
  4233. if (autopbn) { // 寻找下一页链接
  4234. // 避免重复点击翻页按钮
  4235. if (curSite.pager.nextText) { // 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页
  4236. if (autopbn.innerText === curSite.pager.nextText) {autopbn.click(); pageNum.now = pageNum._now + 1;} // 当前页码 + 1
  4237. } else if (curSite.pager.nextTextOf) { // 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页
  4238. if (autopbn.innerText.indexOf(curSite.pager.nextTextOf) > -1) {autopbn.click(); pageNum.now = pageNum._now + 1;} // 当前页码 + 1
  4239. } else if (curSite.pager.nextHTML) { // 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页
  4240. if (autopbn.innerHTML === curSite.pager.nextHTML) {autopbn.click(); pageNum.now = pageNum._now + 1;} // 当前页码 + 1
  4241. } else { // 如果没有指定按钮文字就直接点击
  4242. autopbn.click(); pageNum.now = pageNum._now + 1; // 当前页码 + 1
  4243. // 对于没有按钮文字变化的按钮,可以指定间隔时间(默认 300ms)
  4244. if (!curSite.pager.intervals) {curSite.pager.intervals = 300;}
  4245. let _SiteTypeID = curSite.SiteTypeID; curSite.SiteTypeID = 0;
  4246. setTimeout(function(){curSite.SiteTypeID = _SiteTypeID;}, curSite.pager.intervals)
  4247. }
  4248. }
  4249. }
  4250. } else if (curSite.pager.type === 1) { // <<<<< 翻页类型 1(由脚本实现自动无缝翻页)>>>>>
  4251. if (curSite.SiteTypeID > 0) ShowPager.loadMorePage();
  4252. } else if (curSite.pager.type === 4) { // <<<<< 翻页类型 4(部分简单的动态加载类网站)>>>>>
  4253. if (curSite.SiteTypeID > 0) {
  4254. // 为百度贴吧的发帖考虑...
  4255. if (!(document.documentElement.scrollHeight <= scrollHeight + scrollTop + 200 && curSite.SiteTypeID === SiteType.BAIDU_TIEBA)) {
  4256. curSite.pager.nextLink();
  4257. }
  4258. if (curSite.pager.intervals) {
  4259. let _SiteTypeID = curSite.SiteTypeID;
  4260. curSite.SiteTypeID = 0;
  4261. setTimeout(function(){curSite.SiteTypeID = _SiteTypeID;}, curSite.pager.intervals)
  4262. }
  4263. }
  4264. }
  4265. }
  4266. }
  4267. }
  4268. });
  4269. }
  4270. }
  4271.  
  4272.  
  4273. // 启用/禁用 (当前网站)
  4274. function menu_disable(type) {
  4275. switch(type) {
  4276. case 'check':
  4277. if(check()) {return true;} else {return false;}; break;
  4278. case 'add':
  4279. add(); break;
  4280. case 'del':
  4281. del(); break;
  4282. }
  4283.  
  4284. function check() { // 存在返回真,不存在返回假
  4285. let list = GM_getValue('menu_disable'); // 读取网站列表
  4286. if (list.indexOf(location.host) === -1) return false // 不存在返回假
  4287. return true
  4288. }
  4289.  
  4290. function add() {
  4291. if (check()) return
  4292. let list = GM_getValue('menu_disable'); // 读取网站列表
  4293. list.push(location.host); // 追加网站域名
  4294. GM_setValue('menu_disable', list); // 写入配置
  4295. location.reload(); // 刷新网页
  4296. }
  4297.  
  4298. function del() {
  4299. if (!check()) return
  4300. let list = GM_getValue('menu_disable'), // 读取网站列表
  4301. index = list.indexOf(location.host);
  4302. list.splice(index, 1); // 删除网站域名
  4303. GM_setValue('menu_disable', list); // 写入配置
  4304. location.reload(); // 刷新网页
  4305. }
  4306. }
  4307.  
  4308.  
  4309. // 左键双击网页空白处暂停翻页
  4310. function pausePageEvent() {
  4311. if (!GM_getValue('menu_pause_page')) return
  4312. if (curSite.SiteTypeID === 0) return
  4313. document.body.addEventListener('dblclick', function () {
  4314. if (pausePage) {
  4315. pausePage = false;
  4316. GM_notification({text: `❌ 已暂停本页 [自动无缝翻页]\n (再次双击可恢复)`, timeout: 2000});
  4317. } else {
  4318. pausePage = true;
  4319. GM_notification({text: `✅ 已恢复本页 [自动无缝翻页]\n (再次双击可暂停)`, timeout: 2000});
  4320. }
  4321. });
  4322. }
  4323.  
  4324.  
  4325. // 显示页码
  4326. function pageNumber(type) {
  4327. if (curSite.SiteTypeID === 0) {let status = document.getElementById('Autopage_number');if (status) {status.style.display = 'none';}; return}
  4328. let status = document.getElementById('Autopage_number');
  4329. switch (type) {
  4330. case 'add':
  4331. add(); break;
  4332. case 'del':
  4333. del(); break;
  4334. case 'set':
  4335. set(); break;
  4336. }
  4337.  
  4338. function add(){
  4339. if (status) {
  4340. if (status.style.display === 'none') {status.style.display = 'flex';}
  4341. return
  4342. }
  4343. // 插入网页
  4344. 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>
  4345. <div id="Autopage_number" title="1. 此处数字为 [当前页码] (可在脚本菜单中关闭)&#10;&#10;2. 鼠标左键点击此处 [临时暂停本页自动无缝翻页](再次点击可恢复)">${pageNum._now}</div>`
  4346. document.body.insertAdjacentHTML('beforeend', _html);
  4347. // 点击事件(临时暂停翻页)
  4348. document.getElementById('Autopage_number').onclick = function () {
  4349. if (pausePage) {
  4350. pausePage = false; this.style = 'color: #FF5722 !important; font-style: italic !important;';
  4351. } else {
  4352. pausePage = true; this.style = '';
  4353. }
  4354. };
  4355. status = document.getElementById('Autopage_number');
  4356. set();
  4357. }
  4358. // 监听储存当前页码的对象值的变化
  4359. function set(){
  4360. Object.defineProperty(pageNum, 'now', {
  4361. set: function(value) {
  4362. this._now = value;
  4363. if (status) status.textContent = value;
  4364. }
  4365. });
  4366. }
  4367. function del(){
  4368. if (!status) return
  4369. status.style.display = 'none';
  4370. }
  4371. }
  4372.  
  4373.  
  4374. // 菜单开关
  4375. function menu_switch(menu_status, Name, Tips) {
  4376. if (menu_status === true){
  4377. GM_setValue(Name, false);
  4378. } else {
  4379. GM_setValue(Name, true);
  4380. }
  4381. if (Name === 'menu_page_number') {
  4382. if (menu_status === true){pageNumber('del');} else {pageNumber('add');}
  4383. registerMenuCommand(); // 重新注册脚本菜单
  4384. } else {
  4385. location.reload();}
  4386. };
  4387.  
  4388.  
  4389. // 生成 ID
  4390. function generateID() {
  4391. let num = 0
  4392. for (let val in DBSite) {
  4393. DBSite[val].SiteTypeID = num = num + 1;
  4394. }
  4395. }
  4396.  
  4397.  
  4398. // 判断是支持
  4399. function doesItSupport() {
  4400. setDBSite(); // 配置 DBSite 变量对象
  4401.  
  4402. // 遍历判断是否是某个已支持的网站,顺便直接赋值
  4403. let support = false;
  4404. for (let now in DBSite) { // 遍历对象
  4405. if (!DBSite[now].host) continue; // 如果不存在则继续下一个循环
  4406. if (Array.isArray(DBSite[now].host)) { // 如果是数组
  4407. for (let i of DBSite[now].host) { // 遍历数组
  4408. if (i === location.host) {
  4409. if (DBSite[now].functionStart) {
  4410. DBSite[now].functionStart();
  4411. } else {
  4412. curSite = DBSite[now];
  4413. }
  4414. support = true; break; // 如果找到了就退出循环
  4415. }
  4416. }
  4417. } else if (DBSite[now].host instanceof RegExp) {
  4418. if (DBSite[now].host.test(location.host)) {
  4419. if (self != top) {if (!DBSite[now].iframe) break;} // 如果当前位于 iframe 框架下,就需要判断是否需要执行
  4420. if (DBSite[now].functionStart) {
  4421. DBSite[now].functionStart();
  4422. } else {
  4423. curSite = DBSite[now];
  4424. }
  4425. support = true; break; // 如果找到了就退出循环
  4426. }
  4427. } else if (DBSite[now].host === location.host) {
  4428. if (self != top) {if (!DBSite[now].iframe) break;} // 如果当前位于 iframe 框架下,就需要判断是否需要执行
  4429. if (DBSite[now].functionStart) {
  4430. DBSite[now].functionStart();
  4431. } else {
  4432. curSite = DBSite[now];
  4433. }
  4434. support = true; break; // 如果找到了就退出循环
  4435. }
  4436. }
  4437.  
  4438. if (support) {
  4439. console.info('[自动无缝翻页] - 其他网站(独立规则)'); return 1;
  4440. } 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)) {
  4441. console.info('[自动无缝翻页] - Discuz! 论坛'); return 2;
  4442. } else if (document.getElementById('flarum-loading')) {
  4443. console.info('[自动无缝翻页] - Flarum 论坛'); return 3;
  4444. } else if (document.querySelector('link[href*="themes/dux" i], script[src*="themes/dux" i]')) {
  4445. console.info('[自动无缝翻页] - 使用 WordPress DUX 主题的网站'); return 4;
  4446. } else if (self != top) {
  4447. return -1;
  4448. }
  4449. return 0;
  4450. }
  4451.  
  4452.  
  4453. // 获取 Cookie
  4454. function getCookie(name) {
  4455. if (!name) return ''
  4456. let arr = document.cookie.split(';');
  4457. name += '='
  4458. for (let i=0; i<arr.length; i++) {
  4459. let now = arr[i].trim();
  4460. if (now.indexOf(name) == 0) return now.substring(name.length, now.length);
  4461. }
  4462. return '';
  4463. }
  4464.  
  4465.  
  4466. // 类型 4 专用
  4467. function getPageElems(url, type = '', method = 'GET', data = '', type2) {
  4468. //console.log(url, data)
  4469. let mimeType = '';
  4470. if (curSite.pager.mimeType) mimeType = curSite.pager.mimeType;
  4471. GM_xmlhttpRequest({
  4472. url: url,
  4473. method: method,
  4474. data: data,
  4475. responseType: type,
  4476. overrideMimeType: mimeType,
  4477. headers: {
  4478. 'Referer': location.href,
  4479. 'Content-Type': (method === 'POST') ? 'application/x-www-form-urlencoded':''
  4480. },
  4481. timeout: 5000,
  4482. onload: function (response) {
  4483. try {
  4484. //console.log('最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  4485. switch (type) {
  4486. case 'json':
  4487. curSite.pager.insertElement(response.response, type2);
  4488. break;
  4489. case 'text':
  4490. curSite.pager.insertElement(response.responseText, type2)
  4491. break;
  4492. default:
  4493. curSite.pager.insertElement(ShowPager.createDocumentByString(response.responseText), type2)
  4494. }
  4495. } catch (e) {
  4496. console.log(e);
  4497. }
  4498. }
  4499. });
  4500. }
  4501.  
  4502.  
  4503. // 插入位置
  4504. function addTo(num) {
  4505. switch (num) {
  4506. case 1:
  4507. return 'beforebegin'; break;
  4508. case 2:
  4509. return 'afterbegin'; break;
  4510. case 3:
  4511. return 'beforeend'; break;
  4512. case 4:
  4513. return 'afterend'; break;
  4514. }
  4515. }
  4516.  
  4517.  
  4518. // 滚动条事件
  4519. function windowScroll(fn1) {
  4520. var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  4521. fn = fn1 || function () {};
  4522. setTimeout(function () { // 延时 1 秒执行,避免刚载入到页面就触发翻页事件
  4523. window.addEventListener('scroll', function (e) {
  4524. var afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  4525. delta = afterScrollTop - beforeScrollTop;
  4526. if (delta == 0) return false;
  4527. fn(delta > 0 ? 'down' : 'up', e);
  4528. beforeScrollTop = afterScrollTop;
  4529. }, false);
  4530. }, 1000)
  4531. }
  4532.  
  4533.  
  4534. // 修改自 https://greasyfork.org/scripts/14178 , https://github.com/machsix/Super-preloader
  4535. var ShowPager = {
  4536. getFullHref: function (e) {
  4537. if (e != null && e.nodeType === 1 && e.href && e.href.slice(0,4) === 'http') {
  4538. if (curSite.pager.forceHTTPS && location.protocol === 'https:') {return e.href.replace(/^http:/,'https:');}
  4539. return e.href;
  4540. }
  4541. return '';
  4542. },
  4543. createDocumentByString: function (e) {
  4544. if (e) {
  4545. if ('HTML' !== document.documentElement.nodeName) return (new DOMParser).parseFromString(e, 'application/xhtml+xml');
  4546. var t;
  4547. try { t = (new DOMParser).parseFromString(e, 'text/html');} catch (e) {}
  4548. if (t) return t;
  4549. if (document.implementation.createHTMLDocument) {
  4550. t = document.implementation.createHTMLDocument('ADocument');
  4551. } else {
  4552. 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) {}
  4553. }
  4554. if (t) {
  4555. var r = document.createRange(),
  4556. n = r.createContextualFragment(e);
  4557. r.selectNodeContents(document.body);
  4558. t.body.appendChild(n);
  4559. 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);
  4560. return t;
  4561. }
  4562. } else console.error('没有找到要转成 DOM 的字符串');
  4563. },
  4564. loadMorePage: function () {
  4565. if (curSite.pager) {
  4566. var url;
  4567. if (typeof curSite.pager.nextLink == 'function') {
  4568. url = curSite.pager.nextLink();
  4569. } else {
  4570. if (curSite.pager.nextLink.slice(0,4) === 'css;') {
  4571. url = this.getFullHref(getElementByCSS(curSite.pager.nextLink.slice(4)));
  4572. } else {
  4573. url = this.getFullHref(getElementByXpath(curSite.pager.nextLink));
  4574. }
  4575. }
  4576. //console.log(url, curSite.pageUrl);
  4577. if (url === '') return;
  4578. if (curSite.pageUrl === url) return;// 避免重复加载相同的页面
  4579. curSite.pageUrl = url;
  4580. let mimeType = '';
  4581. if (curSite.pager.mimeType) mimeType = curSite.pager.mimeType;
  4582. // 读取下一页的数据
  4583. GM_xmlhttpRequest({
  4584. url: url,
  4585. method: 'GET',
  4586. overrideMimeType: mimeType,
  4587. headers: {
  4588. 'Referer': location.href
  4589. },
  4590. timeout: 5000,
  4591. onload: function (response) {
  4592. try {
  4593. //console.log('最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  4594. var newBody = ShowPager.createDocumentByString(response.responseText);
  4595. let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody),
  4596. toElement = getAllElements(curSite.pager.insertPosition[0])[0];
  4597. //console.log(curSite.pager.pageElement, pageElems, curSite.pager.insertPosition, toElement)
  4598.  
  4599. if (pageElems.length >= 0) {
  4600. // 如果有插入前函数就执行函数
  4601. if (curSite.function && curSite.function.before) {
  4602. if (curSite.function.parameter) { // 如果指定了参数
  4603. pageElems = curSite.function.before(curSite.function.parameter);
  4604. } else {
  4605. pageElems = curSite.function.before(pageElems);
  4606. }
  4607. }
  4608.  
  4609. // 插入位置
  4610. let addTo1 = addTo(curSite.pager.insertPosition[1]);
  4611.  
  4612. // 插入新页面元素
  4613. pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo1, one);});
  4614.  
  4615. // 当前页码 + 1
  4616. pageNum.now = pageNum._now + 1
  4617.  
  4618. // 插入 <script> 标签
  4619. if (curSite.pager.scriptType) {
  4620. let scriptText = '';
  4621. if (curSite.pager.scriptType === 1) { // 下一页的所有 <script> 标签
  4622. const scriptElems = getAllElements('//script', newBody, newBody);
  4623. scriptElems.forEach(function (one) {
  4624. if (one.src) {
  4625. toElement.appendChild(document.createElement('script')).src = one.src;
  4626. } else {
  4627. scriptText += ';' + one.textContent;
  4628. }
  4629. });
  4630. toElement.appendChild(document.createElement('script')).textContent = scriptText;
  4631. } else if (curSite.pager.scriptType === 2) { // 下一页主体元素同级 <script> 标签
  4632. pageElems.forEach(function (one) {if (one.tagName === 'SCRIPT') {scriptText += ';' + one.textContent;}});
  4633. if (scriptText) toElement.appendChild(document.createElement('script')).textContent = scriptText;
  4634. } else if (curSite.pager.scriptType === 3) { // 下一页主体元素同级 <script> 标签(远程文件)
  4635. pageElems.forEach(function (one) {if (one.tagName === 'SCRIPT' && one.src) {toElement.appendChild(document.createElement('script')).src = one.src;}});
  4636. } else if (curSite.pager.scriptType === 4) { // 下一页主体元素子元素 <script> 标签
  4637. pageElems.forEach(function (one) {
  4638. const scriptElems = one.querySelectorAll('script');
  4639. scriptElems.forEach(function (script) {scriptText += ';' + script.textContent;});
  4640. });
  4641. if (scriptText) toElement.appendChild(document.createElement('script')).textContent = scriptText;
  4642. }
  4643. }
  4644.  
  4645. // 添加历史记录
  4646. if (curSite.pager.history && curSite.pager.history == true) {
  4647. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, newBody.querySelector('title').textContent, curSite.pageUrl);
  4648. }
  4649.  
  4650. // 替换待替换元素
  4651. if (curSite.pager.replaceE) {
  4652. try {
  4653. let oriE = getAllElements(curSite.pager.replaceE),
  4654. repE = getAllElements(curSite.pager.replaceE, newBody, newBody);
  4655. //console.log(oriE, repE);
  4656. if (oriE.length === repE.length) {
  4657. for (let i = 0; i < oriE.length; i++) {
  4658. oriE[i].outerHTML = repE[i].outerHTML;
  4659. }
  4660. }
  4661. } catch (e) {
  4662. console.log(e);
  4663. }
  4664. }
  4665. // 如果有插入后函数就执行函数
  4666. if (curSite.function && curSite.function.after) {
  4667. if (curSite.function.parameter) { // 如果指定了参数
  4668. curSite.function.after(curSite.function.parameter);
  4669. } else {
  4670. curSite.function.after();
  4671. }
  4672. }
  4673. }
  4674. } catch (e) {
  4675. console.log(e);
  4676. }
  4677. }
  4678. });
  4679. }
  4680. },
  4681. };
  4682. function getElementByCSS(css, contextNode = document) {
  4683. return contextNode.querySelector(css);
  4684. }
  4685. function getAllElementsByCSS(css, contextNode = document) {
  4686. return [].slice.call(contextNode.querySelectorAll(css));
  4687. }
  4688. function getElementByXpath(xpath, contextNode, doc = document) {
  4689. contextNode = contextNode || doc;
  4690. try {
  4691. const result = doc.evaluate(xpath, contextNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  4692. // 应该总是返回一个元素节点
  4693. return result.singleNodeValue && result.singleNodeValue.nodeType === 1 && result.singleNodeValue;
  4694. } catch (err) {
  4695. throw new Error(`Invalid xpath: ${xpath}`);
  4696. }
  4697. }
  4698. function getAllElementsByXpath(xpath, contextNode, doc = document) {
  4699. contextNode = contextNode || doc;
  4700. const result = [];
  4701. try {
  4702. const query = doc.evaluate(xpath, contextNode, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  4703. for (let i = 0; i < query.snapshotLength; i++) {
  4704. const node = query.snapshotItem(i);
  4705. // 如果是 Element 节点
  4706. if (node.nodeType === 1) result.push(node);
  4707. }
  4708. } catch (err) {
  4709. throw new Error(`无效 Xpath: ${xpath}`);
  4710. }
  4711. return result;
  4712. }
  4713. function getAllElements(selector, contextNode = undefined, doc = document, win = window, _cplink = undefined) {
  4714. if (!selector) return [];
  4715. contextNode = contextNode || doc;
  4716. if (typeof selector === 'string') {
  4717. if (selector.search(/^css;/i) === 0) {
  4718. return getAllElementsByCSS(selector.slice(4), contextNode);
  4719. } else {
  4720. return getAllElementsByXpath(selector, contextNode, doc);
  4721. }
  4722. } else {
  4723. const query = selector(doc, win, _cplink);
  4724. if (!Array.isArray(query)) {
  4725. throw new Error('getAllElements 返回错误类型');
  4726. } else {
  4727. return query;
  4728. }
  4729. }
  4730. }
  4731.  
  4732. // 自定义 locationchange 事件(用来监听 URL 变化)
  4733. function addLocationchange() {
  4734. history.pushState = ( f => function pushState(){
  4735. var ret = f.apply(this, arguments);
  4736. window.dispatchEvent(new Event('pushstate'));
  4737. window.dispatchEvent(new Event('locationchange'));
  4738. return ret;
  4739. })(history.pushState);
  4740.  
  4741. history.replaceState = ( f => function replaceState(){
  4742. var ret = f.apply(this, arguments);
  4743. window.dispatchEvent(new Event('replacestate'));
  4744. window.dispatchEvent(new Event('locationchange'));
  4745. return ret;
  4746. })(history.replaceState);
  4747.  
  4748. window.addEventListener('popstate',()=>{
  4749. window.dispatchEvent(new Event('locationchange'))
  4750. });
  4751. }
  4752.  
  4753. /*// 监听 XMLHttpRequest URL
  4754. var _send = window.XMLHttpRequest.prototype.send
  4755. function sendReplacement(data) {
  4756. console.log(data)
  4757. return _send.apply(this, arguments);
  4758. }
  4759. window.XMLHttpRequest.prototype.send = sendReplacement;
  4760. // 监听 XMLHttpRequest 模式(GET/POST)和数据
  4761. var _open = window.XMLHttpRequest.prototype.open
  4762. function openReplacement(data) {
  4763. console.log(data, arguments)
  4764. return _open.apply(this, arguments);
  4765. }
  4766. window.XMLHttpRequest.prototype.open = openReplacement;*/
  4767. })();