自动无缝翻页

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