自动无缝翻页

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

当前为 2021-10-01 提交的版本,查看 最新版本

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