自动无缝翻页

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

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