自动无缝翻页

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

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

  1. // ==UserScript==
  2. // @name 自动无缝翻页
  3. // @version 2.6.0
  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;console.log(location.pathname.indexOf('/d/'));if (location.pathname.indexOf('/d/') === -1) {console.log(111);curSite = DBSite.flarum;}},
  190. pager: {
  191. type: 2,
  192. nextLink: '.DiscussionList-loadMore > button[title]',
  193. intervals: 500,
  194. scrollDelta: 1000
  195. }
  196. }, // 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('/search') > -1) {
  2705. if (!location.search) return
  2706. if (location.search.indexOf('type=Repositories') > -1 || location.search.indexOf('type=') === -1) {
  2707. curSite = DBSite.github_search;
  2708. } else if (location.search.indexOf('type=code') > -1) {
  2709. curSite = DBSite.github_search_code;
  2710. } else if (location.search.indexOf('type=commits') > -1) {
  2711. curSite = DBSite.github_search_commit;
  2712. } else if (location.search.indexOf('type=issues') > -1 || location.search.indexOf('type=discussions') > -1) {
  2713. curSite = DBSite.github_search_issue;
  2714. } else if (location.search.indexOf('type=registrypackages') > -1) {
  2715. curSite = DBSite.github_search_package;
  2716. } else if (location.search.indexOf('type=marketplace') > -1) {
  2717. curSite = DBSite.github_search_marketplace;
  2718. } else if (location.search.indexOf('type=topics') > -1) {
  2719. curSite = DBSite.github_search_topics;
  2720. } else if (location.search.indexOf('type=wikis') > -1) {
  2721. curSite = DBSite.github_search_wiki;
  2722. } else if (location.search.indexOf('type=users') > -1) {
  2723. curSite = DBSite.github_search_user;
  2724. }
  2725. }},
  2726. pager: {
  2727. type: 1,
  2728. nextLink: '//div[@class="paginate-container"]//a[@href][contains(text(), "Next")]',
  2729. pageElement: 'css;#js-pjax-container .position-relative div[class^="col-lg-"] > div:not(.position-relative):not(.paginate-container)',
  2730. insertPosition: ['css;.paginate-container', 1],
  2731. replaceE: 'css;.paginate-container',
  2732. scrollDelta: 3000
  2733. }
  2734. }, // Github - 用户 Star 列表
  2735. github_issues: {
  2736. SiteTypeID: 0,
  2737. pager: {
  2738. type: 1,
  2739. nextLink: 'css;a.next_page',
  2740. pageElement: 'css;.js-navigation-container.js-active-navigation-container > div[id^="issue_"]',
  2741. insertPosition: ['css;.js-navigation-container.js-active-navigation-container', 3],
  2742. replaceE: 'css;.pagination',
  2743. scrollDelta: 3000
  2744. }
  2745. }, // Github - Issues 列表 / PR 列表
  2746. github_discussions: {
  2747. SiteTypeID: 0,
  2748. pager: {
  2749. type: 1,
  2750. nextLink: 'css;a.next_page',
  2751. pageElement: 'css;#repo-content-pjax-container div[data-discussion-hovercards-enabled] > div',
  2752. insertPosition: ['css;#repo-content-pjax-container div[data-discussion-hovercards-enabled]', 3],
  2753. replaceE: 'css;.pagination',
  2754. scrollDelta: 3000
  2755. }
  2756. }, // Github - Discussions 列表
  2757. github_search: {
  2758. SiteTypeID: 0,
  2759. pager: {
  2760. type: 1,
  2761. nextLink: 'css;a.next_page',
  2762. pageElement: 'css;ul.repo-list > li',
  2763. insertPosition: ['css;ul.repo-list', 3],
  2764. replaceE: 'css;.pagination',
  2765. scrollDelta: 1500
  2766. }
  2767. }, // Github - Search 列表
  2768. github_search_code: {
  2769. SiteTypeID: 0,
  2770. pager: {
  2771. type: 1,
  2772. nextLink: 'css;a.next_page',
  2773. pageElement: 'css;.code-list > div',
  2774. insertPosition: ['css;.code-list', 3],
  2775. replaceE: 'css;.pagination',
  2776. scrollDelta: 1500
  2777. }
  2778. }, // Github - Search 列表 - Code
  2779. github_search_commit: {
  2780. SiteTypeID: 0,
  2781. pager: {
  2782. type: 1,
  2783. nextLink: 'css;a.next_page',
  2784. pageElement: 'css;#commit_search_results > div',
  2785. insertPosition: ['css;#commit_search_results', 3],
  2786. replaceE: 'css;.pagination',
  2787. scrollDelta: 1500
  2788. }
  2789. }, // Github - Search 列表 - Commit
  2790. github_search_issue: {
  2791. SiteTypeID: 0,
  2792. pager: {
  2793. type: 1,
  2794. nextLink: 'css;a.next_page',
  2795. pageElement: 'css;.issue-list > div > div',
  2796. insertPosition: ['css;.issue-list > div', 3],
  2797. replaceE: 'css;.pagination',
  2798. scrollDelta: 1500
  2799. }
  2800. }, // Github - Search 列表 - Issues/Discussions
  2801. github_search_package: {
  2802. SiteTypeID: 0,
  2803. pager: {
  2804. type: 1,
  2805. nextLink: 'css;a.next_page',
  2806. pageElement: 'css;#package_search_results > div',
  2807. insertPosition: ['css;#package_search_results', 3],
  2808. replaceE: 'css;.pagination',
  2809. scrollDelta: 1500
  2810. }
  2811. }, // Github - Search 列表 - Package
  2812. github_search_marketplace: {
  2813. SiteTypeID: 0,
  2814. pager: {
  2815. type: 1,
  2816. nextLink: 'css;a.next_page',
  2817. pageElement: 'css;.issue-list > div',
  2818. insertPosition: ['css;.issue-list', 3],
  2819. replaceE: 'css;.pagination',
  2820. scrollDelta: 1500
  2821. }
  2822. }, // Github - Search 列表 - Marketplace
  2823. github_search_topics: {
  2824. SiteTypeID: 0,
  2825. pager: {
  2826. type: 1,
  2827. nextLink: 'css;a.next_page',
  2828. pageElement: 'css;.topic-list > div',
  2829. insertPosition: ['css;.topic-list', 3],
  2830. replaceE: 'css;.pagination',
  2831. scrollDelta: 1500
  2832. }
  2833. }, // Github - Search 列表 - Topics
  2834. github_search_wiki: {
  2835. SiteTypeID: 0,
  2836. pager: {
  2837. type: 1,
  2838. nextLink: 'css;a.next_page',
  2839. pageElement: 'css;#wiki_search_results > div:first-child > div',
  2840. insertPosition: ['css;#wiki_search_results > div:first-child', 3],
  2841. replaceE: 'css;.pagination',
  2842. scrollDelta: 1500
  2843. }
  2844. }, // Github - Search 列表 - wiki
  2845. github_search_user: {
  2846. SiteTypeID: 0,
  2847. pager: {
  2848. type: 1,
  2849. nextLink: 'css;a.next_page',
  2850. pageElement: 'css;#user_search_results > div:first-child > div',
  2851. insertPosition: ['css;#user_search_results > div:first-child', 3],
  2852. replaceE: 'css;.pagination',
  2853. scrollDelta: 1500
  2854. }
  2855. }, // Github - Search 列表 - user
  2856. stackoverflow: {
  2857. SiteTypeID: 0,
  2858. host: 'stackoverflow.com',
  2859. functionStart: function() {if (location.pathname.indexOf('/questions') > -1) {
  2860. curSite = DBSite.stackoverflow;
  2861. } else if (location.pathname === '/search') {
  2862. curSite = DBSite.stackoverflow_search;
  2863. } else if (location.pathname === '/tags') {
  2864. curSite = DBSite.stackoverflow_tags;
  2865. } else if (location.pathname === '/users') {
  2866. curSite = DBSite.stackoverflow_users;
  2867. }},
  2868. pager: {
  2869. type: 1,
  2870. nextLink: 'css;a[href][rel="next"]',
  2871. pageElement: 'css;#questions > div',
  2872. insertPosition: ['css;#questions', 3],
  2873. replaceE: 'css;.pager',
  2874. scrollDelta: 1500
  2875. }
  2876. }, // StackOverflow - Questions
  2877. stackoverflow_tags: {
  2878. SiteTypeID: 0,
  2879. pager: {
  2880. type: 1,
  2881. nextLink: 'css;a[href][rel="next"]',
  2882. pageElement: 'css;#tags-browser > div',
  2883. insertPosition: ['css;#tags-browser', 3],
  2884. replaceE: 'css;.pager',
  2885. scrollDelta: 1500
  2886. }
  2887. }, // StackOverflow - Tags
  2888. stackoverflow_users: {
  2889. SiteTypeID: 0,
  2890. pager: {
  2891. type: 1,
  2892. nextLink: 'css;a[href][rel="next"]',
  2893. pageElement: 'css;#user-browser > div:first-child > div',
  2894. insertPosition: ['css;#user-browser > div:first-child', 3],
  2895. replaceE: 'css;.pager',
  2896. scrollDelta: 1500
  2897. }
  2898. }, // StackOverflow - Users
  2899. stackoverflow_search: {
  2900. SiteTypeID: 0,
  2901. pager: {
  2902. type: 1,
  2903. nextLink: 'css;a[href][rel="next"]',
  2904. pageElement: 'css;.js-search-results > div:first-child > div',
  2905. insertPosition: ['css;.js-search-results > div:first-child', 3],
  2906. replaceE: 'css;.pager',
  2907. scrollDelta: 1500
  2908. }
  2909. }, // StackOverflow - Search
  2910. segmentfault: {
  2911. SiteTypeID: 0,
  2912. host: 'segmentfault.com',
  2913. functionStart: function() {locationchange = true;
  2914. if (location.pathname.indexOf('/questions') > -1) {
  2915. curSite = DBSite.segmentfault;
  2916. } else if (location.pathname === '/search') {
  2917. curSite = DBSite.segmentfault_search;
  2918. }},
  2919. pager: {
  2920. type: 1,
  2921. nextLink: '//a[@class="page-link"][contains(text(), "下一页")]',
  2922. pageElement: 'css;ul.list-group > li',
  2923. insertPosition: ['css;ul.list-group', 3],
  2924. replaceE: 'css;ul.pagination',
  2925. scrollDelta: 1000
  2926. }
  2927. }, // SegmentFault - Questions
  2928. segmentfault_search: {
  2929. SiteTypeID: 0,
  2930. pager: {
  2931. type: 1,
  2932. nextLink: 'css;a[href][rel="next"]',
  2933. pageElement: 'css;.search-result > section',
  2934. insertPosition: ['css;.search-result > div:last-child', 1],
  2935. replaceE: 'css;ul.pagination',
  2936. scrollDelta: 1000
  2937. }
  2938. }, // SegmentFault - Search
  2939. libgen: {
  2940. SiteTypeID: 0,
  2941. host: /libgen/,
  2942. functionStart: function() {if (location.pathname === '/search.php') {curSite = DBSite.libgen;}},
  2943. pager: {
  2944. type: 1,
  2945. nextLink: '//font/a[@href][contains(text(), "►")]',
  2946. pageElement: 'css;table[rules="rows"] > tbody > tr:nth-of-type(n+2), .paginator+script:not([src])',
  2947. insertPosition: ['css;table[rules="rows"] > tbody', 3],
  2948. replaceE: '//td[./font/a[@href][contains(text(), "►")]]',
  2949. scriptType: 2,
  2950. history: true,
  2951. scrollDelta: 2000
  2952. }
  2953. }, // 学术
  2954. pubmed: {
  2955. SiteTypeID: 0,
  2956. host: 'pubmed.ncbi.nlm.nih.gov',
  2957. pager: {
  2958. type: 2,
  2959. nextLink: 'button.load-button.next-page',
  2960. nextText: 'Show more',
  2961. scrollDelta: 1500
  2962. }
  2963. }, // 学术
  2964. google_scholar: {
  2965. SiteTypeID: 0,
  2966. pager: {
  2967. type: 1,
  2968. nextLink: '//a[./span[@class="gs_ico gs_ico_nav_next"]]',
  2969. pageElement: 'css;#gs_res_ccl_mid > *',
  2970. insertPosition: ['css;#gs_res_ccl_mid', 3],
  2971. replaceE: 'id("gs_n")',
  2972. scriptType: 1,
  2973. scrollDelta: 2000
  2974. }
  2975. }, // 谷歌学术
  2976. bing_academic: {
  2977. SiteTypeID: 0,
  2978. pager: {
  2979. type: 1,
  2980. nextLink: 'css;a.sb_pagN[href]',
  2981. pageElement: 'css;#b_results > li.aca_algo',
  2982. insertPosition: ['css;#b_results .b_pag', 1],
  2983. replaceE: 'css;#b_results .b_pag',
  2984. scrollDelta: 1000
  2985. }
  2986. }, // 必应学术
  2987. baidu_xueshu: {
  2988. SiteTypeID: 0,
  2989. host: 'xueshu.baidu.com',
  2990. functionStart: function() {if (location.pathname === '/s') {
  2991. curSite = DBSite.baidu_xueshu;
  2992. } else if (location.pathname.indexOf('journal/navigation') > -1) {
  2993. curSite = DBSite.baidu_xueshu_journal;
  2994. } else if (location.pathname.indexOf('paper/show') > -1) {
  2995. curSite = DBSite.baidu_xueshu_paper;
  2996. }},
  2997. pager: {
  2998. type: 1,
  2999. nextLink: 'id("page")/a[./i[@class="c-icon-pager-next"]][@href]',
  3000. pageElement: 'css;#bdxs_result_lists > div.result',
  3001. insertPosition: ['css;#bdxs_result_lists', 3],
  3002. replaceE: 'css;#page',
  3003. history: true,
  3004. scrollDelta: 1000
  3005. }
  3006. }, // 百度学术
  3007. baidu_xueshu_journal: {
  3008. SiteTypeID: 0,
  3009. pager: {
  3010. type: 1,
  3011. nextLink: 'css;a.res-page-next[href]',
  3012. pageElement: 'css;#journaldetail > div',
  3013. insertPosition: ['css;#journaldetail', 3],
  3014. replaceE: 'css;.res-page',
  3015. history: true,
  3016. scrollDelta: 1000
  3017. }
  3018. }, // 百度学术
  3019. baidu_xueshu_paper: {
  3020. SiteTypeID: 0,
  3021. pager: {
  3022. type: 2,
  3023. nextLink: 'div:not([style*="display: none"]) > .more_btn',
  3024. nextText: '加载更多',
  3025. scrollDelta: 1000
  3026. }
  3027. }, // 百度学术
  3028. so_xueshu: {
  3029. SiteTypeID: 0,
  3030. host: 'xueshu.so.com',
  3031. functionStart: function() {if (location.pathname === '/s') {curSite = DBSite.so_xueshu;}},
  3032. pager: {
  3033. type: 1,
  3034. nextLink: 'css;a#snext[href]',
  3035. pageElement: 'css;ul.list > li',
  3036. insertPosition: ['css;ul.list', 3],
  3037. replaceE: 'css;#page',
  3038. scrollDelta: 1000
  3039. }
  3040. }, // 360 学术
  3041. wikihow: {
  3042. SiteTypeID: 0,
  3043. host: ['www.wikihow.com', 'zh.wikihow.com'],
  3044. functionStart: function() {if (location.pathname.indexOf('/Category:') > -1) {
  3045. curSite = DBSite.wikihow;
  3046. } else if (location.pathname.indexOf('/wikiHowTo') > -1 && location.search.indexOf('?search=') > -1) {
  3047. curSite = DBSite.wikihow_search;
  3048. }},
  3049. pager: {
  3050. type: 1,
  3051. nextLink: 'css;a.pag_next',
  3052. pageElement: 'css;#cat_all > .cat_grid > div',
  3053. insertPosition: ['css;#cat_all > .cat_grid', 3],
  3054. replaceE: 'css;#large_pagination',
  3055. scriptType: 4,
  3056. scrollDelta: 2000
  3057. }
  3058. }, // 指南
  3059. wikihow_search: {
  3060. SiteTypeID: 0,
  3061. pager: {
  3062. type: 1,
  3063. nextLink: 'css;#searchresults_footer > a.buttonright',
  3064. pageElement: 'css;#searchresults_list > a',
  3065. insertPosition: ['css;#searchresults_list', 3],
  3066. replaceE: 'css;#searchresults_footer',
  3067. scrollDelta: 3000
  3068. }
  3069. }, // 指南 - 搜索页
  3070. afreecatv: {
  3071. SiteTypeID: 0,
  3072. host: 'www.afreecatv.com',
  3073. pager: {
  3074. type: 2,
  3075. nextLink: '.btn-more > button',
  3076. intervals: 2000,
  3077. scrollDelta: 1000
  3078. }
  3079. }, // 直播
  3080. greasyfork: {
  3081. SiteTypeID: 0,
  3082. host: 'greasyfork.org',
  3083. functionStart: function() {if (/\/scripts$/.test(location.pathname) || location.pathname.indexOf('/scripts/by-site/') > -1) {
  3084. curSite = DBSite.greasyfork;
  3085. } else if (/\/feedback$/.test(location.pathname)) {
  3086. curSite = DBSite.greasyfork_feedback;
  3087. } else if (location.pathname.indexOf('/discussions') > -1 && !(/\/\d+/.test(location.pathname))) {
  3088. curSite = DBSite.greasyfork_discussions;
  3089. }},
  3090. pager: {
  3091. type: 1,
  3092. nextLink: '//a[@class="next_page"][@href]',
  3093. pageElement: 'css;ol#browse-script-list > li',
  3094. insertPosition: ['css;ol#browse-script-list', 3],
  3095. replaceE: 'css;.pagination',
  3096. scrollDelta: 1000
  3097. }
  3098. }, // 脚本
  3099. greasyfork_feedback: {
  3100. SiteTypeID: 0,
  3101. pager: {
  3102. type: 1,
  3103. nextLink: '//a[@class="next_page"][@href]',
  3104. pageElement: 'css;.script-discussion-list > div',
  3105. insertPosition: ['css;.script-discussion-list', 3],
  3106. replaceE: 'css;.pagination',
  3107. scrollDelta: 1500
  3108. }
  3109. }, // 脚本 - 反馈页
  3110. greasyfork_discussions: {
  3111. SiteTypeID: 0,
  3112. pager: {
  3113. type: 1,
  3114. nextLink: '//a[@class="next_page"][@href]',
  3115. pageElement: 'css;.discussion-list > div',
  3116. insertPosition: ['css;.discussion-list', 3],
  3117. replaceE: 'css;.pagination',
  3118. scrollDelta: 1000
  3119. }
  3120. }, // 脚本 - 讨论页
  3121. ruyile_xuexiao: {
  3122. SiteTypeID: 0,
  3123. host: 'www.ruyile.com',
  3124. functionStart: function() {
  3125. if (location.pathname === '/xuexiao/') {
  3126. curSite = DBSite.ruyile_xuexiao;
  3127. } else if (location.pathname === '/data/') {
  3128. curSite = DBSite.ruyile_data;
  3129. } else if (location.pathname === '/shijuan/') {
  3130. curSite = DBSite.ruyile_shijuan;
  3131. }},
  3132. pager: {
  3133. type: 1,
  3134. nextLink: '//div[@class="fy"]/a[contains(text(), "下一页")][@href]',
  3135. pageElement: 'css;.xxlb > .sk',
  3136. insertPosition: ['css;.xxlb', 3],
  3137. replaceE: 'css;.fy',
  3138. scrollDelta: 1000
  3139. }
  3140. }, // 如意了教育 - 学校
  3141. ruyile_data: {
  3142. SiteTypeID: 0,
  3143. pager: {
  3144. type: 1,
  3145. nextLink: '//div[@class="fy"]/a[contains(text(), "下一页")][@href]',
  3146. pageElement: 'css;.m1_z > .lbk',
  3147. insertPosition: ['css;.page', 1],
  3148. replaceE: 'css;.fy',
  3149. scrollDelta: 1000
  3150. }
  3151. }, // 如意了教育 - 数据
  3152. ruyile_shijuan: {
  3153. SiteTypeID: 0,
  3154. pager: {
  3155. type: 1,
  3156. nextLink: '//div[@class="fy"]/a[contains(text(), "下一页")][@href]',
  3157. pageElement: 'css;.m1_z > .m2_lb',
  3158. insertPosition: ['css;.page', 1],
  3159. replaceE: 'css;.fy',
  3160. scrollDelta: 1000
  3161. }
  3162. }, // 如意了教育 - 试卷
  3163. netbian: {
  3164. SiteTypeID: 0,
  3165. host: 'pic.netbian.com',
  3166. functionStart: function() {curSite = DBSite.netbian; document.lastElementChild.appendChild(document.createElement('style')).textContent = 'li.nextpage {display: none !important;}';},
  3167. pager: {
  3168. type: 1,
  3169. nextLink: '//div[@class="page"]/a[contains(text(),"下一页")]',
  3170. pageElement: 'css;.slist ul > li:not(.nextpage)',
  3171. insertPosition: ['css;.slist ul', 3],
  3172. replaceE: 'css;.page',
  3173. mimeType: 'text/html; charset=gbk',
  3174. scrollDelta: 1000
  3175. }
  3176. }, // 彼岸图网
  3177. ioliu: {
  3178. SiteTypeID: 0,
  3179. host: 'bing.ioliu.cn',
  3180. functionStart: function() {if (location.pathname.indexOf('/photo/') === -1 && location.pathname.indexOf('.html') === -1) {curSite = DBSite.ioliu; document.head.appendChild(document.createElement('base')).target = '_blank';}},
  3181. pager: {
  3182. type: 1,
  3183. nextLink: '//div[@class="page"]/a[@href][contains(text(), "下一页")]',
  3184. pageElement: 'css;body > .container > div.item',
  3185. insertPosition: ['css;body > .container', 3],
  3186. replaceE: 'css;.page',
  3187. scrollDelta: 1000
  3188. },
  3189. function: {
  3190. before: ioliu_functionBefore
  3191. }
  3192. }, // 必应壁纸
  3193. zhutix: {
  3194. SiteTypeID: 0,
  3195. host: 'zhutix.com',
  3196. functionStart: function() {if (document.getElementById('primary-home')) {
  3197. curSite = DBSite.zhutix_postlist;
  3198. } else {
  3199. curSite = DBSite.zhutix;
  3200. }},
  3201. pager: {
  3202. type: 1,
  3203. nextLink: '//li[@class="next-page"]/a | //div[@class="btn-pager"]/a[contains(text(), "❯")]',
  3204. pageElement: 'css;#post-list > ul > li',
  3205. insertPosition: ['css;#post-list > ul', 3],
  3206. replaceE: 'css;.pagination, .b2-pagenav.post-nav',
  3207. scrollDelta: 1500
  3208. }
  3209. }, // 致美化
  3210. zhutix_postlist: {
  3211. SiteTypeID: 0,
  3212. pager: {
  3213. type: 1,
  3214. nextLink: '//li[@class="next-page"]/a',
  3215. pageElement: 'css;#primary-home > div:not(.pagination)',
  3216. insertPosition: ['css;.pagination', 1],
  3217. replaceE: 'css;.pagination',
  3218. scrollDelta: 1500
  3219. }
  3220. } // 致美化 - 文章列表
  3221. };
  3222. // 生成 SiteTypeID
  3223. generateID();
  3224. // 用于脚本判断(针对部分特殊的网站)
  3225. SiteType = {
  3226. BAIDU_TIEBA: DBSite.baidu_tieba.SiteTypeID,
  3227. GAMERSKY_GL: DBSite.gamersky_gl.SiteTypeID
  3228. };
  3229. }
  3230.  
  3231.  
  3232. if (webType != 1) {
  3233. // < 所有 Discuz!论坛 >
  3234. if (webType === 2) {
  3235. if (location.pathname.indexOf('.html') > -1) { // 判断是不是静态网页(.html 结尾)
  3236. if (location.pathname.indexOf('/forum-') > -1) { // < 各版块帖子列表 >
  3237. if (document.getElementById('autopbn')) { // 判断是否有 [下一页] 按钮
  3238. curSite = DBSite.discuz_forum;
  3239. } else if (document.getElementById('waterfall')) { // 判断是否为图片模式
  3240. curSite = DBSite.discuz_waterfall; waterfallStyle(); // 图片模式列表样式预处理
  3241. } else {
  3242. curSite = DBSite.discuz_guide;
  3243. }
  3244. } else if (location.pathname.indexOf('/thread-') > -1) { // < 帖子内 >
  3245. if (GM_getValue('menu_discuz_thread_page')) {
  3246. curSite = DBSite.discuz_thread;
  3247. hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
  3248. }
  3249. } else if(location.pathname.indexOf('search') > -1) { // < 搜索结果 >
  3250. curSite = DBSite.discuz_search;
  3251. }
  3252. }
  3253. // 如果没有匹配的则继续
  3254. if (curSite.SiteTypeID === 0) {
  3255. if (location.search.indexOf('mod=forumdisplay') > -1 || location.pathname.indexOf('forumdisplay.php') > -1) { // < 各版块帖子列表 >
  3256. if (document.getElementById('autopbn')) { // 判断是否有 [下一页] 按钮
  3257. curSite = DBSite.discuz_forum;
  3258. } else if (document.getElementById('waterfall')) { // 判断是否为图片模式
  3259. curSite = DBSite.discuz_waterfall; waterfallStyle(); // 图片模式列表样式预处理
  3260. } else {
  3261. curSite = DBSite.discuz_guide;
  3262. }
  3263. } else if (location.search.indexOf('mod=viewthread') > -1 || location.pathname.indexOf('viewthread.php') > -1) { // < 帖子内 >
  3264. if (GM_getValue('menu_discuz_thread_page')) {
  3265. curSite = DBSite.discuz_thread;
  3266. hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
  3267. }
  3268. } else if (location.search.indexOf('mod=guide') > -1) { // < 导读帖子列表 >
  3269. curSite = DBSite.discuz_guide;
  3270. } else if(location.search.indexOf('mod=space') > -1 && location.search.indexOf('&view=me') > -1) { // 别人的主题/回复
  3271. curSite = DBSite.discuz_youspace;
  3272. } else if (location.search.indexOf('mod=collection') > -1) { // < 淘贴列表 >
  3273. curSite = DBSite.discuz_collection;
  3274. } else if (location.pathname.indexOf('search') > -1) { // < 搜索结果 >
  3275. curSite = DBSite.discuz_search;
  3276. } else if (document.getElementById('threadlist')) { // < 部分论坛的各板块 URL 是自定义的 >
  3277. curSite = DBSite.discuz_forum;
  3278. } else if (document.getElementById('postlist')) { // < 部分论坛的帖子内 URL 是自定义的 >
  3279. if (GM_getValue('menu_discuz_thread_page')) {
  3280. curSite = DBSite.discuz_thread;
  3281. hidePgbtn(); // 隐藏帖子内的 [下一页] 按钮
  3282. }
  3283. }
  3284. }
  3285. // < 所有 Flarum 论坛 >
  3286. } else if (webType === 3) {
  3287. DBSite.flarum.functionStart()
  3288. // < 所有使用 WordPress DUX 主题的网站 >
  3289. } else if (webType === 4) {
  3290. if (location.pathname.indexOf('.html') === -1) curSite = DBSite.dux;
  3291. if (location.host === 'apphot.cc') curSite.pager.scrollDelta = 2500; // 对于速度慢的网站,需要增加翻页敏感度
  3292. }
  3293. }
  3294.  
  3295. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  3296. pausePageEvent(); // 左键双击网页空白处暂停翻页
  3297.  
  3298. if (locationchange) { // 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则
  3299. nowLocation = location.href
  3300. addLocationchange(); // 自定义 locationchange 事件
  3301. if (webType === 1) {
  3302. window.addEventListener('locationchange', function(){
  3303. if (nowLocation != location.href) {
  3304. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  3305. registerMenuCommand(); // 重新判断规则
  3306. curSite.pageUrl = ''; // 下一页URL
  3307. pageLoading(); // 自动无缝翻页
  3308.  
  3309. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  3310. pausePageEvent(); // 左键双击网页空白处暂停翻页
  3311. }
  3312. })
  3313. } else if (webType === 3) {
  3314. window.addEventListener('locationchange', function(){
  3315. if (nowLocation != location.href) {
  3316. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  3317. DBSite.flarum.functionStart(); // 重新判断规则
  3318. pageLoading(); // 自动无缝翻页
  3319.  
  3320. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  3321. pausePageEvent(); // 左键双击网页空白处暂停翻页
  3322. }
  3323. })
  3324. }
  3325. }
  3326.  
  3327. curSite.pageUrl = ''; // 下一页URL
  3328. //console.log(curSite);
  3329. pageLoading(); // 自动无缝翻页
  3330.  
  3331.  
  3332. // [Discuz! 论坛] 隐藏帖子内的 [下一页] 按钮
  3333. function hidePgbtn() {
  3334. document.lastElementChild.appendChild(document.createElement('style')).textContent = '.pgbtn {display: none;}';
  3335. }
  3336. // [Discuz! 论坛] 图片模式列表样式预处理
  3337. function waterfallStyle() {
  3338. let width = document.querySelector('#waterfall > li:first-child').style.width;
  3339. 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;}`;
  3340. }
  3341. // [Discuz! 论坛] 的插入前函数(加载图片,仅部分论坛)
  3342. function discuz_thread_functionBefore(pageElems) {
  3343. if (location.hostname === 'bbs.pcbeta.com') { // 仅部分论坛需要处理
  3344. pageElems.forEach(function (one) {
  3345. one.querySelectorAll('img[file]').forEach(function (now) {
  3346. now.src = now.getAttribute('file');
  3347. });
  3348. });
  3349. }
  3350. return pageElems
  3351. }
  3352.  
  3353.  
  3354. // 通用型插入前函数(加载图片 data-original => src)
  3355. function src_original_functionBefore(pageElems) {
  3356. pageElems.forEach(function (one) {
  3357. let now = one.querySelector('img[data-original]')
  3358. if (now) {
  3359. now.src = now.dataset.original;
  3360. }
  3361. });
  3362. return pageElems
  3363. }
  3364. // 通用型插入前函数(加载图片 data-src => src)
  3365. function src_src_functionBefore(pageElems) {
  3366. pageElems.forEach(function (one) {
  3367. let now = one.querySelector('img[data-src]')
  3368. if (now) {
  3369. now.src = now.dataset.src;
  3370. }
  3371. });
  3372. return pageElems
  3373. }
  3374.  
  3375.  
  3376. // [DUX] 的插入前函数(加载图片)
  3377. function dux_functionBefore(pageElems) {
  3378. pageElems.forEach(function (one) {
  3379. let now = one.querySelector('img.thumb[data-src]')
  3380. if (now) {now.src = now.dataset.src;}
  3381. });
  3382. return pageElems
  3383. }
  3384.  
  3385.  
  3386. // [头条搜索] 的插入前函数(过滤相关搜索)
  3387. function toutiao_functionBefore(pageElems) {
  3388. for (let i = 0; i < pageElems.length; i++) {
  3389. let now = pageElems[i].querySelector('div[class*="-header"]')
  3390. if (now && now.textContent === '相关搜索') {
  3391. pageElems.splice(i,1)
  3392. }
  3393. }
  3394. return pageElems
  3395. }
  3396.  
  3397.  
  3398. // [360搜索] 的插入前函数(加载图片)
  3399. function so_functionBefore(pageElems) {
  3400. pageElems.forEach(function (one) {
  3401. one.querySelectorAll('img[data-isrc]').forEach(function (now) {
  3402. now.src = now.dataset.isrc;
  3403. now.className = now.className.replace('so-lazyimg','');
  3404. });
  3405. });
  3406. return pageElems
  3407. }
  3408.  
  3409.  
  3410. // [百度贴吧](发帖按钮点击事件)
  3411. function baidu_tieba_1() {
  3412. let button = document.querySelector('.tbui_aside_fbar_button.tbui_fbar_post > a');
  3413. if (button) {
  3414. button.remove();
  3415. 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>')
  3416. button = document.querySelector('.tbui_aside_fbar_button.tbui_fbar_post > a');
  3417. if (button) {
  3418. button.onclick = function(){
  3419. let button2 = document.querySelector('div.edui-btn.edui-btn-fullscreen.edui-btn-name-portrait');
  3420. if (button2) {
  3421. button2.click();
  3422. } else {
  3423. alert('提示:登录后才能发帖!');
  3424. }
  3425. return false;
  3426. }
  3427. }
  3428. }
  3429. }
  3430. // [百度贴吧] 的插入前函数(加载图片)
  3431. function baidu_tieba_functionBefore(pageElems) {
  3432. pageElems.forEach(function (one) {
  3433. one.querySelectorAll('img.threadlist_pic[data-original]').forEach(function (now) {
  3434. now.src = now.dataset.original;
  3435. now.style.display = 'inline';
  3436. })
  3437. });
  3438. return pageElems
  3439. }
  3440. // [百度贴吧] 获取下一页地址
  3441. function baidu_tieba_functionNext() {
  3442. let next = document.querySelector('a.next.pagination-item[href]');
  3443. if (next != null && next.nodeType === 1 && next.href && next.href.slice(0,4) === 'http') {
  3444. var url = next.href + '&pagelets=frs-list%2Fpagelet%2Fthread&pagelets_stamp=' + new Date().getTime();
  3445. if (url === curSite.pageUrl) return
  3446. curSite.pageUrl = url;
  3447. getPageElems(curSite.pageUrl);
  3448. };
  3449. }
  3450. // [百度贴吧] 插入数据
  3451. function baidu_tieba_insertElement(newBody, type) {
  3452. if (!newBody) return
  3453. let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody),
  3454. toElement = getAllElements(curSite.pager.insertPosition[0])[0];
  3455. if (pageElems.length >= 0) {
  3456. // 执行插入前函数
  3457. pageElems = curSite.function.before(pageElems);
  3458. // 插入位置
  3459. let addTo1 = addTo(curSite.pager.insertPosition[1]);
  3460. // 获取 <script> 内容
  3461. const scriptElems = getAllElements('//script', newBody, newBody);
  3462. let scriptText = '';
  3463. for (let i = 0; i < scriptElems.length; i++) {
  3464. if (scriptElems[i].textContent.indexOf('Bigpipe.register("frs-list/pagelet/thread_list"') > -1) {
  3465. scriptText = scriptElems[i].textContent.replace('Bigpipe.register("frs-list/pagelet/thread_list", ','');
  3466. break
  3467. }
  3468. }
  3469. if (scriptText) {
  3470. scriptText = scriptText.slice(0, scriptText.indexOf(').')) // 获取主体内容
  3471. let scriptJSON = JSON.parse(scriptText).content; // 字符串转 JSON
  3472. var temp_baidu_tieba = document.createElement('div'); temp_baidu_tieba.innerHTML = scriptJSON; // 字符串转 Element 元素
  3473. pageElems = curSite.function.before(getAllElements(curSite.pager.pageElement, temp_baidu_tieba, temp_baidu_tieba)); // 插入前执行函数
  3474. pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo1, one);}); // 插入元素
  3475. // 当前页码 + 1
  3476. pageNum.now = pageNum._now + 1
  3477. // 替换元素
  3478. let oriE = document.querySelectorAll(curSite.pager.pageElement.replace('css;', '')),
  3479. repE = getAllElements(curSite.pager.replaceE, temp_baidu_tieba, temp_baidu_tieba);
  3480. if (oriE.length === repE.length) {
  3481. for (let i = 0; i < oriE.length; i++) {
  3482. oriE[i].outerHTML = repE[i].outerHTML;
  3483. }
  3484. }
  3485. }
  3486. }
  3487. }
  3488.  
  3489.  
  3490. // [NGA(玩家社区)] 的插入后函数(加载各版块帖子列表样式)
  3491. function nga_thread_functionAfter() {
  3492. document.body.appendChild(document.createElement('script')).textContent = 'commonui.topicArg.loadAll();';
  3493. }
  3494.  
  3495.  
  3496. // [V2EX] 的插入后函数(新标签页打开链接)
  3497. function v2ex_functionAfter(css) {
  3498. let links = document.querySelectorAll(css);if (!links) return
  3499. links.forEach(function (_this) {_this.target = '_blank';});
  3500. }
  3501.  
  3502.  
  3503. // [龙的天空] 获取下一页地址
  3504. function lkong_functionNext() {
  3505. let next = document.querySelector('li.ant-pagination-next'), page;
  3506. if (next && next.getAttribute('aria-disabled') === 'false') {
  3507. page = document.querySelector('li.ant-pagination-item-active[title]');
  3508. if (page && page.title) {
  3509. if (curSite.pager.intervals) {
  3510. let _SiteTypeID = curSite.SiteTypeID; curSite.SiteTypeID = 0;
  3511. setTimeout(function(){curSite.SiteTypeID = _SiteTypeID;}, curSite.pager.intervals)
  3512. }
  3513. return (location.origin + location.pathname + '?page=' + ++page.title);
  3514. }
  3515. }
  3516. return '';
  3517. }
  3518.  
  3519.  
  3520. // [千图网] 的插入前函数(加载图片)
  3521. function _58pic_functionBefore(pageElems) {
  3522. let is_one = document.querySelector('.qtw-card.place-box.is-one');
  3523. if (is_one && is_one.style.display != 'none') {is_one.style.display = 'none';}
  3524. pageElems.forEach(function (one) {
  3525. let now = one.querySelector('img.lazy')
  3526. if (now && now.getAttribute('src') != now.dataset.original) {
  3527. now.src = now.dataset.original;
  3528. now.style.display = 'block';
  3529. }
  3530. });
  3531. return pageElems
  3532. }
  3533.  
  3534.  
  3535. // [Pixabay] 的插入前函数(加载图片)
  3536. function pixabay_functionBefore(pageElems) {
  3537. pageElems.forEach(function (one) {
  3538. let now = one.querySelector('img[data-lazy-src]')
  3539. if (now) {
  3540. now.src = now.dataset.lazySrc;
  3541. now.removeAttribute('data-lazy-src')
  3542. now.removeAttribute('data-lazy-srcset')
  3543. }
  3544. });
  3545. return pageElems
  3546. }
  3547.  
  3548.  
  3549. // [3DM MOD] 获取下一页地址
  3550. function _3dmgame_mod_functionNext() {
  3551. let nextNum = getElementByXpath('//li[@class="page-list active"]/following-sibling::li[contains(@class, "page-list")]/a');
  3552. var url = '';
  3553. if (nextNum && nextNum.textContent) {
  3554. nextNum = 'Page=' + nextNum.textContent;
  3555. if (location.search) {
  3556. let search = location.search.replace(/(&)?Page=\d+(&)?/, '');
  3557. if (search === '?') {
  3558. url += location.origin + location.pathname + search + nextNum;
  3559. } else {
  3560. url += location.origin + location.pathname + search + '&' + nextNum;
  3561. }
  3562. } else {
  3563. url += location.origin + location.pathname + '?' + nextNum;
  3564. }
  3565. }
  3566. //console.log(url)
  3567. return url
  3568. }
  3569.  
  3570.  
  3571. // [游民星空-攻略] 的插入前函数(移除下一页底部的 "更多相关内容请关注:xxx" 文字)
  3572. function gamersky_gl_functionBefore(pageElems) {
  3573. pageElems.forEach(function (one) {
  3574. if (one.tagName === 'P' && one.textContent.indexOf('更多相关内容请关注') > -1) {one.style.display = 'none';}
  3575. });
  3576. return pageElems
  3577. }
  3578.  
  3579.  
  3580. // [NexusMods] 获取下一页地址
  3581. function nexusmods_functionNext() {
  3582. if (document.querySelector('.nexus-ui-blocker')) return
  3583. let modList;
  3584. if (location.pathname.indexOf('/news') > -1) {modList = RH_NewsTabContent;} else {modList = RH_ModList;}
  3585. let out_items = JSON.stringify(modList.out_items).replace(/{|}|"/g,''),
  3586. nextNum = getElementByXpath('//div[contains(@class, "pagenav")][1]//a[contains(@class, "page-selected")]/parent::li/following-sibling::li/a'),
  3587. categories = modList.out_items.categories, categoriesUrl = '';
  3588. var url = '';
  3589. if (nextNum && nextNum.innerText) {
  3590. nextNum = nextNum.innerText;
  3591. if (out_items.indexOf('page:') > -1) {
  3592. out_items = out_items.replace(/page:\d+/, `page:${nextNum}`)
  3593. } else {
  3594. out_items += `,page:${nextNum}`;
  3595. }
  3596. if (categories && categories != []) {
  3597. for (let i = 0; i < categories.length; i++) {
  3598. categoriesUrl += `,categories[]:${categories[i]}`
  3599. }
  3600. categoriesUrl = categoriesUrl.replace(/,/,'');
  3601. if (out_items.indexOf('categories:') > -1) {
  3602. out_items = out_items.replace(/categories:\[.*\]/, categoriesUrl)
  3603. }
  3604. }
  3605. url = `https://www.nexusmods.com${modList.uri}?RH_${modList.id}=${out_items}`
  3606. //console.log(nextNum, url, curSite.pageUrl, out_items)
  3607. if (url === curSite.pageUrl) return
  3608. curSite.pageUrl = url;
  3609. //console.log(nextNum, curSite.pageUrl, out_items)
  3610. getPageElems(curSite.pageUrl)
  3611. }
  3612. }
  3613. // [NexusMods] 插入数据
  3614. function nexusmods_insertElement(newBody, type) {
  3615. if (!newBody) return
  3616. let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody), // 主体元素
  3617. toElement = getAllElements(curSite.pager.insertPosition[0])[0], // 插入位置的元素
  3618. addTo1 = addTo(curSite.pager.insertPosition[1]); // 插入位置
  3619. // 添加下载数据
  3620. pageElems.forEach(function (one) {
  3621. let now = one.querySelector('.mod-tile-left');
  3622. if (now) {
  3623. let downloadCount = now.querySelector('.downloadcount > span.flex-label');
  3624. if (downloadCount) {
  3625. console.log(now.dataset.gameId, now.dataset.modId)
  3626. if (GlobalModStats[now.dataset.gameId] && GlobalModStats[now.dataset.gameId][now.dataset.modId]) {
  3627. downloadCount.textContent = shortFormat(parseInt(GlobalModStats[now.dataset.gameId][now.dataset.modId].total));
  3628. }
  3629. }
  3630. }
  3631. });
  3632. // 插入网页
  3633. pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo1, one);});
  3634. // 当前页码 + 1
  3635. pageNum.now = pageNum._now + 1
  3636. // 替换元素
  3637. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  3638. repE = getAllElements(curSite.pager.replaceE, newBody, newBody);
  3639. if (oriE.length === repE.length) {
  3640. for (let i = 0; i < oriE.length; i++) {
  3641. oriE[i].outerHTML = repE[i].outerHTML;
  3642. }
  3643. }
  3644. }
  3645.  
  3646.  
  3647. // [cs_rin_ru] 各版块帖子列表的插入前函数(过滤置顶帖子)
  3648. function cs_rin_ru_functionBefore(pageElems) {
  3649. for (let i = 0; i < pageElems.length; i++) {
  3650. if (pageElems[i].textContent.replace(/\n| /g,'') === 'Topics') {
  3651. pageElems.splice(0,i+1);
  3652. break;
  3653. }
  3654. }
  3655. return pageElems
  3656. }
  3657.  
  3658.  
  3659. // [片库] 的插入前函数(加载图片)
  3660. function pianku_functionBefore(pageElems) {
  3661. pageElems.forEach(function (one) {
  3662. let now = one.querySelector('img')
  3663. if (now) {
  3664. now.src = now.dataset.src;
  3665. }
  3666. });
  3667. return pageElems
  3668. }
  3669.  
  3670.  
  3671. // [奈菲影视/在线之家/真不卡影院] 的插入前函数(加载图片)
  3672. function nfmovies_functionBefore(pageElems) {
  3673. pageElems.forEach(function (one) {
  3674. let now = one.querySelector('a.lazyload')
  3675. if (now) {
  3676. now.style.backgroundImage = 'url("' + now.dataset.original + '")';
  3677. }
  3678. });
  3679. return pageElems
  3680. }
  3681.  
  3682.  
  3683. // [SkrBT] 获取下一页地址
  3684. function skrbt_functionNext() {
  3685. let page = document.querySelector('a[onclick][aria-label="Next"]');
  3686. if (page) {page = /(?<=\()\d+(?=\))/.exec(page.onclick)[0];} else {return '';} // 获取下一页页码
  3687. if (page) {
  3688. let action = document.getElementById('search-form').action, value = ''; // 获取提交表单 URL
  3689. document.querySelectorAll('#search-form input[name]').forEach(function(input) { // 生成表单参数
  3690. value += input.name + '=' + input.value + '&'
  3691. })
  3692. value = encodeURI(value.replace(/&$/,'').replace(/p=\d+/,'p=' + page)); // 清理最后一个 & 符号,并替换页码
  3693. if (action && value) {
  3694. //console.log(action + '?' + value)
  3695. return (action + '?' + value)
  3696. }
  3697. }
  3698. return '';
  3699. }
  3700.  
  3701.  
  3702. // [BTHaha] 的插入前函数(加载图片)
  3703. function bthaha_functionBefore(pageElems) {
  3704. pageElems.forEach(function (one) {
  3705. let now = one.querySelector('[id^="list_top"], [id^="list_bottom"]')
  3706. if (now) {one.hidden = true;}
  3707. });
  3708. return pageElems
  3709. }
  3710.  
  3711.  
  3712. // [射手网] 获取下一页地址
  3713. function assrt_functionNext() {
  3714. let nextXPAHT = '//a[@id="pl-nav"][@href][contains(text(), ">")]'
  3715. let url = getElementByXpath(nextXPAHT);
  3716. if (url) {
  3717. url = /(?<=\()\d+(?=,)/.exec(url.href)[0]
  3718. if (url) {
  3719. return (location.origin + location.pathname + location.search.replace(/(&)?page=\d+$/,'') + '&page=' + url);
  3720. }
  3721. }
  3722. return '';
  3723. }
  3724.  
  3725.  
  3726. // [不死鸟] 的插入前函数(加载图片)
  3727. function iao_su_functionBefore(pageElems) {
  3728. pageElems.forEach(function (one) {
  3729. let now = one.getElementsByClassName('post-card')[0]
  3730. if (now) {
  3731. now.getElementsByClassName('blog-background')[0].style.backgroundImage = 'url("' + now.getElementsByTagName('script')[0].textContent.split("'")[1] + '")';
  3732. //now.getElementsByClassName('blog-background')[0].style.backgroundImage = 'url("' + RegExp("(?<=loadBannerDirect\\(').*(?=', '',)").exec(now.getElementsByTagName('script')[0].textContent)[0]; + '")';
  3733. }
  3734. });
  3735. return pageElems
  3736. }
  3737.  
  3738.  
  3739. // [异次元软件世界] 的插入前函数(加载图片)
  3740. function iplaysoft_postslist_functionBefore(pageElems) {
  3741. pageElems.forEach(function (one) {
  3742. let now = one.querySelector('img.lazyload')
  3743. if (now && !now.src) {
  3744. now.src = now.dataset.src;
  3745. now.setAttribute('srcset', now.dataset.src)
  3746. now.setAttribute('class', 'lazyloaded')
  3747. }
  3748. });
  3749. return pageElems
  3750. }
  3751.  
  3752.  
  3753. // [LRepacks] 的插入前函数(调整 class)
  3754. function lrepacks_functionBefore(pageElems) {
  3755. pageElems.forEach(function (one) {
  3756. let now = one.querySelector('.slideUp, .elementFade')
  3757. if (now) {
  3758. now.className = now.className.replace('slideUp','slideUpRun').replace('elementFade','elementFadeRun');
  3759. }
  3760. });
  3761. return pageElems
  3762. }
  3763.  
  3764.  
  3765. // [必应壁纸] 的插入前函数(加载图片)
  3766. function ioliu_functionBefore(pageElems) {
  3767. pageElems.forEach(function (one) {
  3768. let now = one.querySelector('img.progressive--not-loaded')
  3769. if (now) {
  3770. now.className = now.className.replace('progressive--not-loaded','progressive--is-loaded');
  3771. }
  3772. });
  3773. return pageElems
  3774. }
  3775.  
  3776.  
  3777. // [漫画狂] 获取下一页地址
  3778. function cartoonmad_functionNext() {
  3779. let nextXPAHT = '//a[@class="pages"][contains(text(),"下一頁")]',
  3780. nextPXPATH = '//a[@class="pages"][contains(string(),"下一話")]'
  3781. let url = getElementByXpath(nextXPAHT);
  3782. if (url) {
  3783. if (url.getAttribute('href') === 'thend.asp') {
  3784. url = getElementByXpath(nextPXPATH)
  3785. if (url) return url.href;
  3786. pausePage = false;
  3787. GM_notification({text: `注意:该网站早期漫画(如海贼王、柯南)因为网站自身问题而无法翻至下一话(仅限于显示为 [第 X 卷]/[下一卷] 的)。\n因此需要手动去 [目录页] 进入下一卷!`, timeout: 10000});
  3788. } else {
  3789. return url.href;
  3790. }
  3791. }
  3792. return '';
  3793. }
  3794.  
  3795.  
  3796. // [漫画猫] 初始化(显示本话所以图片)
  3797. function manhuacat_init() {
  3798. let _img = '';
  3799. for (let now of img_data_arr) {
  3800. _img += `<img src="${asset_domain}${img_pre}${now}">`;
  3801. }
  3802. document.querySelector('.img-content > img').remove();
  3803. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3804.  
  3805. }
  3806. // [漫画猫] 获取下一页地址
  3807. function manhuacat_functionNext(pageElems, type) {
  3808. if (type === 'url') {
  3809. if(pageElems.code == '0000') {
  3810. if (pageElems.url === curSite.pageUrl) return
  3811. curSite.pageUrl = pageElems.url;
  3812. getPageElems(curSite.pageUrl); // 真正的下一页链接
  3813. }
  3814. } else {
  3815. let vg_r_data = document.querySelector('.vg-r-data');
  3816. if (vg_r_data) {
  3817. 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');
  3818. }
  3819. }
  3820. }
  3821. // [漫画猫] 插入数据
  3822. function manhuacat_insertElement(pageElems, type) {
  3823. if (!pageElems) return
  3824. if (type === 'url') { // 获取下一页链接
  3825. manhuacat_functionNext(pageElems, type); return
  3826. }
  3827.  
  3828. // 添加历史记录
  3829. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  3830.  
  3831. // 替换元素
  3832. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  3833. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  3834. if (oriE.length === repE.length) {
  3835. for (let i = 0; i < oriE.length; i++) {
  3836. oriE[i].outerHTML = repE[i].outerHTML;
  3837. }
  3838. }
  3839.  
  3840. // 插入图片
  3841. 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');;
  3842. for (let now of _img_arr) {
  3843. _img += `<img src="${vg_r_data.dataset.chapterDomain}${img_pre}${now}">`;
  3844. }
  3845. if (_img) {
  3846. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3847. // 当前页码 + 1
  3848. pageNum.now = pageNum._now + 1
  3849. }
  3850. }
  3851.  
  3852.  
  3853. // [漫画DB] 初始化(将本话其余图片插入网页中)
  3854. function manhuadb_init() {
  3855. let _img = '',
  3856. data = document.querySelector('.vg-r-data'), imgDate;
  3857. if (!data) return
  3858. document.querySelectorAll(curSite.pager.pageElement.replace('css;', '')).forEach(function (one) {
  3859. if (one.tagName === 'SCRIPT' && one.textContent.indexOf('var img_data =') > -1) {
  3860. let json = JSON.parse(window.atob(one.textContent.split("'")[1]));
  3861. if (json) {
  3862. let _img = '';
  3863. for (let i = 0; i < json.length; i++) { // 遍历图片文件名数组,组合为 img 标签
  3864. let src = data.dataset.host + data.dataset.img_pre + json[i].img;
  3865. _img += `<img class="img-fluid show-pic" src="${src}">`
  3866. }
  3867. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3868. }
  3869. }
  3870. })
  3871. }
  3872. // [漫画DB] 获取下一页地址
  3873. function manhuadb_functionNext() {
  3874. let nextArr = document.querySelectorAll('a.fixed-a-es'), next;
  3875. var url = '';
  3876. if (nextArr.length == 0) return
  3877. for (let i = 0; i < nextArr.length; i++) {
  3878. if (nextArr[i].className.indexOf('active') > -1) {
  3879. if (nextArr[i+1]) url = nextArr[i+1].href;
  3880. break;
  3881. }
  3882. }
  3883. if (url === curSite.pageUrl) return
  3884. curSite.pageUrl = url
  3885. getPageElems(curSite.pageUrl);
  3886. }
  3887. // [漫画DB] 插入数据
  3888. function manhuadb_insertElement(pageElems, type) {
  3889. if (!pageElems) return
  3890. let oriE = document.querySelectorAll(curSite.pager.pageElement.replace('css;', '')),
  3891. repE = getAllElements(curSite.pager.pageElement, pageElems, pageElems);
  3892. if (oriE.length === repE.length) {
  3893. for (let i = 0; i < oriE.length; i++) {
  3894. oriE[i].outerHTML = repE[i].outerHTML;
  3895. }
  3896. // 当前页码 + 1
  3897. pageNum.now = pageNum._now + 1
  3898. manhuadb_init(); // 将刚刚替换的图片插入网页中
  3899. }
  3900. }
  3901.  
  3902.  
  3903. // [HiComic(嗨漫画)] 初始化(将本话其余图片插入网页中)
  3904. function hicomic_init() {
  3905. let _img = '';
  3906. document.querySelectorAll('.chapter > section:not(:first-child) > section[val]').forEach(function (one) {
  3907. let src = one.getAttribute('val');
  3908. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h'
  3909. _img += `<img src="${src}">`
  3910. })
  3911. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3912. window.document.title = window.document.title.replace(/(\(第.+\))? - HiComic/, `(${document.querySelector('.chapter_name').textContent}) - HiComic`); // 修改网页标题(加上 第 X 话)
  3913. }
  3914. // [HiComic(嗨漫画)] 获取下一页地址
  3915. function hicomic_functionNext() {
  3916. let nextId;
  3917. nextId = document.querySelector('.next_chapter:not(.end)')
  3918. if (nextId && nextId.id && nextId.id != 'None') {
  3919. curSite.pageUrl = location.href;
  3920. getPageElems(`https://www.hicomic.net/api/web/chapter/${nextId.id}/contents`, 'json');
  3921. }
  3922. }
  3923. // [HiComic(嗨漫画)] 插入数据
  3924. function hicomic_insertElement(pageElems, type) {
  3925. if (!pageElems || pageElems.code != 200) return
  3926. if (pageElems.results.chapter.next) { // 写入下一页的 UUID
  3927. document.querySelector('.next_chapter').id = pageElems.results.chapter.next;
  3928. } else {
  3929. document.querySelector('.next_chapter').id = 'None';
  3930. document.querySelector('.next_chapter').classList.add('end');
  3931. }
  3932. document.querySelector('.chapter_name').textContent = pageElems.results.chapter.name; // 修改漫画标题
  3933. let title = window.document.title.replace(/(\(第.+\))? - HiComic/, `(${pageElems.results.chapter.name}) - HiComic`)
  3934. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, title, curSite.pageUrl); // 添加历史记录
  3935. window.document.title = title; // 修改当前网页标题为下一话的标题
  3936. let _img = '';
  3937. for (let i = 0; i < pageElems.results.chapter.contents.length; i++) { // 遍历图片文件名数组,组合为 img 标签
  3938. let src = pageElems.results.chapter.contents[i].url;
  3939. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h';
  3940. _img += `<img src="${src}">`
  3941. }
  3942. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3943. // 当前页码 + 1
  3944. pageNum.now = pageNum._now + 1
  3945. }
  3946.  
  3947.  
  3948. // [动漫之家] 初始化(调整本话其余图片)
  3949. function dmzj_init() {
  3950. let _img = '';
  3951. document.querySelectorAll('.comic_wraCon > a > img').forEach(function (one) {
  3952. _img += `<img src="${one.dataset.original}">`;
  3953. one.parentElement.remove();
  3954. })
  3955. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3956.  
  3957. }
  3958. // [动漫之家] 获取下一页地址
  3959. function dmzj_functionNext() {
  3960. let next;
  3961. next = document.querySelector('span.next > a[href]')
  3962. if (next) {
  3963. if (next.href === curSite.pageUrl) return
  3964. curSite.pageUrl = next.href;
  3965. getPageElems(curSite.pageUrl);
  3966. }
  3967. }
  3968. // [动漫之家] 插入数据
  3969. function dmzj_insertElement(pageElems, type) {
  3970. if (!pageElems) return
  3971. // 插入并运行 <script>
  3972. let scriptElement = pageElems.querySelectorAll('head > script[type]:not([src])'), scriptText = '';
  3973. scriptElement.forEach(function (one) {scriptText += ';' + one.textContent;});
  3974. if (scriptText) document.body.appendChild(document.createElement('script')).textContent = scriptText;
  3975.  
  3976. // 插入图片
  3977. let _img = '', _img_arr;
  3978. if (pages.indexOf('|') === -1) {
  3979. _img_arr = JSON.parse(pages.replace(/\r\n/g,'|')).page_url.split('|');
  3980. } else {
  3981. _img_arr = JSON.parse(pages).page_url.split('|');
  3982. }
  3983. for (let now of _img_arr) {
  3984. _img += `<img src="${img_prefix}${now}">`;
  3985. }
  3986. if (_img) {
  3987. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  3988.  
  3989. // 添加历史记录
  3990. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  3991.  
  3992. // 替换元素
  3993. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  3994. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  3995. if (oriE.length === repE.length) {
  3996. for (let i = 0; i < oriE.length; i++) {
  3997. oriE[i].outerHTML = repE[i].outerHTML;
  3998. }
  3999. // 当前页码 + 1
  4000. pageNum.now = pageNum._now + 1
  4001. }
  4002. }
  4003. }
  4004.  
  4005.  
  4006. // [动漫之家-漫画] 初始化(调整本话其余图片)
  4007. function dmzj_manhua_init() {
  4008. let _img = '';
  4009. document.querySelectorAll('#center_box > .inner_img img[src]').forEach(function (one) {
  4010. _img += `<img src="${one.dataset.original}">`;
  4011. one.parentElement.parentElement.remove();
  4012. })
  4013. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  4014.  
  4015. }
  4016. // [动漫之家-漫画] 获取下一页地址
  4017. function dmzj_manhua_functionNext() {
  4018. let next;
  4019. next = document.getElementById('next_chapter')
  4020. if (next) {
  4021. if (next.href === curSite.pageUrl) return
  4022. curSite.pageUrl = next.href;
  4023. getPageElems(curSite.pageUrl);
  4024. }
  4025. }
  4026. // [动漫之家-漫画] 插入数据
  4027. function dmzj_manhua_insertElement(pageElems, type) {
  4028. if (!pageElems) return
  4029. // 插入并运行 <script>
  4030. let scriptElement = pageElems.querySelectorAll('head > script[type]:not([src])'), scriptText = '';
  4031. scriptElement.forEach(function (one) {scriptText += ';' + one.textContent;});
  4032. if (scriptText) document.body.appendChild(document.createElement('script')).textContent = scriptText;
  4033.  
  4034. // 插入图片
  4035. let _img = '';
  4036. for (let now of arr_pages) {
  4037. _img += `<img src="${img_prefix}${now}">`;
  4038. }
  4039. if (_img) {
  4040. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  4041.  
  4042. // 添加历史记录
  4043. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  4044.  
  4045. // 替换元素
  4046. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  4047. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  4048. if (oriE.length === repE.length) {
  4049. for (let i = 0; i < oriE.length; i++) {
  4050. oriE[i].outerHTML = repE[i].outerHTML;
  4051. }
  4052. // 当前页码 + 1
  4053. pageNum.now = pageNum._now + 1
  4054. }
  4055. }
  4056. }
  4057.  
  4058.  
  4059. // [拷贝漫画] 获取下一页地址
  4060. function copymanga_functionNext() {
  4061. let next;
  4062. next = document.querySelector('.comicContent-next > a[href]')
  4063. if (next) {
  4064. if (next.href === curSite.pageUrl) return
  4065. curSite.pageUrl = next.href;
  4066. getPageElems(curSite.pageUrl);
  4067. }
  4068. }
  4069. // [拷贝漫画] 插入数据
  4070. function copymanga_insertElement(pageElems, type) {
  4071. if (!pageElems) return
  4072. // 添加历史记录
  4073. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  4074. let oldImg = document.querySelector('.comicContent-image-list').innerHTML;
  4075.  
  4076. // 替换元素
  4077. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  4078. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  4079. if (oriE.length === repE.length) {
  4080. for (let i = 0; i < oriE.length; i++) {
  4081. oriE[i].outerHTML = repE[i].outerHTML;
  4082. }
  4083. // 插入并运行 <script>
  4084. document.body.appendChild(document.createElement('script')).src = document.querySelector('body > script[async][src*="comic_content_pass"]').src;
  4085. setTimeout(function(){
  4086. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), oldImg); // 将 img 标签插入到网页中
  4087. }, 100);
  4088. // 当前页码 + 1
  4089. pageNum.now = pageNum._now + 1
  4090. }
  4091. }
  4092.  
  4093.  
  4094. // [古风漫画网] 获取下一页地址
  4095. function gufengmh_functionNext() {
  4096. let pageElems = document.querySelector(curSite.pager.pageElement.replace('css;', '')); // 寻找数据所在元素
  4097. if (pageElems) {
  4098. let comicUrl, nextId;
  4099. var url = '';
  4100. pageElems.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  4101. //console.log(one)
  4102. if (one.indexOf('comicUrl') > -1) { // 下一页 URL 前半部分
  4103. comicUrl = one.split('"')[1];
  4104. } else if (one.indexOf('nextChapterData') > -1) { // 下一页 URL 的后半部分 ID
  4105. nextId = one.split('"id":')[1].split(',')[0];
  4106. }
  4107. })
  4108. if (comicUrl && nextId && nextId != 'null') { // 组合到一起就是下一页 URL
  4109. url = comicUrl + nextId + '.html'
  4110. if (url === curSite.pageUrl) return
  4111. curSite.pageUrl = url
  4112. getPageElems(curSite.pageUrl); // 访问下一页 URL 获取
  4113. }
  4114. }
  4115. }
  4116. // [古风漫画网] 插入数据
  4117. function gufengmh_insertElement(pageElems, type) {
  4118. if (pageElems) {
  4119. let url = curSite.pageUrl;
  4120. pageElems = getAllElements(curSite.pager.pageElement, pageElems, pageElems)[0];
  4121. let chapterImages, chapterPath;
  4122. document.querySelector(curSite.pager.pageElement.replace('css;', '')).innerText = pageElems.textContent; // 将当前网页内的数据所在元素内容改为刚刚获取的下一页数据内容,以便循环获取下一页 URL
  4123. pageElems.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  4124. //console.log(one)
  4125. if (one.indexOf('chapterImages') > -1) { // 图片文件名数组
  4126. chapterImages = one.replace(/^.+\[/, '').replace(']', '').replaceAll('"', '').split(',')
  4127. } else if (one.indexOf('chapterPath') > -1) { // 图片文件路径
  4128. chapterPath = one.split('"')[1];
  4129. } else if (one.indexOf('pageTitle') > -1) { // 网页标题
  4130. let title = one.split('"')[1];
  4131. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, title, url); // 添加历史记录
  4132. window.document.title = title; // 修改当前网页标题为下一页的标题
  4133. }
  4134. })
  4135. if (chapterImages && chapterPath) {
  4136. let _img = '';
  4137. chapterImages.forEach(function (one2){ // 遍历图片文件名数组,组合为 img 标签
  4138. _img += '<img src="https://res.xiaoqinre.com/' + chapterPath + one2 + '" data-index="0" style="display: inline-block;">'
  4139. })
  4140. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  4141. // 当前页码 + 1
  4142. pageNum.now = pageNum._now + 1
  4143. }
  4144. }
  4145. }
  4146.  
  4147.  
  4148. // [砂之船动漫家] 的插入前函数(加载图片)
  4149. function szcdmj_functionBefore(pageElems) {
  4150. pageElems.forEach(function (one) {
  4151. if (one.tagName === 'TITLE') {
  4152. let title = one.textContent;
  4153. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, title, curSite.pageUrl); // 添加历史记录
  4154. window.document.title = title; // 修改当前网页标题为下一页的标题
  4155. one.style.display = 'none';
  4156. } else {
  4157. let now = one.querySelector('img[data-original]')
  4158. if (now) {
  4159. now.src = now.dataset.original;
  4160. now.style.display = 'inline';
  4161. }
  4162. }
  4163. });
  4164. return pageElems
  4165. }
  4166.  
  4167.  
  4168. // [Mangabz 漫画] 初始化(调整本话图片)
  4169. function mangabz_init() {
  4170. pageNumber('del');
  4171. let showimage = document.getElementById('showimage'),
  4172. cp_img = document.getElementById('cp_img'),
  4173. cp_image = document.getElementById('cp_image');
  4174. if (showimage) {showimage.removeAttribute('oncontextmenu');}
  4175. if (cp_img) {cp_img.removeAttribute('oncontextmenu');}
  4176. if (cp_image) {
  4177. cp_image.removeAttribute('oncontextmenu');
  4178. cp_image.removeAttribute('id');
  4179. cp_image.removeAttribute('style');
  4180. }
  4181. }
  4182. // [Mangabz 漫画] 获取下一页地址
  4183. function mangabz_functionNext() {
  4184. var url = '';
  4185. if (MANGABZ_PAGE === MANGABZ_IMAGE_COUNT) { // 下一话
  4186. url = getElementByXpath('//a[./img[contains(@src, "icon_xiayizhang")]]')
  4187. if (url === curSite.pageUrl) return
  4188. curSite.pageUrl = url
  4189. //console.log(curSite.pageUrl)
  4190. getPageElems(curSite.pageUrl); // 访问下一话 URL 获取
  4191. } else { // 下一页
  4192. if (!mkey) var mkey = '';
  4193. 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}`
  4194. if (url === curSite.pageUrl) return
  4195. curSite.pageUrl = url
  4196. //console.log(curSite.pageUrl)
  4197. getPageElems(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
  4198. }
  4199. }
  4200. // [Mangabz 漫画] 插入数据
  4201. function mangabz_insertElement(pageElems, type) {
  4202. if (pageElems) {
  4203. if (type === 'Next') {
  4204. let imgArr = eval(pageElems),
  4205. _img = '';
  4206. for (let now of imgArr) {
  4207. _img += `<img src="${now}">`;
  4208. }
  4209. if (_img) {
  4210. document.querySelector(curSite.pager.insertPosition[0].replace('css;', '')).insertAdjacentHTML(addTo(curSite.pager.insertPosition[1]), _img); // 将 img 标签插入到网页中
  4211.  
  4212. // 添加历史记录
  4213. MANGABZ_PAGE += imgArr.length;
  4214. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, document.title, location.origin + MANGABZ_CURL.substring(0, MANGABZ_CURL.length - 1) + '-p' + MANGABZ_PAGE + '/');
  4215. }
  4216. } else {
  4217. // 插入 <script> 标签
  4218. let scriptElement = pageElems.querySelectorAll('html:not([dir]) > head > script:not([src])'), scriptText = '';
  4219. scriptElement.forEach(function (one) {scriptText += ';' + one.textContent;});
  4220. if (scriptText) {
  4221. document.body.appendChild(document.createElement('script')).textContent = scriptText;
  4222.  
  4223. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  4224.  
  4225. // 替换待替换元素
  4226. let oriE = getAllElements(curSite.pager.replaceE),
  4227. repE = getAllElements(curSite.pager.replaceE, pageElems, pageElems);
  4228. if (oriE.length === repE.length) {
  4229. for (let i = 0; i < oriE.length; i++) {
  4230. oriE[i].outerHTML = repE[i].outerHTML;
  4231. }
  4232. }
  4233. MANGABZ_PAGE = 0;
  4234. mangabz_functionNext();
  4235. }
  4236. }
  4237. }
  4238. }
  4239.  
  4240.  
  4241. // 自动无缝翻页
  4242. function pageLoading() {
  4243. if (curSite.SiteTypeID > 0) {
  4244. windowScroll(function (direction, e) {
  4245. if (direction === 'down' && pausePage === true) { // 下滑/没有暂停翻页时,才准备翻页
  4246. let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop,
  4247. scrollHeight = window.innerHeight || document.documentElement.clientHeight,
  4248. scrollDelta = curSite.pager.scrollDelta;
  4249. if (curSite.pager.type === 3) { // <<<<< 翻页类型 3(依靠元素距离可视区域底部的距离来触发翻页)>>>>>
  4250. let scrollElement = document.querySelector(curSite.pager.scrollElement);
  4251. //console.log(scrollElement.offsetTop - (scrollTop + scrollHeight), scrollDelta, curSite.SiteTypeID)
  4252. if (scrollElement.offsetTop - (scrollTop + scrollHeight) <= scrollDelta) {
  4253. if (curSite.SiteTypeID === SiteType.GAMERSKY_GL) curSite.pager.scrollDelta -= 800 // 游民星空 gl 的比较奇葩,需要特殊处理下
  4254. ShowPager.loadMorePage();
  4255. }
  4256. } else {
  4257. if (document.documentElement.scrollHeight <= scrollHeight + scrollTop + scrollDelta) {
  4258. if (curSite.pager.type === 2) { // <<<<< 翻页类型 2(网站自带了自动无缝翻页功能,只需要点击下一页按钮即可)>>>>>
  4259. if (curSite.SiteTypeID > 0) { // 如果指定了间隔时间,那么就依靠这个判断时间到了没有~
  4260. let autopbn = document.querySelector(curSite.pager.nextLink);
  4261. if (autopbn) { // 寻找下一页链接
  4262. // 避免重复点击翻页按钮
  4263. if (curSite.pager.nextText) { // 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页
  4264. if (autopbn.innerText === curSite.pager.nextText) {autopbn.click(); pageNum.now = pageNum._now + 1;} // 当前页码 + 1
  4265. } else if (curSite.pager.nextTextOf) { // 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页
  4266. if (autopbn.innerText.indexOf(curSite.pager.nextTextOf) > -1) {autopbn.click(); pageNum.now = pageNum._now + 1;} // 当前页码 + 1
  4267. } else if (curSite.pager.nextHTML) { // 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页
  4268. if (autopbn.innerHTML === curSite.pager.nextHTML) {autopbn.click(); pageNum.now = pageNum._now + 1;} // 当前页码 + 1
  4269. } else { // 如果没有指定按钮文字就直接点击
  4270. autopbn.click(); pageNum.now = pageNum._now + 1; // 当前页码 + 1
  4271. // 对于没有按钮文字变化的按钮,可以指定间隔时间(默认 300ms)
  4272. if (!curSite.pager.intervals) {curSite.pager.intervals = 300;}
  4273. let _SiteTypeID = curSite.SiteTypeID; curSite.SiteTypeID = 0;
  4274. setTimeout(function(){curSite.SiteTypeID = _SiteTypeID;}, curSite.pager.intervals)
  4275. }
  4276. }
  4277. }
  4278. } else if (curSite.pager.type === 1) { // <<<<< 翻页类型 1(由脚本实现自动无缝翻页)>>>>>
  4279. if (curSite.SiteTypeID > 0) ShowPager.loadMorePage();
  4280. } else if (curSite.pager.type === 4) { // <<<<< 翻页类型 4(部分简单的动态加载类网站)>>>>>
  4281. if (curSite.SiteTypeID > 0) {
  4282. // 为百度贴吧的发帖考虑...
  4283. if (!(document.documentElement.scrollHeight <= scrollHeight + scrollTop + 200 && curSite.SiteTypeID === SiteType.BAIDU_TIEBA)) {
  4284. curSite.pager.nextLink();
  4285. }
  4286. if (curSite.pager.intervals) {
  4287. let _SiteTypeID = curSite.SiteTypeID;
  4288. curSite.SiteTypeID = 0;
  4289. setTimeout(function(){curSite.SiteTypeID = _SiteTypeID;}, curSite.pager.intervals)
  4290. }
  4291. }
  4292. }
  4293. }
  4294. }
  4295. }
  4296. });
  4297. }
  4298. }
  4299.  
  4300.  
  4301. // 启用/禁用 (当前网站)
  4302. function menu_disable(type) {
  4303. switch(type) {
  4304. case 'check':
  4305. if(check()) {return true;} else {return false;}; break;
  4306. case 'add':
  4307. add(); break;
  4308. case 'del':
  4309. del(); break;
  4310. }
  4311.  
  4312. function check() { // 存在返回真,不存在返回假
  4313. let list = GM_getValue('menu_disable'); // 读取网站列表
  4314. if (list.indexOf(location.host) === -1) return false // 不存在返回假
  4315. return true
  4316. }
  4317.  
  4318. function add() {
  4319. if (check()) return
  4320. let list = GM_getValue('menu_disable'); // 读取网站列表
  4321. list.push(location.host); // 追加网站域名
  4322. GM_setValue('menu_disable', list); // 写入配置
  4323. location.reload(); // 刷新网页
  4324. }
  4325.  
  4326. function del() {
  4327. if (!check()) return
  4328. let list = GM_getValue('menu_disable'), // 读取网站列表
  4329. index = list.indexOf(location.host);
  4330. list.splice(index, 1); // 删除网站域名
  4331. GM_setValue('menu_disable', list); // 写入配置
  4332. location.reload(); // 刷新网页
  4333. }
  4334. }
  4335.  
  4336.  
  4337. // 左键双击网页空白处暂停翻页
  4338. function pausePageEvent() {
  4339. if (!GM_getValue('menu_pause_page')) return
  4340. if (curSite.SiteTypeID === 0) return
  4341. document.body.addEventListener('dblclick', function () {
  4342. if (pausePage) {
  4343. pausePage = false;
  4344. GM_notification({text: `❌ 已暂停本页 [自动无缝翻页]\n (再次双击可恢复)`, timeout: 2000});
  4345. } else {
  4346. pausePage = true;
  4347. GM_notification({text: `✅ 已恢复本页 [自动无缝翻页]\n (再次双击可暂停)`, timeout: 2000});
  4348. }
  4349. });
  4350. }
  4351.  
  4352.  
  4353. // 显示页码
  4354. function pageNumber(type) {
  4355. if (curSite.SiteTypeID === 0) {let status = document.getElementById('Autopage_number');if (status) {status.style.display = 'none';}; return}
  4356. let status = document.getElementById('Autopage_number');
  4357. switch (type) {
  4358. case 'add':
  4359. add(); break;
  4360. case 'del':
  4361. del(); break;
  4362. case 'set':
  4363. set(); break;
  4364. }
  4365.  
  4366. function add(){
  4367. if (status) {
  4368. if (status.style.display === 'none') {status.style.display = 'flex';}
  4369. return
  4370. }
  4371. // 插入网页
  4372. 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>
  4373. <div id="Autopage_number" title="1. 此处数字为 [当前页码] (可在脚本菜单中关闭)&#10;&#10;2. 鼠标左键点击此处 [临时暂停本页自动无缝翻页](再次点击可恢复)">${pageNum._now}</div>`
  4374. document.body.insertAdjacentHTML('beforeend', _html);
  4375. // 点击事件(临时暂停翻页)
  4376. document.getElementById('Autopage_number').onclick = function () {
  4377. if (pausePage) {
  4378. pausePage = false; this.style = 'color: #FF5722 !important; font-style: italic !important;';
  4379. } else {
  4380. pausePage = true; this.style = '';
  4381. }
  4382. };
  4383. status = document.getElementById('Autopage_number');
  4384. set();
  4385. }
  4386. // 监听储存当前页码的对象值的变化
  4387. function set(){
  4388. Object.defineProperty(pageNum, 'now', {
  4389. set: function(value) {
  4390. this._now = value;
  4391. if (status) status.textContent = value;
  4392. }
  4393. });
  4394. }
  4395. function del(){
  4396. if (!status) return
  4397. status.style.display = 'none';
  4398. }
  4399. }
  4400.  
  4401.  
  4402. // 菜单开关
  4403. function menu_switch(menu_status, Name, Tips) {
  4404. if (menu_status === true){
  4405. GM_setValue(Name, false);
  4406. } else {
  4407. GM_setValue(Name, true);
  4408. }
  4409. if (Name === 'menu_page_number') {
  4410. if (menu_status === true){pageNumber('del');} else {pageNumber('add');}
  4411. registerMenuCommand(); // 重新注册脚本菜单
  4412. } else {
  4413. location.reload();}
  4414. };
  4415.  
  4416.  
  4417. // 生成 ID
  4418. function generateID() {
  4419. let num = 0
  4420. for (let val in DBSite) {
  4421. DBSite[val].SiteTypeID = num = num + 1;
  4422. }
  4423. }
  4424.  
  4425.  
  4426. // 判断是支持
  4427. function doesItSupport() {
  4428. setDBSite(); // 配置 DBSite 变量对象
  4429.  
  4430. // 遍历判断是否是某个已支持的网站,顺便直接赋值
  4431. let support = false;
  4432. for (let now in DBSite) { // 遍历对象
  4433. if (!DBSite[now].host) continue; // 如果不存在则继续下一个循环
  4434. if (Array.isArray(DBSite[now].host)) { // 如果是数组
  4435. for (let i of DBSite[now].host) { // 遍历数组
  4436. if (i === location.host) {
  4437. if (DBSite[now].functionStart) {
  4438. DBSite[now].functionStart();
  4439. } else {
  4440. curSite = DBSite[now];
  4441. }
  4442. support = true; break; // 如果找到了就退出循环
  4443. }
  4444. }
  4445. } else if (DBSite[now].host instanceof RegExp) {
  4446. if (DBSite[now].host.test(location.host)) {
  4447. if (self != top) {if (!DBSite[now].iframe) break;} // 如果当前位于 iframe 框架下,就需要判断是否需要执行
  4448. if (DBSite[now].functionStart) {
  4449. DBSite[now].functionStart();
  4450. } else {
  4451. curSite = DBSite[now];
  4452. }
  4453. support = true; break; // 如果找到了就退出循环
  4454. }
  4455. } else if (DBSite[now].host === location.host) {
  4456. if (self != top) {if (!DBSite[now].iframe) break;} // 如果当前位于 iframe 框架下,就需要判断是否需要执行
  4457. if (DBSite[now].functionStart) {
  4458. DBSite[now].functionStart();
  4459. } else {
  4460. curSite = DBSite[now];
  4461. }
  4462. support = true; break; // 如果找到了就退出循环
  4463. }
  4464. }
  4465.  
  4466. if (support) {
  4467. console.info('[自动无缝翻页] - 其他网站(独立规则)'); return 1;
  4468. } 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)) {
  4469. console.info('[自动无缝翻页] - Discuz! 论坛'); return 2;
  4470. } else if (document.getElementById('flarum-loading')) {
  4471. console.info('[自动无缝翻页] - Flarum 论坛'); return 3;
  4472. } else if (document.querySelector('link[href*="themes/dux" i], script[src*="themes/dux" i]')) {
  4473. console.info('[自动无缝翻页] - 使用 WordPress DUX 主题的网站'); return 4;
  4474. } else if (self != top) {
  4475. return -1;
  4476. }
  4477. return 0;
  4478. }
  4479.  
  4480.  
  4481. // 获取 Cookie
  4482. function getCookie(name) {
  4483. if (!name) return ''
  4484. let arr = document.cookie.split(';');
  4485. name += '='
  4486. for (let i=0; i<arr.length; i++) {
  4487. let now = arr[i].trim();
  4488. if (now.indexOf(name) == 0) return now.substring(name.length, now.length);
  4489. }
  4490. return '';
  4491. }
  4492.  
  4493.  
  4494. // 类型 4 专用
  4495. function getPageElems(url, type = '', method = 'GET', data = '', type2) {
  4496. //console.log(url, data)
  4497. let mimeType = '';
  4498. if (curSite.pager.mimeType) mimeType = curSite.pager.mimeType;
  4499. GM_xmlhttpRequest({
  4500. url: url,
  4501. method: method,
  4502. data: data,
  4503. responseType: type,
  4504. overrideMimeType: mimeType,
  4505. headers: {
  4506. 'Referer': location.href,
  4507. 'Content-Type': (method === 'POST') ? 'application/x-www-form-urlencoded':''
  4508. },
  4509. timeout: 5000,
  4510. onload: function (response) {
  4511. try {
  4512. //console.log('最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  4513. switch (type) {
  4514. case 'json':
  4515. curSite.pager.insertElement(response.response, type2);
  4516. break;
  4517. case 'text':
  4518. curSite.pager.insertElement(response.responseText, type2)
  4519. break;
  4520. default:
  4521. curSite.pager.insertElement(ShowPager.createDocumentByString(response.responseText), type2)
  4522. }
  4523. } catch (e) {
  4524. console.log(e);
  4525. }
  4526. }
  4527. });
  4528. }
  4529.  
  4530.  
  4531. // 插入位置
  4532. function addTo(num) {
  4533. switch (num) {
  4534. case 1:
  4535. return 'beforebegin'; break;
  4536. case 2:
  4537. return 'afterbegin'; break;
  4538. case 3:
  4539. return 'beforeend'; break;
  4540. case 4:
  4541. return 'afterend'; break;
  4542. }
  4543. }
  4544.  
  4545.  
  4546. // 滚动条事件
  4547. function windowScroll(fn1) {
  4548. var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  4549. fn = fn1 || function () {};
  4550. setTimeout(function () { // 延时 1 秒执行,避免刚载入到页面就触发翻页事件
  4551. window.addEventListener('scroll', function (e) {
  4552. var afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  4553. delta = afterScrollTop - beforeScrollTop;
  4554. if (delta == 0) return false;
  4555. fn(delta > 0 ? 'down' : 'up', e);
  4556. beforeScrollTop = afterScrollTop;
  4557. }, false);
  4558. }, 1000)
  4559. }
  4560.  
  4561.  
  4562. // 修改自 https://greasyfork.org/scripts/14178 , https://github.com/machsix/Super-preloader
  4563. var ShowPager = {
  4564. getFullHref: function (e) {
  4565. if (e != null && e.nodeType === 1 && e.href && e.href.slice(0,4) === 'http') {
  4566. if (curSite.pager.forceHTTPS && location.protocol === 'https:') {return e.href.replace(/^http:/,'https:');}
  4567. return e.href;
  4568. }
  4569. return '';
  4570. },
  4571. createDocumentByString: function (e) {
  4572. if (e) {
  4573. if ('HTML' !== document.documentElement.nodeName) return (new DOMParser).parseFromString(e, 'application/xhtml+xml');
  4574. var t;
  4575. try { t = (new DOMParser).parseFromString(e, 'text/html');} catch (e) {}
  4576. if (t) return t;
  4577. if (document.implementation.createHTMLDocument) {
  4578. t = document.implementation.createHTMLDocument('ADocument');
  4579. } else {
  4580. 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) {}
  4581. }
  4582. if (t) {
  4583. var r = document.createRange(),
  4584. n = r.createContextualFragment(e);
  4585. r.selectNodeContents(document.body);
  4586. t.body.appendChild(n);
  4587. 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);
  4588. return t;
  4589. }
  4590. } else console.error('没有找到要转成 DOM 的字符串');
  4591. },
  4592. loadMorePage: function () {
  4593. if (curSite.pager) {
  4594. var url;
  4595. if (typeof curSite.pager.nextLink == 'function') {
  4596. url = curSite.pager.nextLink();
  4597. } else {
  4598. if (curSite.pager.nextLink.slice(0,4) === 'css;') {
  4599. url = this.getFullHref(getElementByCSS(curSite.pager.nextLink.slice(4)));
  4600. } else {
  4601. url = this.getFullHref(getElementByXpath(curSite.pager.nextLink));
  4602. }
  4603. }
  4604. //console.log(url, curSite.pageUrl);
  4605. if (url === '') return;
  4606. if (curSite.pageUrl === url) return;// 避免重复加载相同的页面
  4607. curSite.pageUrl = url;
  4608. let mimeType = '';
  4609. if (curSite.pager.mimeType) mimeType = curSite.pager.mimeType;
  4610. // 读取下一页的数据
  4611. GM_xmlhttpRequest({
  4612. url: url,
  4613. method: 'GET',
  4614. overrideMimeType: mimeType,
  4615. headers: {
  4616. 'Referer': location.href
  4617. },
  4618. timeout: 5000,
  4619. onload: function (response) {
  4620. try {
  4621. //console.log('最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  4622. var newBody = ShowPager.createDocumentByString(response.responseText);
  4623. let pageElems = getAllElements(curSite.pager.pageElement, newBody, newBody),
  4624. toElement = getAllElements(curSite.pager.insertPosition[0])[0];
  4625. //console.log(curSite.pager.pageElement, pageElems, curSite.pager.insertPosition, toElement)
  4626.  
  4627. if (pageElems.length >= 0) {
  4628. // 如果有插入前函数就执行函数
  4629. if (curSite.function && curSite.function.before) {
  4630. if (curSite.function.parameter) { // 如果指定了参数
  4631. pageElems = curSite.function.before(curSite.function.parameter);
  4632. } else {
  4633. pageElems = curSite.function.before(pageElems);
  4634. }
  4635. }
  4636.  
  4637. // 插入位置
  4638. let addTo1 = addTo(curSite.pager.insertPosition[1]);
  4639.  
  4640. // 插入新页面元素
  4641. pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo1, one);});
  4642.  
  4643. // 当前页码 + 1
  4644. pageNum.now = pageNum._now + 1
  4645.  
  4646. // 插入 <script> 标签
  4647. if (curSite.pager.scriptType) {
  4648. let scriptText = '';
  4649. if (curSite.pager.scriptType === 1) { // 下一页的所有 <script> 标签
  4650. const scriptElems = getAllElements('//script', newBody, newBody);
  4651. scriptElems.forEach(function (one) {
  4652. if (one.src) {
  4653. toElement.appendChild(document.createElement('script')).src = one.src;
  4654. } else {
  4655. scriptText += ';' + one.textContent;
  4656. }
  4657. });
  4658. toElement.appendChild(document.createElement('script')).textContent = scriptText;
  4659. } else if (curSite.pager.scriptType === 2) { // 下一页主体元素同级 <script> 标签
  4660. pageElems.forEach(function (one) {if (one.tagName === 'SCRIPT') {scriptText += ';' + one.textContent;}});
  4661. if (scriptText) toElement.appendChild(document.createElement('script')).textContent = scriptText;
  4662. } else if (curSite.pager.scriptType === 3) { // 下一页主体元素同级 <script> 标签(远程文件)
  4663. pageElems.forEach(function (one) {if (one.tagName === 'SCRIPT' && one.src) {toElement.appendChild(document.createElement('script')).src = one.src;}});
  4664. } else if (curSite.pager.scriptType === 4) { // 下一页主体元素子元素 <script> 标签
  4665. pageElems.forEach(function (one) {
  4666. const scriptElems = one.querySelectorAll('script');
  4667. scriptElems.forEach(function (script) {scriptText += ';' + script.textContent;});
  4668. });
  4669. if (scriptText) toElement.appendChild(document.createElement('script')).textContent = scriptText;
  4670. }
  4671. }
  4672.  
  4673. // 添加历史记录
  4674. if (curSite.pager.history && curSite.pager.history == true) {
  4675. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, newBody.querySelector('title').textContent, curSite.pageUrl);
  4676. }
  4677.  
  4678. // 替换待替换元素
  4679. if (curSite.pager.replaceE) {
  4680. try {
  4681. let oriE = getAllElements(curSite.pager.replaceE),
  4682. repE = getAllElements(curSite.pager.replaceE, newBody, newBody);
  4683. //console.log(oriE, repE);
  4684. if (oriE.length === repE.length) {
  4685. for (let i = 0; i < oriE.length; i++) {
  4686. oriE[i].outerHTML = repE[i].outerHTML;
  4687. }
  4688. }
  4689. } catch (e) {
  4690. console.log(e);
  4691. }
  4692. }
  4693. // 如果有插入后函数就执行函数
  4694. if (curSite.function && curSite.function.after) {
  4695. if (curSite.function.parameter) { // 如果指定了参数
  4696. curSite.function.after(curSite.function.parameter);
  4697. } else {
  4698. curSite.function.after();
  4699. }
  4700. }
  4701. }
  4702. } catch (e) {
  4703. console.log(e);
  4704. }
  4705. }
  4706. });
  4707. }
  4708. },
  4709. };
  4710. function getElementByCSS(css, contextNode = document) {
  4711. return contextNode.querySelector(css);
  4712. }
  4713. function getAllElementsByCSS(css, contextNode = document) {
  4714. return [].slice.call(contextNode.querySelectorAll(css));
  4715. }
  4716. function getElementByXpath(xpath, contextNode, doc = document) {
  4717. contextNode = contextNode || doc;
  4718. try {
  4719. const result = doc.evaluate(xpath, contextNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  4720. // 应该总是返回一个元素节点
  4721. return result.singleNodeValue && result.singleNodeValue.nodeType === 1 && result.singleNodeValue;
  4722. } catch (err) {
  4723. throw new Error(`Invalid xpath: ${xpath}`);
  4724. }
  4725. }
  4726. function getAllElementsByXpath(xpath, contextNode, doc = document) {
  4727. contextNode = contextNode || doc;
  4728. const result = [];
  4729. try {
  4730. const query = doc.evaluate(xpath, contextNode, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  4731. for (let i = 0; i < query.snapshotLength; i++) {
  4732. const node = query.snapshotItem(i);
  4733. // 如果是 Element 节点
  4734. if (node.nodeType === 1) result.push(node);
  4735. }
  4736. } catch (err) {
  4737. throw new Error(`无效 Xpath: ${xpath}`);
  4738. }
  4739. return result;
  4740. }
  4741. function getAllElements(selector, contextNode = undefined, doc = document, win = window, _cplink = undefined) {
  4742. if (!selector) return [];
  4743. contextNode = contextNode || doc;
  4744. if (typeof selector === 'string') {
  4745. if (selector.search(/^css;/i) === 0) {
  4746. return getAllElementsByCSS(selector.slice(4), contextNode);
  4747. } else {
  4748. return getAllElementsByXpath(selector, contextNode, doc);
  4749. }
  4750. } else {
  4751. const query = selector(doc, win, _cplink);
  4752. if (!Array.isArray(query)) {
  4753. throw new Error('getAllElements 返回错误类型');
  4754. } else {
  4755. return query;
  4756. }
  4757. }
  4758. }
  4759.  
  4760. // 自定义 locationchange 事件(用来监听 URL 变化)
  4761. function addLocationchange() {
  4762. history.pushState = ( f => function pushState(){
  4763. var ret = f.apply(this, arguments);
  4764. window.dispatchEvent(new Event('pushstate'));
  4765. window.dispatchEvent(new Event('locationchange'));
  4766. return ret;
  4767. })(history.pushState);
  4768.  
  4769. history.replaceState = ( f => function replaceState(){
  4770. var ret = f.apply(this, arguments);
  4771. window.dispatchEvent(new Event('replacestate'));
  4772. window.dispatchEvent(new Event('locationchange'));
  4773. return ret;
  4774. })(history.replaceState);
  4775.  
  4776. window.addEventListener('popstate',()=>{
  4777. window.dispatchEvent(new Event('locationchange'))
  4778. });
  4779. }
  4780.  
  4781. /*// 监听 XMLHttpRequest URL
  4782. var _send = window.XMLHttpRequest.prototype.send
  4783. function sendReplacement(data) {
  4784. console.log(data)
  4785. return _send.apply(this, arguments);
  4786. }
  4787. window.XMLHttpRequest.prototype.send = sendReplacement;
  4788. // 监听 XMLHttpRequest 模式(GET/POST)和数据
  4789. var _open = window.XMLHttpRequest.prototype.open
  4790. function openReplacement(data) {
  4791. console.log(data, arguments)
  4792. return _open.apply(this, arguments);
  4793. }
  4794. window.XMLHttpRequest.prototype.open = openReplacement;*/
  4795. })();