自动无缝翻页

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

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

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