自动无缝翻页

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

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