自动无缝翻页

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

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

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