自动无缝翻页

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

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