自动无缝翻页

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

当前为 2021-11-07 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name 自动无缝翻页
  3. // @version 3.3.1
  4. // @author X.I.U
  5. // @description 无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、DUX/XIU/D8/Begin(WP主题)」网站]、百度、谷歌、必应、搜狗、头条搜索、360 搜索、微信搜索、贴吧、豆瓣、微博、NGA、V2EX、B 站(Bilibili)、蓝奏云、煎蛋网、糗事百科、龙的天空、起点小说、IT之家、千图网、Pixabay、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、FitGirl、片库、茶杯狐、NO视频、低端影视、奈菲影视、91美剧网、音范丝、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、极简插件、小众软件、动漫狂、漫画猫、漫画DB、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了...
  6. // @match *://*/*
  7. // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAALfElEQVRYhX2Xe3Bd1XXGf3vvc859X+nq6nUlW5Yly7JlI2xsYzAwtnk4ATpAxkNTHm0mnaTT/gHTTvrIBDLTpp1JUoZppqHQls5AKTR2INOWJJQSXF4x2BhsJCRZ8kuWZckPSVf3/Trn7N3RVTFpQrNn1l97n7O/vda31reWMKMPcmUJA9U8vrwHGdqCHn4HPzePaIxhVSoYbYRXrn7BeMVbCUduF6kVUXHwvQP+6amDaqDnoIompmQytaBnTmB8H5lowrjgFss48SBeI/hUEEZeudLi1ywhJEIJdL6Q8rzal/1a5SGC4XZrYBvWwEZobMdLdH6RH+z/Io1taEeh52fe8tOZbysl/ouWFvANYP7fSz4DgAEBBIL4xiS8ubmnVcTZK68aRK29Dtm8dgnZJydRW+/E2nrnp19nz+7U77+60zt0qMz07J/KxuQTwrIw4rMBCDP6wC+FIIcO34eudDdXf/7jD52Opi772lugY3AZr++hp06gz48j+waRqTWYmVHcS+chEMFeuw1hBzBzY7g/fQE9fmqBYPzBQKrpVa/R4OkCAnXlSvXnX9sIllk220BE4Z8OdHoj54YCK6Od1i2/iUmuRyDRk6NUn3+M0pv/hnf0AE40jEjEqP3oe6Rf/CGOWUTNjFKby2MP7EBtugURFWFxfOhB4+o4yfhrGAdZsxHaqZt6dNce9KXYFSPfGWS68JFqTXSqO7+MCaTqETGTwxSeeoRCOoPT2YUIhFC2jbQF/uwUatU6rPbVUM5T+OfHUO3dWKv6kSsGUIOD6PEPr+fswnanpecFZYVQhFAyjPS9Tj4xw2rcU+pJApEutWsvRjaBW8NUShilkE1JIqlUPfi6VMLNFTBVr+7KYKqJ8uEjlM+dJrR5K0L7eB+9hTd2CFrWYt33h0jH3O5Nj37TBGtgZUBkUN/6q4dQ7UmsnlW450//gU5PPRq460uQXAu+j//i99A/+UdUMoXqbMNkz2OnUkixlF4u9spe/HMTULyEaA7jXkoT2fEbQIXi838DJ4cRDXHkEjc2b0MPHdptZubGpBUbM0UfKQpBRDmKWRSD3tTMk87gddA2WGe4+dkzMD0CyQ5qP/4XVDCAvfkaLMvHamzEClpQzGDF46iuJOH1CaKr2tDZRfzhQ0Ru24NYsYrCM4/jDb+FiHdi3XU/0s3vr7WsGKxcfyPSy+bxi0UqJ8f/IriiE2vrnuWsLefQk8NoO4AMBBB9/XjDI6hQCjdTxq9WCaQ6ULaDFrIeKr3oIlv70Olz2K1xlAVaSUQojD786nKi9e5A3LBHMHn0W+LUUaS1FI9q+iZZWLhHdq/FxFbWSSfsIDIQwVw4g/GK2OuuhloNMzaCaF+DNBJtQfX8LFYigElX0OkQtZKHVy3jqwDlqWncCzPI3nU4t+2FWrH+OLHzHpRl3109memTOhqDi9NfkefHEKvWLTO+VKD68Qf4G27CueFWhJ/Df+0lVFcXJOJYnobm1ZjsJUxuFjyDjK/GNK2gND4ESuDPXcCOSaI7thPqX0ft8OtUn/oTKOQgkET39KJU4RbpZXOtNRW717p+FyRSdYT+v36H4u/fQXbfc3iRDkT3FsTGjWAWEU0OZKfAU9CyEdXVD2lQPduplmo4jkBEbMzK1VgDu5EVTe3gm1RHx6Bcxpz6YLkEO0lMYeFGi6z7eVMqhkT/ZrCb0LNT+NMTRH/nt/BLRdy3X8Nv68Lu6cZEHURjE6K3hirYeLRhDWyA4jxzH40RXJwkeuM29MpN+JcziEsz+Avz6GgcW1pYbUlEQCyHwYpSyxS7rGo+v8man4ZMATrAHf+QSt7FTkWR4QbsjlbIX8IMH0VuuAqj4piGAbhmEPPzI/injnNxMUPuwOtseOIxKKTJ7/8BTBxDdXcjO9sJdTeg01VqH4wg3CDB9bshHMKORbGolVOmeRW09dVdUxkbp3ruNM7GXnS1hK5OYSoSbBDZBcxCBtF3DcUzk6hkhGA0RmtHKx1rOkE04lbzWC1tqMRt1CZHUafPIs8H6/JsNTcgN+9YFq1qgbBUFUvnK9qrVghXCvWN8MBmivueJDtylqaeBKWJaXR4JZEtNyBWrkGt6AJboCZO4J49Rc64xGIhcgtZgm6egKhgtUQQto17WeHOLqCNj5Vowbr7q4j+Lcs1JhhEphcXLTebd0jPwpkx6Lwa++bbCR95ALecp5a6BrvrJoLdHajmMOTnKb3+BrVMntjARpzeFbz8jcfpa22gGm+kMJlm95Zu9M9+iI5G0G3d6EgIUSnjzs/gv/Icgd6rqcvz0IeYWnXc8pEtYnEe8gtXNL7xz74LehHSE3DqNP7EIdx3p5DSh7JNJePiBE/gN3Uz8NWHae5sRJYXqKQvU+raQPg7L6L3/QNMHcfp6EREGjC5LDp9GaOs5VQ/NQI93YctOxFPlwniDh/C3n47JHvrQPTBl3DHjiIDQUQ4jGhOYcqaQFuE0Nl53OnLRHfsZV33KsTxd6GlHeaP477zMl5uAWv7dkyLg6kZREsb+vgCcvPOuoaYuWNQWERs3jAuQ6nooXK6TH566cXnrjQK7uwFaoseWA3oJf2WEhEJUjm/gMgXCfdvQlFFv/R3uCND6FIRv7MfMnOIiaPoI/8NEb2kWAhfoLbdjLr2jmUv/8f+pVbkHRGNnZHum2/udxxtCn4j/vgEIjNTD4O9upfIprUYoxBKo9Z14jumTq7YYD9WayvuR++hs1lkshmha4iuNeDYiIAFMoCevIi+cJHaa29gmvsRTUn0R29g9u1D7bxxv+jrRnpD56cCkdjfV9NzpA+8A5VlLojWAczlGVTAYKXimIU8MlsjtKEXgiF0aRGdm8cEYnXm+O+/gdAGuWsP3shhTHoOEYqCCEF2DsrF5f+e/xiikUldrT6l3z+GevSaTahaZdRY6uFqxRXR1sRyzU/21Gu6OTOMfzmPd6kI8TgiX8B4imouj1QCKmVUNITJ59AnR1F77kH4ZaRnQFroMyeRW3egdt6DwIX391Gshv+4LK2jtcuLqK9t7ALjZXzH1uVM/mb/7BTRnjZEex+idQ2EAnjjR/BdF1PIoV2Bae/F/fh9dL5IYE0XUmpMNo+ev4AINSJWb0UPHa63Z7SvRN3/CHJpFHj2G4iZzAuBbTu+GWpIEGxrQ/3RnlvxG5M4kYa3Lc2u4uyFblnIE+xfAbF2RMtqZGsn/uTYUgHH+dz9eFMnqYx8gO+CEwkjhcDPF/DLHurSaeTm3RiWMsDHeuDrSFvBv3+bi08+N1Vwuj/vZWtu+dwclZlFrESoeZmZysJXoTsCjnVk8dDQBuN+n8RDD9fbcdG7leBX1iOkQjhBOHmQfKGAHW3CS6fR+QClmYuYMyPY265DtPVgtfctiw4V/GcfYfGNQzj3/u4DqlormUoZEQwuc0I//eSnY4G0wPJjmdGhw+mh0fWxNZ0037cXccPd1MXgk+GjNE/tR3+Le+YEyg5TnT6LXlwgcu1u7C99HZlsv3K2+vjvkTs2RvDe3747tm7Dy1SKvzSYPP/MLwxFAkIKEzEye2zswOXX395lJyK0fOFzRHfuglQfqPin59Nn0RNDuJk09vprkd0brmx5H7xCbfgQbrZ83OkfvN1pj0+ZmkBYNhjzCwCeffr/AsBDJyU6kqBwbPzRuTcP/GXV82lYlaJpfQ+BjVdhXX0tNKTAjvzKqKXPTeC++1NKY0c9kVz1SGzb9X8tjIdfzSFCDfUw/noA0scPuxBrwcvmmH3rQIvMm3/y0XdJS4JfIpiIUG9g+wcg6KDnZpGZNDQ0Ii5cSAtlPRHYct13axWvJNwadiiAli4iEP8VAJ89HQtR129TLiG1nos0Nt8dSOi12qi9lRq3utVqT/lirql24hW3vLBQi3d3XUqu73+PZOonBNR/WnbYSMeGTO5/Xf6ZtwDwPwtFRezQVs+sAAAAAElFTkSuQmCC
  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', 'tieba.baidu.com', 'www.cadtutor.net', 'www.theswamp.org'];
  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 ([2,4,5,6].indexOf(webType) > -1 || 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. insStyle: 要插入网页的 CSS Style 样式
  81. type:
  82. 1 = 由脚本实现自动无缝翻页
  83. 2 = 网站自带了自动无缝翻页功能,只需要点击下一页按钮即可
  84. nextText: 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页)
  85. nextTextOf: 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页)
  86. nextHTML: 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页)
  87. interval: 点击间隔时间,对于没有按钮文字变化的按钮,可以手动指定间隔时间,单位:ms
  88. isHidden: 只有下一页按钮可见时(没有隐藏),才会点击
  89. 3 = 依靠元素距离可视区域底部的距离来触发翻页
  90. scrollE: 作为基准的元素(一般为底部页码元素)
  91. scrollD: 基准元素 减去 可视区域底部
  92. 4 = 部分简单的动态加载类网站
  93. insertE: 插入元素的函数
  94. insertP:
  95. 1 = 插入该元素本身的前面;
  96. 2 = 插入该元素当中,第一个子元素前面;
  97. 3 = 插入该元素当中,最后一个子元素后面;
  98. 4 = 插入该元素本身的后面;
  99. 5 = 插入该元素末尾(针对小说网站等文本类的)
  100. scriptT: 单独插入 <script> 标签
  101. 1 = 下一页的所有 <script> 标签
  102. 2 = 下一页主体元素同级 <script> 标签
  103. 3 = 下一页主体元素同级 <script> 标签(远程文件)
  104. 4 = 下一页主体元素子元素 <script> 标签
  105. history: 添加历史记录 并 修改当前 URL
  106. forceHTTPS: 下一页链接强制 HTTPS
  107. hiddenPN: 不显示脚本左下角的页码
  108. scrollD:数值越大,滚动条触发点越靠上(越早开始翻页),一般是访问网页速度越慢,该值就需要越大(如果 Type = 3,则相反)
  109. function:
  110. bF = 插入前执行函数;
  111. aF = 插入后执行函数;
  112. pF = 参数
  113. */
  114. DBSite = {
  115. discuz_forum: {
  116. pager: {
  117. type: 2,
  118. nextL: 'css;#autopbn',
  119. nextTextOf: '下一页',
  120. scrollD: 1500
  121. }
  122. }, // Discuz! 论坛 - 帖子列表(自带无缝加载下一页按钮的)
  123. discuz_guide: {
  124. pager: {
  125. type: 1,
  126. nextL: '//a[contains(@class, "nxt") or contains(@class, "next")][not(contains(@href, "javascript"))]',
  127. pageE: 'css;#threadlist table > tbody[id^="normalthread_"]',
  128. insertP: ['id("threadlist")//table/tbody[starts-with(@id, "normalthread_")]/parent::table', 3],
  129. replaceE: 'css;.pg, .pages',
  130. scrollD: 1000
  131. }
  132. }, // Discuz! 论坛 - 导读页 及 帖子列表(不带无缝加载下一页按钮的)
  133. discuz_waterfall: {
  134. pager: {
  135. type: 1,
  136. nextL: '//a[contains(@class, "nxt") or contains(@class, "next")][not(contains(@href, "javascript"))]',
  137. pageE: 'css;#waterfall > li',
  138. insertP: ['css;#waterfall', 3],
  139. replaceE: 'css;.pg, .pages',
  140. scrollD: 1000
  141. }
  142. }, // Discuz! 论坛 - 图片模式的帖子列表(不带无缝加载下一页按钮的)
  143. discuz_thread: {
  144. insStyle: '.pgbtn {display: none;}',
  145. pager: {
  146. type: 1,
  147. nextL: '//a[contains(@class, "nxt") or contains(@class, "next")][not(contains(@href, "javascript"))]',
  148. pageE: 'css;#postlist > div[id^="post_"]',
  149. insertP: ['css;#postlist', 3],
  150. replaceE: 'css;.pg, .pages',
  151. scrollD: 1000
  152. },
  153. function: {
  154. bF: src_bF,
  155. pF: [0, 'img[file]', 'file']
  156. }
  157. }, // Discuz! 论坛 - 帖子内
  158. discuz_search: {
  159. pager: {
  160. type: 1,
  161. nextL: '//a[contains(@class, "nxt") or contains(@class, "next")][not(contains(@href, "javascript"))]',
  162. pageE: 'css;#threadlist > ul',
  163. insertP: ['css;#threadlist', 3],
  164. replaceE: 'css;.pg, .pages',
  165. scrollD: 1000
  166. }
  167. }, // Discuz! 论坛 - 搜索页
  168. discuz_youspace: {
  169. pager: {
  170. type: 1,
  171. nextL: '//a[contains(@class, "nxt") or contains(@class, "next")][not(contains(@href, "javascript"))]',
  172. pageE: 'css;tbody > tr:not(.th)',
  173. insertP: ['css;tbody', 3],
  174. replaceE: 'css;.pg, .pages',
  175. scrollD: 1000
  176. }
  177. }, // Discuz! 论坛 - 回复页、主题页(别人的)
  178. discuz_collection: {
  179. pager: {
  180. type: 1,
  181. nextL: '//a[contains(@class, "nxt") or contains(@class, "next")][not(contains(@href, "javascript"))]',
  182. pageE: 'css;#ct .bm_c table > tbody',
  183. insertP: ['css;#ct .bm_c table', 3],
  184. replaceE: 'css;.pg, .pages',
  185. scrollD: 1000
  186. }
  187. }, // Discuz! 论坛 - 淘帖页
  188. flarum: {
  189. functionStart: function() {locationChange = true;if (location.pathname.indexOf('/d/') === -1) {curSite = DBSite.flarum;}},
  190. pager: {
  191. type: 2,
  192. nextL: 'css;.DiscussionList-loadMore > button[title]',
  193. interval: 500,
  194. scrollD: 1000
  195. }
  196. }, // Flarum 论坛
  197. phpbb: {
  198. functionStart: function() {if (location.pathname.indexOf('/viewforum.php') > -1) {
  199. curSite = DBSite.phpbb;
  200. } else if (location.pathname.indexOf('/viewtopic.php') > -1 && GM_getValue('menu_discuz_thread_page')) {
  201. curSite = DBSite.phpbb_post;
  202. } else if (location.pathname.indexOf('/search.php') > -1) {
  203. curSite = DBSite.phpbb_search;
  204. }},
  205. pager: {
  206. type: 1,
  207. nextL: 'css;.pagination li.next a[rel="next"], .topic-actions .pagination strong~a',
  208. pageE: 'css;.forumbg:not(.announcement) ul.topiclist.topics > li',
  209. insertP: ['css;.forumbg:not(.announcement) ul.topiclist.topics', 3],
  210. replaceE: 'css;.action-bar .pagination, .topic-actions .pagination',
  211. scrollD: 2000
  212. }
  213. }, // phpBB 论坛 - 帖子列表
  214. phpbb_post: {
  215. pager: {
  216. type: 1,
  217. nextL: 'css;.pagination li.next a[rel="next"], .topic-actions .pagination strong~a',
  218. pageE: 'css;div.post[id], div.post[id]+hr',
  219. insertP: ['(//div[contains(@class, "post ")][@id]/following-sibling::hr[last()] | //div[contains(@class, "post ")][@id][last()])[last()]', 4],
  220. replaceE: 'css;.action-bar .pagination, .topic-actions .pagination',
  221. scrollD: 2000
  222. }
  223. }, // phpBB 论坛 - 帖子内
  224. phpbb_search: {
  225. pager: {
  226. type: 1,
  227. nextL: 'css;.pagination li.next a[rel="next"], .topic-actions .pagination strong~a',
  228. pageE: 'css;div.search.post',
  229. insertP: ['//div[contains(@class, "search") and contains(@class, "post")][last()]', 1],
  230. replaceE: 'css;.action-bar .pagination, .pagination',
  231. scrollD: 2000
  232. }
  233. }, // phpBB 论坛 - 搜索页
  234. xenforo: {
  235. functionStart: function() {if (location.pathname.indexOf('/forums/') > -1 || location.pathname.indexOf('/f/') > -1) {
  236. curSite = DBSite.xenforo;
  237. } else if ((location.pathname.indexOf('/threads/') > -1 || location.pathname.indexOf('/t/') > -1) && GM_getValue('menu_discuz_thread_page')) {
  238. curSite = DBSite.xenforo_post;
  239. } else if (location.pathname.indexOf('/search/') > -1) {
  240. curSite = DBSite.xenforo_search;
  241. }},
  242. pager: {
  243. type: 1,
  244. nextL: 'css;a.pageNav-jump--next',
  245. pageE: 'css;.structItemContainer-group.js-threadList > div',
  246. insertP: ['css;.structItemContainer-group.js-threadList', 3],
  247. replaceE: 'css;nav.pageNavWrapper',
  248. scrollD: 2500
  249. }
  250. }, // XenForo 论坛 - 帖子列表
  251. xenforo_post: {
  252. pager: {
  253. type: 1,
  254. nextL: 'css;a.pageNav-jump--next',
  255. pageE: 'css;.block-body.js-replyNewMessageContainer > article',
  256. insertP: ['css;.block-body.js-replyNewMessageContainer', 3],
  257. replaceE: 'css;nav.pageNavWrapper',
  258. scrollD: 2500
  259. }
  260. }, // XenForo 论坛 - 帖子内
  261. xenforo_search: {
  262. pager: {
  263. type: 1,
  264. nextL: 'css;a.pageNav-jump--next',
  265. pageE: 'css;ol.block-body > li',
  266. insertP: ['css;ol.block-body', 3],
  267. replaceE: 'css;nav.pageNavWrapper',
  268. scrollD: 2500
  269. }
  270. }, // XenForo 论坛 - 搜索页
  271. xiuno: {
  272. functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/index') > -1 || location.pathname.indexOf('/forum') > -1) {
  273. curSite = DBSite.xiuno;
  274. } else if (location.pathname.indexOf('/thread') > -1 && GM_getValue('menu_discuz_thread_page')) {
  275. curSite = DBSite.xiuno_post;
  276. if (document.querySelector('ul.postlist > li.newpost')) curSite.pager.insertP = ['(//ul[contains(@class, "postlist")][./li[contains(@class, "newpost")]])[last()]', 1]; // 有的带回复框,需要插入到前面
  277. }},
  278. pager: {
  279. type: 1,
  280. nextL: '//li/a[contains(text(), "▶")]',
  281. pageE: 'css;ul.threadlist > li',
  282. insertP: ['css;ul.threadlist', 3],
  283. replaceE: 'css;ul.pagination',
  284. scrollD: 1500
  285. }
  286. }, // Xiuno 论坛 - 帖子列表
  287. xiuno_post: {
  288. pager: {
  289. type: 1,
  290. nextL: '//li/a[contains(text(), "▶")]',
  291. pageE: '(//ul[contains(@class, "postlist")][./li[@data-uid]])[last()]/li',
  292. insertP: ['(//ul[contains(@class, "postlist")][./li[@data-uid]])[last()]', 3],
  293. replaceE: 'css;ul.pagination',
  294. scrollD: 1500
  295. }
  296. }, // Xiuno 论坛 - 帖子内
  297. dux: {
  298. functionStart: function() {if (location.pathname.indexOf('.html') === -1) curSite = DBSite.dux;},
  299. host: 'www.puresys.net',
  300. pager: {
  301. type: 1,
  302. nextL: 'css;li.next-page > a',
  303. pageE: 'css;.content > article',
  304. insertP: ['css;.content > .pagination', 1],
  305. replaceE: 'css;.content > .pagination',
  306. scrollD: 1500
  307. },
  308. function: {
  309. bF: src_bF,
  310. pF: [0, 'img.thumb[data-src]', 'data-src']
  311. }
  312. }, // WordPress 的 DUX、XIU、D8 主题
  313. begin: {
  314. functionStart: function() {if (location.search.slice(0,3) === '?s=') {curSite = DBSite.begin_search;} else if (location.pathname.indexOf('.html') === -1) {curSite = DBSite.begin;}},
  315. pager: {
  316. type: 2,
  317. nextL: 'css;div[id^="ias_trigger_"]',
  318. interval: 500,
  319. scrollD: 1500
  320. }
  321. }, // WordPress 的 Begin 主题
  322. begin_search: {
  323. pager: {
  324. type: 1,
  325. nextL: 'css;a.next',
  326. pageE: 'css;#main > ul > li',
  327. insertP: ['css;#main > ul', 3],
  328. replaceE: 'css;nav.pagination',
  329. scrollD: 1500
  330. }
  331. }, // WordPress 的 Begin 主题 - 搜索页
  332. biquge: {
  333. functionStart: function() {if (/\d+\/\d+\.html/.test(location.pathname)) {curSite = DBSite.biquge;}},
  334. pager: {
  335. type: 1,
  336. nextL: '//a[contains(text(), "下一章") or contains(text(), "下一页")]',
  337. pageE: 'css;#content',
  338. insertP: ['css;#content', 5],
  339. replaceE: '//*[./a[contains(text(), "下一章") or contains(text(), "下一页")]] | //title',
  340. history: true,
  341. scrollD: 1500
  342. }
  343. }, // 笔趣阁 模板的小说网站
  344. baidu: {
  345. host: 'www.baidu.com',
  346. insStyle: '.new-pmd .c-img-border {position: initial !important;} .op-bk-polysemy-video__wrap.c-gap-bottom {display: none !important;}',
  347. pager: {
  348. type: 1,
  349. nextL: 'id("page")//a[contains(text(),"下一页")]',
  350. pageE: 'css;#content_left > *',
  351. insertP: ['css;#content_left', 3],
  352. replaceE: 'css;#page',
  353. scrollD: 1200
  354. }
  355. }, // 百度 搜素
  356. google: {
  357. host: /.google./,
  358. functionStart: function() {if (location.pathname === '/search') {
  359. curSite = DBSite.google;
  360. } else if (location.pathname === '/scholar') {
  361. curSite = DBSite.google_scholar;
  362. }},
  363. pager: {
  364. type: 1,
  365. nextL: 'css;#pnnext',
  366. pageE: 'css;#res > *',
  367. insertP: ['css;#res', 3],
  368. replaceE: 'id("navcnt") | id("rcnt")//div[@role="navigation"]',
  369. scriptT: 1,
  370. scrollD: 3000
  371. }
  372. }, // 谷歌 搜索
  373. bing: {
  374. host: ['www.bing.com','cn.bing.com'],
  375. functionStart: function() {if (location.pathname === '/search') {
  376. curSite = DBSite.bing;
  377. } else if (location.pathname === '/academic/search') {
  378. curSite = DBSite.bing_academic;
  379. }},
  380. insStyle: '.b_imagePair.square_mp > .inner {display: none !important;}',
  381. pager: {
  382. type: 1,
  383. nextL: '//a[contains(@class,"sb_pagN")]',
  384. pageE: 'css;#b_results > li:not(.b_msg):not(.b_pag):not(#mfa_root)',
  385. insertP: ['css;#b_results > .b_pag', 1],
  386. replaceE: 'css;#b_results > .b_pag',
  387. scrollD: 1500
  388. }
  389. }, // 必应 搜索
  390. sogou: {
  391. host: 'www.sogou.com',
  392. functionStart: function() {if (location.pathname != '/') {curSite = DBSite.sogou;}},
  393. pager: {
  394. type: 1,
  395. nextL: 'css;#sogou_next',
  396. pageE: 'css;.results > *',
  397. insertP: ['css;.results', 3],
  398. replaceE: 'css;#pagebar_container',
  399. scriptT: 4,
  400. scrollD: 1200
  401. }
  402. }, // 搜狗 搜索
  403. sogou_weixin: {
  404. host: 'weixin.sogou.com',
  405. functionStart: function() {if (location.pathname === '/') {
  406. curSite = DBSite.sogou_weixin;
  407. } else if (location.pathname === '/weixin') {
  408. curSite = DBSite.sogou_weixin_search;
  409. }},
  410. pager: {
  411. type: 2,
  412. nextL: 'css;#look-more',
  413. interval: 1000,
  414. scrollD: 1000
  415. }
  416. }, // 搜狗微信 - 首页
  417. sogou_weixin_search: {
  418. pager: {
  419. type: 1,
  420. nextL: 'css;#sogou_next',
  421. pageE: 'css;ul[class*="news-list"] > li',
  422. insertP: ['css;ul[class*="news-list"]', 3],
  423. replaceE: 'css;#pagebar_container',
  424. scrollD: 1000
  425. }
  426. }, // 搜狗微信 - 搜索
  427. toutiao: {
  428. host: ['www.toutiao.com', 'so.toutiao.com'],
  429. functionStart: function() {if (location.hostname != 'www.toutiao.com') {if (location.pathname === '/search') {curSite = DBSite.toutiao;}}},
  430. pager: {
  431. type: 1,
  432. nextL: '//div[contains(@class, "-pagination")]/a[contains(string(), "下一页")]',
  433. pageE: 'css;div[class*="-result-list"] > .result-content[data-i]',
  434. insertP: ['css;div[class*="-result-list"] > .result-content:not([data-i]):last-child', 1],
  435. replaceE: 'css;div[class*="-pagination"]',
  436. scrollD: 1200
  437. },
  438. function: {
  439. bF: toutiao_bF
  440. }
  441. }, // 头条 搜索
  442. so: {
  443. host: 'www.so.com',
  444. functionStart: function() {if (location.pathname != '/') {curSite = DBSite.so; insStyle('img {opacity: 1 !important;}')}},
  445. pager: {
  446. type: 1,
  447. nextL: 'css;a#snext',
  448. pageE: 'css;ul.result > li, style:not(src)',
  449. insertP: ['css;ul.result', 3],
  450. replaceE: 'css;#page',
  451. scrollD: 1200
  452. },
  453. function: {
  454. bF: src_bF,
  455. pF: [0, 'img[data-isrc]', 'data-isrc']
  456. }
  457. }, // 360 搜索
  458. duckduckgo: {
  459. host: 'duckduckgo.com',
  460. functionStart: function() {
  461. if (getCookie('av') != '1') {
  462. document.cookie='av=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 强制开启自带的无缝翻页功能
  463. location.reload(); // 刷新网页
  464. }
  465. },
  466. }, // DuckDuckGo 搜索
  467. startpage: {
  468. host: 'www.startpage.com',
  469. functionStart: function() {if (location.pathname.indexOf('/search') > -1) {curSite = DBSite.startpage;}},
  470. pager: {
  471. type: 1,
  472. nextL: startpage_nextL,
  473. pageE: 'css;section.w-gl--desktop > div',
  474. insertP: ['css;section.w-gl--desktop', 3],
  475. replaceE: 'css;.pagination',
  476. scrollD: 1500
  477. }
  478. }, // Startpage 搜索
  479. yandex: {
  480. host: 'yandex.com',
  481. functionStart: function() {if (location.pathname === '/search/') {curSite = DBSite.yandex;}},
  482. pager: {
  483. type: 1,
  484. nextL: 'css;a.pager__item_kind_next',
  485. pageE: 'css;#search-result > *, style',
  486. insertP: ['css;#search-result', 3],
  487. replaceE: 'css;.pager',
  488. scrollD: 1500
  489. }
  490. }, // Yandex 搜索
  491. yahoo: {
  492. host: 'search.yahoo.com',
  493. functionStart: function() {if (location.pathname.indexOf('/search') > -1) {curSite = DBSite.yahoo;}},
  494. pager: {
  495. type: 1,
  496. nextL: 'css;.pagination a.next',
  497. pageE: 'css;#web ol > li',
  498. insertP: ['css;#web ol', 3],
  499. replaceE: 'css;.pagination',
  500. scrollD: 1500
  501. }
  502. }, // Yahoo 搜索
  503. yahoo_jp: {
  504. host: 'search.yahoo.co.jp',
  505. functionStart: function() {if (location.pathname.indexOf('/search') > -1) {curSite = DBSite.yahoo_jp;}},
  506. pager: {
  507. type: 1,
  508. nextL: 'css;.Pagenation__next > a',
  509. pageE: 'css;.Contents__innerGroupBody > div',
  510. insertP: ['css;.Contents__innerGroupBody', 3],
  511. replaceE: 'css;.Pagenation',
  512. scrollD: 1500
  513. }
  514. }, // Yahoo 搜索 (JP)
  515. qwant: {
  516. host: 'www.qwant.com',
  517. functionStart: function() {locationChange = true; if (location.search.indexOf('q=') > -1 && location.search.indexOf('t=web') > -1) {curSite = DBSite.qwant;}},
  518. pager: {
  519. type: 2,
  520. nextL: 'css;button[data-testid="buttonShowMore"]',
  521. interval: 500,
  522. scrollD: 1500
  523. }
  524. }, // Qwant 搜索
  525. ecosia: {
  526. host: 'www.ecosia.org',
  527. functionStart: function() {if (location.pathname === '/search') {curSite = DBSite.ecosia;}},
  528. pager: {
  529. type: 1,
  530. nextL: 'css;nav.pagination a[aria-label="Next page"]',
  531. pageE: 'css;section.mainline > div:not(.related-queries)',
  532. insertP: ['css;nav.pagination', 1],
  533. replaceE: 'css;nav.pagination',
  534. scrollD: 1500
  535. }
  536. }, // Ecosia 搜索
  537. magi: {
  538. host: 'magi.com',
  539. functionStart: function() {if (location.pathname === '/search') {curSite = DBSite.magi;}},
  540. pager: {
  541. type: 2,
  542. nextL: 'css;.card[data-type="next"]',
  543. nextText: '加载更多',
  544. scrollD: 1500
  545. }
  546. }, // Magi 搜索
  547. baidu_tieba: {
  548. host: 'tieba.baidu.com',
  549. functionStart: function() {if (location.pathname === '/f') {
  550. baidu_tieba_1(); // 右侧悬浮发帖按钮点击事件(解决自动翻页导致无法发帖的问题)
  551. curSite = DBSite.baidu_tieba;
  552. } else if (location.pathname.indexOf('/p/') > -1) {
  553. curSite = DBSite.baidu_tieba_post;
  554. } else if (location.pathname === '/f/search/res') {
  555. curSite = DBSite.baidu_tieba_search;
  556. }},
  557. iframe: true,
  558. insStyle: 'img.j_retract {margin-top: 0 !important;margin-bottom: 0 !important;}', // 修复帖子列表中预览图片,在切换下一个/上一个图片时,多出来的图片上下边距
  559. pager: {
  560. type: 4,
  561. nextL: baidu_tieba_nextL,
  562. pageE: 'css;#thread_list > li',
  563. insertP: ['css;#thread_list', 3],
  564. insertE: baidu_tieba_insertE,
  565. replaceE: 'css;#frs_list_pager',
  566. interval: 2000,
  567. scrollD: 2000
  568. },
  569. function: {
  570. bF: baidu_tieba_bF
  571. }
  572. }, // 百度贴吧 - 帖子列表
  573. baidu_tieba_post: {
  574. insStyle: '.d_sign_split, img.j_user_sign, .d_author .d_pb_icons, .save_face_bg, .save_face_bg_2, li.d_name a.icon_tbworld, .lzl_cnt a.icon_tbworld, .core_reply div.hideLzl[style*="min-height:50px"] {display: none !important;} a.p_author_face.j_frame_guide {background: none repeat scroll 0 0 #FFF !important;border: 1px solid #CCC !important;padding: inherit !important;} .red_text, .red-text, .vip_red, .vip-red, .vip_red:hover, .vip-red:hover, .vip_red:visited, .vip-red:visited {color: #2d64b3 !important;}', // 签名、印记、头像边框、VIP 元素
  575. pager: {
  576. type: 4,
  577. nextL: baidu_tieba_post_nextL,
  578. //nextL: '//li[contains(@class,"pb_list_pager")]/a[contains(text(),"下一页")]',
  579. pageE: 'css;#j_p_postlist > div',
  580. insertP: ['css;#j_p_postlist', 3],
  581. replaceE: 'css;li.pb_list_pager',
  582. scrollD: 1500
  583. },
  584. function: {
  585. bF: src_bF,
  586. pF: [0, 'img[data-tb-lazyload]', 'data-tb-lazyload']
  587. }
  588. }, // 百度贴吧 - 帖子内
  589. baidu_tieba_search: {
  590. pager: {
  591. type: 1,
  592. nextL: 'css;a.next',
  593. pageE: 'css;.s_post_list > div',
  594. insertP: ['css;.s_post_list', 3],
  595. replaceE: 'css;.pager',
  596. scriptT: 1,
  597. scrollD: 1000
  598. }
  599. }, // 百度贴吧 - 搜索页
  600. douban_subject_comments: {
  601. host: 'movie.douban.com',
  602. functionStart: function() {if (location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/comments') > -1) { // 短评列表
  603. curSite = DBSite.douban_subject_comments;
  604. } else if (location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/reviews') > -1) { // 影评列表
  605. curSite = DBSite.douban_subject_reviews;
  606. } else if(location.pathname.indexOf('/subject') > -1 && location.pathname.indexOf('/episode') > -1) { // 电视剧每集评论
  607. curSite = DBSite.douban_subject_episode;
  608. } else if(location.pathname.indexOf('/people') > -1 && location.pathname.indexOf('/collect') > -1) { // 看过的电影
  609. curSite = DBSite.douban_people_collect;
  610. }},
  611. pager: {
  612. type: 1,
  613. nextL: 'css;a.next',
  614. pageE: 'css;#comments > .comment-item',
  615. insertP: ['css;#paginator', 1],
  616. replaceE: 'css;#paginator',
  617. scrollD: 1000
  618. }
  619. }, // 豆瓣 - 短评
  620. douban_subject_reviews: {
  621. pager: {
  622. type: 1,
  623. nextL: 'css;link[rel="next"]',
  624. pageE: 'css;.review-list > div',
  625. insertP: ['css;.review-list', 3],
  626. replaceE: 'css;.paginator',
  627. scrollD: 1000
  628. }
  629. }, // 豆瓣 - 影评
  630. douban_subject_episode: {
  631. pager: {
  632. type: 1,
  633. nextL: 'css;link[rel="next"]',
  634. pageE: 'css;#comments > div',
  635. insertP: ['css;#comments', 3],
  636. replaceE: 'css;.paginator',
  637. scrollD: 1000
  638. }
  639. }, // 豆瓣 - 剧评
  640. douban_people_collect: {
  641. pager: {
  642. type: 1,
  643. nextL: 'css;link[rel="next"]',
  644. pageE: 'css;.grid-view > div',
  645. insertP: ['css;.grid-view', 3],
  646. replaceE: 'css;.paginator',
  647. scrollD: 1000
  648. }
  649. }, // 豆瓣 - 看过的电影
  650. douban_group: {
  651. host: 'www.douban.com',
  652. functionStart: function() {if (location.pathname.indexOf('/group/topic/') > -1) {
  653. curSite = DBSite.douban_group_topic;
  654. } else if (location.pathname.indexOf('/group/explore') > -1) {
  655. curSite = DBSite.douban_group_explore;
  656. } else if (location.pathname.indexOf('/group/') > -1 && location.pathname.indexOf('/discussion') > -1) {
  657. curSite = DBSite.douban_group;
  658. }},
  659. pager: {
  660. type: 1,
  661. nextL: 'css;span.next > a',
  662. pageE: 'css;table.olt > tbody > tr:not(.th)',
  663. insertP: ['css;table.olt > tbody', 3],
  664. replaceE: 'css;.paginator',
  665. scrollD: 1000
  666. }
  667. }, // 豆瓣 - 小组
  668. douban_group_explore: {
  669. pager: {
  670. type: 1,
  671. nextL: 'css;span.next > a',
  672. pageE: 'css;#content .article > div > .channel-item',
  673. insertP: ['css;#content .article > div', 3],
  674. replaceE: 'css;.paginator',
  675. scrollD: 1000
  676. }
  677. }, // 豆瓣 - 小组讨论精选
  678. douban_group_topic: {
  679. pager: {
  680. type: 1,
  681. nextL: 'css;span.next > a',
  682. pageE: 'css;#comments > li',
  683. insertP: ['css;#comments', 3],
  684. replaceE: 'css;.paginator',
  685. scrollD: 1000
  686. }
  687. }, // 豆瓣 - 小组帖子内
  688. weibo_comment: {
  689. host: 'weibo.com',
  690. pager: {
  691. type: 2,
  692. nextL: 'css;a[action-type="click_more_comment"]',
  693. nextText: '查看更多c',
  694. scrollD: 1000
  695. }
  696. }, // 微博评论
  697. tianya: {
  698. host: 'bbs.tianya.cn',
  699. functionStart: function() {if (location.pathname.indexOf('/list') > -1) {
  700. curSite = DBSite.tianya;
  701. } else if (location.pathname.indexOf('/post') > -1) {
  702. curSite = DBSite.tianya_post;
  703. }},
  704. pager: {
  705. type: 1,
  706. nextL: '//div[contains(@class, "pages")]/div[@class="links"]/a[contains(text(), "下一页")]',
  707. pageE: 'css;.tab-bbs-list > tbody:not(:first-of-type)',
  708. insertP: ['css;table.tab-bbs-list', 3],
  709. replaceE: '//div[contains(@class, "pages")]',
  710. scrollD: 1500
  711. }
  712. }, // 天涯社区
  713. tianya_post: {
  714. pager: {
  715. type: 1,
  716. nextL: 'a.js-keyboard-next',
  717. pageE: 'css;.atl-main > div[class="atl-item"]',
  718. insertP: ['css;.atl-main', 3],
  719. replaceE: 'css;.atl-pages > form',
  720. scrollD: 1500
  721. }
  722. }, // 天涯社区 - 帖子内
  723. nga_thread: {
  724. host: ['bbs.nga.cn', 'ngabbs.com', 'nga.178.com', 'g.nga.cn'],
  725. iframe: true,
  726. functionStart: function() {locationChange = true;
  727. if (location.pathname === '/thread.php') { // 帖子列表
  728. curSite = DBSite.nga_thread;
  729. } else if (location.pathname === '/read.php') { // 帖子内
  730. curSite = DBSite.nga_read;
  731. }},
  732. pager: {
  733. type: 1,
  734. nextL: 'css;#pagebbtm a[title="下一页"]',
  735. pageE: 'css;#topicrows > tbody, #topicrows > script',
  736. insertP: ['css;#topicrows', 3],
  737. replaceE: 'css;div[name="pageball"]',
  738. scriptT: 2,
  739. scrollD: 1000
  740. },
  741. function: {
  742. aF: nga_thread_aF
  743. }
  744. }, // NGA - 各版块帖子列表
  745. nga_read: {
  746. pager: {
  747. type: 1,
  748. nextL: 'css;#pagebbtm a[title*="下一页"]',
  749. pageE: 'id("m_posts_c")/table | id("m_posts_c")/script | //script[contains(text(), "commonui.userInfo.setAll")]',
  750. insertP: ['css;#m_posts_c', 3],
  751. replaceE: 'css;div[name="pageball"]',
  752. scriptT: 2,
  753. scrollD: 1000
  754. }
  755. }, // NGA - 帖子内
  756. v2ex_recent: {
  757. host: ['v2ex.com', 'www.v2ex.com'],
  758. functionStart: function() {if (location.pathname === '/') { // 首页
  759. v2ex_aF('#Main a.topic-link:not([target])');
  760. } else if (location.pathname === '/recent') { // 最近主题页
  761. curSite = DBSite.v2ex_recent;
  762. v2ex_aF('#Main a.topic-link:not([target])');
  763. } else if (location.pathname === '/notifications') { // 提醒消息页
  764. curSite = DBSite.v2ex_notifications;
  765. v2ex_aF('#Main a[href^="/t/"]:not([target])');
  766. } else if (location.pathname === '/balance') { // 账户余额页
  767. curSite = DBSite.v2ex_balance;
  768. } else if (location.pathname.indexOf('/go/') > -1) { // 分类主题页
  769. curSite = DBSite.v2ex_go;
  770. v2ex_aF('#Main a.topic-link:not([target])');
  771. } else if (location.pathname.indexOf('/replies') > -1) { // 用户回复页
  772. curSite = DBSite.v2ex_replies;
  773. v2ex_aF('#Main a[href^="/t/"]:not([target])');
  774. }},
  775. pager: {
  776. type: 1,
  777. nextL: '//a[@class="page_current"]/following-sibling::a[1]',
  778. pageE: 'css;.cell.item',
  779. insertP: ['//div[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1],
  780. replaceE: 'css;#Main > .box > .cell[style]:not(.item) > table',
  781. scrollD: 1500
  782. },
  783. function: {
  784. aF: v2ex_aF,
  785. pF: '#Main a.topic-link:not([target])'
  786. }
  787. }, // V2EX - 最近主题页
  788. v2ex_notifications: {
  789. pager: {
  790. type: 1,
  791. nextL: '//a[@class="page_current"]/following-sibling::a[1]',
  792. pageE: 'css;#notifications > div',
  793. insertP: ['css;#notifications', 3],
  794. replaceE: 'css;#Main > .box > .cell[style] > table',
  795. scrollD: 1500
  796. },
  797. function: {
  798. aF: v2ex_aF,
  799. pF: '#Main a[href^="/t/"]:not([target])'
  800. }
  801. }, // V2EX - 提醒消息页
  802. v2ex_replies: {
  803. pager: {
  804. type: 1,
  805. nextL: '//a[@class="page_current"]/following-sibling::a[1]',
  806. pageE: '//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]',
  807. insertP: ['//div[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1],
  808. replaceE: 'css;#Main > .box > .cell[style] > table',
  809. scrollD: 1500
  810. },
  811. function: {
  812. aF: v2ex_aF,
  813. pF: '#Main a[href^="/t/"]:not([target])'
  814. }
  815. }, // V2EX - 用户回复页
  816. v2ex_go: {
  817. pager: {
  818. type: 1,
  819. nextL: '//a[@class="page_current"]/following-sibling::a[1]',
  820. pageE: 'css;#TopicsNode > div',
  821. insertP: ['css;#TopicsNode', 3],
  822. replaceE: 'css;#Main > .box > .cell[style] > table',
  823. scrollD: 1500
  824. },
  825. function: {
  826. aF: v2ex_aF,
  827. pF: '#Main a.topic-link:not([target])'
  828. }
  829. }, // V2EX - 分类主题页
  830. v2ex_balance: {
  831. pager: {
  832. type: 1,
  833. nextL: '//a[@class="page_current"]/following-sibling::a[1]',
  834. pageE: 'css;#Main .box > div:not(.cell) > table > tbody > tr:not(:first-child)',
  835. insertP: ['css;#Main .box > div:not(.cell) > table > tbody', 3],
  836. replaceE: 'css;#Main > .box > .cell[style] > table',
  837. scrollD: 1000
  838. }
  839. }, // V2EX - 账户余额页
  840. jandan: {
  841. host: 'jandan.net',
  842. functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/page/') > -1) {
  843. curSite = DBSite.jandan;
  844. } else if (location.pathname === '/dzh') {
  845. curSite = DBSite.jandan_dzh;
  846. } else {
  847. curSite = DBSite.jandan_comment;
  848. }},
  849. pager: {
  850. type: 1,
  851. nextL: '//div[@class="wp-pagenavi"]/a[contains(text(), "下一页") or contains(text(), "更多文章")]',
  852. pageE: 'css;#content > .list-post',
  853. insertP: ['css;.wp-pagenavi', 1],
  854. replaceE: 'css;.wp-pagenavi, #nav_prev',
  855. scrollD: 1500
  856. },
  857. function: {
  858. bF: src_bF,
  859. pF: [0, 'img[data-original]', 'data-original']
  860. }
  861. }, // 煎蛋网
  862. jandan_comment: {
  863. pager: {
  864. type: 1,
  865. nextL: 'css;a.previous-comment-page',
  866. pageE: 'css;ol.commentlist > li[id^="comment-"], script[src^="//cdn.jandan.net/static/min/"]',
  867. insertP: ['css;ol.commentlist', 3],
  868. replaceE: 'css;.cp-pagenavi, #nav_prev',
  869. scriptT: 3,
  870. scrollD: 1500
  871. }
  872. }, // 煎蛋网
  873. jandan_dzh: {
  874. pager: {
  875. type: 2,
  876. nextL: 'css;.show_more',
  877. interval: 1500,
  878. scrollD: 1500
  879. }
  880. }, // 煎蛋网 - 大杂烩
  881. qiushibaike: {
  882. host: 'www.qiushibaike.com',
  883. functionStart: function() {insStyle('.qrcode-wrap, .qrcode-wrap-img, .index-side-left-AD1 {display: none !important;}');
  884. if (location.pathname === '/') {
  885. curSite = DBSite.qiushibaike;
  886. } else if (location.pathname.indexOf('/article/') === -1) {
  887. curSite = DBSite.qiushibaike_;
  888. }},
  889. pager: {
  890. type: 1,
  891. nextL: '//ul[@class="pagination"]//a[./span[@class="next"]]',
  892. pageE: 'css;.recommend-article > ul > li',
  893. insertP: ['css;.recommend-article > ul', 3],
  894. replaceE: 'css;ul.pagination',
  895. scrollD: 1500
  896. }
  897. }, // 糗事百科
  898. qiushibaike_: {
  899. pager: {
  900. type: 1,
  901. nextL: '//ul[@class="pagination"]//a[./span[@class="next"]]',
  902. pageE: 'css;[id^="qiushi_tag_"]',
  903. insertP: ['css;ul.pagination', 1],
  904. replaceE: 'css;ul.pagination',
  905. scrollD: 1500
  906. }
  907. }, // 糗事百科 - 分类页
  908. lkong: {
  909. host: 'www.lkong.com',
  910. functionStart: function() {if (location.pathname.indexOf('/forum/') > -1) {
  911. curSite = DBSite.lkong;
  912. } else if (location.pathname.indexOf('/thread/') > -1) {
  913. curSite = DBSite.lkong_thread;
  914. }},
  915. pager: {
  916. type: 1,
  917. nextL: lkong_nextL,
  918. pageE: '//div[@class="main-title"]/parent::div/parent::div | //head/style[@data-emotion-css]',
  919. insertP: ['//div[@class="main-title"][1]/parent::div/parent::div/parent::div', 3],
  920. replaceE: 'css;ul.ant-pagination',
  921. interval: 500,
  922. scrollD: 1200
  923. }
  924. }, // 龙的天空 - 各版块帖子列表
  925. lkong_thread: {
  926. pager: {
  927. type: 1,
  928. nextL: lkong_nextL,
  929. pageE: '//div[@class="main-content"]/parent::div | //head/style[@data-emotion-css]',
  930. insertP: ['//div[@class="main-content"][1]/parent::div/parent::div', 3],
  931. replaceE: 'css;ul.ant-pagination',
  932. interval: 500,
  933. scrollD: 1200
  934. }
  935. }, // 龙的天空 - 帖子内
  936. pediy_forum: {
  937. host: 'bbs.pediy.com',
  938. functionStart: function() {if (location.pathname.indexOf('/forum-') > -1) {
  939. curSite = DBSite.pediy_forum;
  940. } else if (location.pathname.indexOf('/thread-') > -1) {
  941. if (GM_getValue('menu_discuz_thread_page')) {curSite = DBSite.pediy_thread;}
  942. }},
  943. pager: {
  944. type: 1,
  945. nextL: '//ul[contains(@class, "pagination")]//a[contains(text(), "▶")]',
  946. pageE: 'css;table.threadlist > tbody > tr',
  947. insertP: ['css;table.threadlist > tbody', 3],
  948. replaceE: 'css;ul.pagination',
  949. scrollD: 1500
  950. }
  951. }, // 看雪论坛 - 各版块帖子列表
  952. pediy_thread: {
  953. pager: {
  954. type: 1,
  955. nextL: '//ul[contains(@class, "pagination")]//a[contains(text(), "▶")]',
  956. pageE: 'css;table.postlist > tbody > tr[data-pid]',
  957. insertP: ['css;table.postlist > tbody > tr:not([data-pid])', 1],
  958. replaceE: 'css;ul.pagination',
  959. scrollD: 1500
  960. }
  961. }, // 看雪论坛 - 帖子内
  962. bangumitv: {
  963. host: 'bangumi.tv',
  964. functionStart: function() {
  965. if (location.pathname.indexOf('/browser') > -1 || location.pathname.indexOf('/subject_search') > -1) {
  966. curSite = DBSite.bangumitv;
  967. } else if (location.pathname.indexOf('/forum') > -1) {
  968. curSite = DBSite.bangumitv_forum;
  969. }},
  970. pager: {
  971. type: 1,
  972. nextL: '//div[@class="page_inner"]/a[contains(text(), "››")]',
  973. pageE: 'css;ul#browserItemList > li',
  974. insertP: ['css;ul#browserItemList', 3],
  975. replaceE: 'css;.page_inner',
  976. scrollD: 1500
  977. }
  978. }, // 番组计划
  979. bangumitv_forum: {
  980. pager: {
  981. type: 1,
  982. nextL: '//div[@class="page_inner"]/a[contains(text(), "››")]',
  983. pageE: 'css;.topic_list > tbody:last-of-type > tr.topic',
  984. insertP: ['css;.topic_list > tbody:last-of-type', 3],
  985. replaceE: 'css;.page_inner',
  986. scrollD: 1500
  987. }
  988. }, // 番组计划 - 小组帖子列表
  989. kdslife: {
  990. host: 'club.kdslife.com',
  991. functionStart: function() {
  992. if (location.pathname.indexOf('/f_') > -1) {
  993. curSite = DBSite.kdslife;
  994. } else if (location.pathname.indexOf('/t_') > -1) {
  995. curSite = DBSite.kdslife_t;
  996. }},
  997. pager: {
  998. type: 1,
  999. nextL: '//div[@class="fr i3_r"]/a[contains(text(), "后一页")]',
  1000. pageE: 'css;ul.main_List > li.i2:not(.h_bg)',
  1001. insertP: ['css;ul.main_List > li.i3', 1],
  1002. replaceE: 'css;ul.main_List > li.i3',
  1003. scrollD: 1000
  1004. }
  1005. }, // 宽带山论坛
  1006. kdslife_t: {
  1007. pager: {
  1008. type: 1,
  1009. nextL: '//div[@class="pages"]/a[contains(text(), ">>")]',
  1010. pageE: 'css;#reply_list_panel > *, script[src*="ui/js/kds.js"]',
  1011. insertP: ['css;#reply_list_panel', 3],
  1012. replaceE: 'css;.pages',
  1013. scriptT: 3,
  1014. scrollD: 1000
  1015. }
  1016. }, // 宽带山论坛 - 帖子内
  1017. libaclub: {
  1018. host: 'www.libaclub.com',
  1019. functionStart: function() {
  1020. if (location.pathname === '/' || location.pathname.indexOf('/date_') > -1) {
  1021. curSite = DBSite.libaclub;
  1022. } else if (location.pathname.indexOf('/f_') > -1) {
  1023. curSite = DBSite.libaclub_f;
  1024. } else if (location.pathname.indexOf('/t_') > -1 || location.pathname.indexOf('/reply_') > -1) {
  1025. curSite = DBSite.libaclub_t;
  1026. } else if (location.pathname.indexOf('/prt_') > -1) {
  1027. curSite = DBSite.libaclub_prt;
  1028. } else if (location.pathname === '/facade.php') {
  1029. curSite = DBSite.libaclub_search;
  1030. }},
  1031. insStyle: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1032. pager: {
  1033. type: 1,
  1034. nextL: '//div[@class="ui-crumbs-more"]/a[@class="fn-link"][1]',
  1035. pageE: 'css;ul.ui-list > li:not(.ui-list-item-head):not(.ui-list-merchant-ad)',
  1036. insertP: ['css;ul.ui-list', 3],
  1037. replaceE: 'css;div.ui-crumbs-more',
  1038. scrollD: 1200
  1039. }
  1040. }, // 篱笆网论坛
  1041. libaclub_f: {
  1042. insStyle: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1043. pager: {
  1044. type: 1,
  1045. nextL: 'css;a.ui-paging-next',
  1046. pageE: 'css;ul.ui-list > li:not(.ui-list-item-head):not(.ui-list-merchant-ad)',
  1047. insertP: ['css;ul.ui-list', 3],
  1048. replaceE: 'css;div.ui-paging',
  1049. scrollD: 1200
  1050. }
  1051. }, // 篱笆网论坛 - 各版块帖子列表
  1052. libaclub_t: {
  1053. insStyle: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1054. pager: {
  1055. type: 1,
  1056. nextL: 'css;a.ui-paging-next',
  1057. pageE: 'css;.ui-box-content > div.ui-topic, .ui-box-content > a[name]',
  1058. insertP: ['css;.ui-box-content', 3],
  1059. replaceE: 'css;div.ui-paging',
  1060. scrollD: 1500
  1061. }
  1062. }, // 篱笆网论坛 - 帖子内
  1063. libaclub_prt: {
  1064. insStyle: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1065. pager: {
  1066. type: 1,
  1067. nextL: 'css;a.ui-paging-next',
  1068. pageE: 'css;ul.ui-list > li',
  1069. insertP: ['css;ul.ui-list', 3],
  1070. replaceE: 'css;div.ui-paging',
  1071. scrollD: 2000
  1072. }
  1073. }, // 篱笆网论坛 - 帖子内 - 打印版
  1074. libaclub_search: {
  1075. insStyle: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1076. pager: {
  1077. type: 1,
  1078. nextL: '//div[@class="ui-page"]/a[contains(text(), "下一页")]',
  1079. pageE: 'css;.ui-box-main > ul.ui-list > li',
  1080. insertP: ['css;.ui-box-main > ul.ui-list', 3],
  1081. replaceE: 'css;div.ui-page',
  1082. scrollD: 1200
  1083. }
  1084. }, // 篱笆网论坛 - 搜索页
  1085. lowendtalk: {
  1086. host: 'lowendtalk.com',
  1087. pager: {
  1088. type: 1,
  1089. nextL: 'css;a.Next',
  1090. pageE: 'css;ul.DataList > li',
  1091. insertP: ['css;ul.DataList', 3],
  1092. replaceE: 'css;.Pager',
  1093. scrollD: 1500
  1094. }
  1095. }, // LowEndTalk
  1096. lieyou: {
  1097. host: 'bbs.lieyou888.com',
  1098. functionStart: function() {if (location.pathname.indexOf('/forum') > -1) {curSite = DBSite.lieyou;}},
  1099. pager: {
  1100. type: 1,
  1101. nextL: '//div[contains(@class, "_pageNav")]/a[contains(text(), "下一页")]',
  1102. pageE: 'css;ul.gb-bbs-list > li',
  1103. insertP: ['css;ul.gb-bbs-list', 3],
  1104. replaceE: 'css;._pageNav',
  1105. scrollD: 1000
  1106. },
  1107. function: {
  1108. bF: src_bF,
  1109. pF: [0, 'img[original]', 'original']
  1110. }
  1111. }, // 芥子空间论坛
  1112. xcar_forumdisplay: {
  1113. host: 'www.xcar.com.cn',
  1114. functionStart: function() {if (location.pathname === '/bbs/forumdisplay.php') {curSite = DBSite.xcar_forumdisplay}},
  1115. pager: {
  1116. type: 1,
  1117. nextL: 'css;a.page_down',
  1118. pageE: 'css;.table-section > dl:not(.table_head)',
  1119. insertP: ['css;.table-section', 3],
  1120. replaceE: 'css;.forumList_page',
  1121. scrollD: 2000
  1122. }
  1123. }, // 爱卡汽车网论坛 - 各版块帖子列表
  1124. flyert_forumdisplay: {
  1125. host: 'www.flyert.com',
  1126. functionStart: function() {if (location.pathname.indexOf('/forum-') > -1 || location.search.indexOf('mod=forumdisplay') > -1) {
  1127. curSite = DBSite.flyert_forumdisplay;
  1128. } else if (location.pathname.indexOf('/forum') > -1 || location.search.indexOf('mod=viewthread') > -1) {
  1129. if (GM_getValue('menu_discuz_thread_page')) {curSite = DBSite.flyert_viewthread;}
  1130. }},
  1131. pager: {
  1132. type: 1,
  1133. nextL: 'css;a.nxt:not([href*="javascript"])',
  1134. pageE: 'css;#threadlist table > tbody[id^="normalthread_"]',
  1135. insertP: ['id("threadlist")//table/tbody[starts-with(@id, "normalthread_")]/parent::table', 3],
  1136. replaceE: 'css;.pg',
  1137. scrollD: 2500
  1138. }
  1139. }, // 飞客网论坛 - 各版块帖子列表
  1140. flyert_viewthread: {
  1141. pager: {
  1142. type: 1,
  1143. nextL: 'css;a.nxt:not([href*="javascript"])',
  1144. pageE: 'css;#postlist > .comiis_viewbox',
  1145. insertP: ['css;#postlist', 3],
  1146. replaceE: 'css;.comiis_pgs > .pg',
  1147. scrollD: 3000
  1148. }
  1149. }, // 飞客网论坛 - 帖子内
  1150. adnmb3: {
  1151. host: ['adnmb3.com', 'www.tnmb.org'],
  1152. functionStart: function() {
  1153. if (location.pathname.indexOf('/m/f/') > -1) {
  1154. curSite = DBSite.adnmb3_mf;
  1155. } else if (location.pathname.indexOf('/m/t/') > -1) {
  1156. curSite = DBSite.adnmb3_mt;
  1157. } else if (location.pathname.indexOf('/f/') > -1 || location.pathname.indexOf('/Forum/') > -1) {
  1158. curSite = DBSite.adnmb3;
  1159. } else if (location.pathname.indexOf('/t/') > -1) {
  1160. curSite = DBSite.adnmb3_t;
  1161. }},
  1162. pager: {
  1163. type: 1,
  1164. nextL: '//ul[contains(@class, "pagination")]//a[contains(text(), "下一页")]',
  1165. pageE: 'css;.h-threads-list > *, script[src$="/h.desktop.js"]',
  1166. insertP: ['css;.h-threads-list', 3],
  1167. replaceE: '//ul[contains(@class, "pagination")]',
  1168. scriptT: 3,
  1169. scrollD: 2000
  1170. }
  1171. }, // A 岛
  1172. adnmb3_t: {
  1173. pager: {
  1174. type: 1,
  1175. nextL: '//ul[contains(@class, "pagination")]//a[contains(text(), "下一页")]',
  1176. pageE: 'css;.h-threads-list > .h-threads-item > .h-threads-item-replys, script[src$="/h.desktop.js"]',
  1177. insertP: ['css;.h-threads-list > .h-threads-item', 3],
  1178. replaceE: '//ul[contains(@class, "pagination")]',
  1179. scriptT: 3,
  1180. scrollD: 2000
  1181. }
  1182. }, // A 岛 - 帖子内
  1183. adnmb3_mf: {
  1184. pager: {
  1185. type: 1,
  1186. nextL: '//li[contains(@class, "pagination-next")]//a[contains(text(), "下一页")]',
  1187. pageE: '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"]',
  1188. insertP: ['css;#h-threads-pagination', 1],
  1189. replaceE: 'css;#h-threads-pagination',
  1190. scriptT: 3,
  1191. scrollD: 2000
  1192. }
  1193. }, // A 岛 - 帖子列表(手机版)
  1194. adnmb3_mt: {
  1195. pager: {
  1196. type: 1,
  1197. nextL: '//li[contains(@class, "pagination-next")]//a[contains(text(), "下一页")]',
  1198. pageE: 'css;.h-threads-replylist > div, script[src$="/h.mobile.js"]',
  1199. insertP: ['css;.h-threads-replylist', 3],
  1200. replaceE: 'css;#h-threads-pagination',
  1201. scriptT: 3,
  1202. scrollD: 2000
  1203. }
  1204. }, // A 岛 - 帖子内(手机版)
  1205. guokr: {
  1206. host: 'www.guokr.com',
  1207. pager: {
  1208. type: 2,
  1209. nextL: 'css;div[class*="LoadMoreWrap"]',
  1210. interval: 1500,
  1211. scrollD: 1500
  1212. }
  1213. }, // 果壳网
  1214. expreview: {
  1215. host: 'www.expreview.com',
  1216. pager: {
  1217. type: 2,
  1218. nextL: 'css;#show_article_red_1SHOW',
  1219. interval: 1500,
  1220. scrollD: 1500
  1221. }
  1222. }, // 超能网
  1223. landian: {
  1224. host: 'www.landian.vip',
  1225. pager: {
  1226. type: 2,
  1227. nextL: 'css;.load-more > button',
  1228. nextText: '加载更多',
  1229. scrollD: 1300
  1230. }
  1231. }, // 蓝点网
  1232. ithome: {
  1233. host: 'www.ithome.com',
  1234. pager: {
  1235. type: 2,
  1236. nextL: 'css;a.more',
  1237. interval: 1500,
  1238. scrollD: 1500
  1239. }
  1240. }, // IT 之家
  1241. _58pic: {
  1242. host: 'www.58pic.com',
  1243. functionStart: function() {insStyle('.qt-model-t, .qtw-card.place-box.is-one, .search-v3-row .search-v3-back {display: none !important;}'); // 隐藏登录弹窗
  1244. if (location.pathname.indexOf('/tupian/') > -1) {
  1245. curSite = DBSite._58pic;
  1246. } else if (location.pathname.indexOf('/c/') > -1) {
  1247. curSite = DBSite._58pic_c;
  1248. }},
  1249. insStyle: '.qtw-card.place-box.is-two {display: none !important;}', // 隐藏登录弹窗、隐藏末尾很大的 [下一页] 按钮
  1250. pager: {
  1251. type: 1,
  1252. nextL: '//div[contains(@class,"page-box")]//a[text()="下一页"]',
  1253. pageE: 'css;.pic-box > .qtw-card',
  1254. insertP: ['css;.pic-box', 3],
  1255. replaceE: 'css;.page-box',
  1256. scrollD: 2500
  1257. },
  1258. function: {
  1259. bF: src_bF,
  1260. pF: [0, 'img[data-original]', 'data-original']
  1261. }
  1262. }, // 千图网 - 分类/搜索页
  1263. _58pic_c: {
  1264. pager: {
  1265. type: 1,
  1266. nextL: '//div[contains(@class,"page-box")]//a[text()="下一页"]',
  1267. pageE: 'css;.list-box > .qtw-card',
  1268. insertP: ['css;.list-box', 3],
  1269. replaceE: 'css;.page-box',
  1270. scrollD: 4000
  1271. },
  1272. function: {
  1273. bF: src_bF,
  1274. pF: [0, 'img[data-original]', 'data-original']
  1275. }
  1276. }, // 千图网 - 专题/收藏夹
  1277. pixabay: {
  1278. host: 'pixabay.com',
  1279. pager: {
  1280. type: 1,
  1281. nextL: '//a[text()="›"]',
  1282. pageE: 'css;[class^="results"] > [class^="container"] > div',
  1283. insertP: ['css;[class^="results"] > [class^="container"]', 3],
  1284. replaceE: '//a[text()="›"]',
  1285. scrollD: 2000
  1286. },
  1287. function: {
  1288. bF: src_bF,
  1289. pF: [0, 'img[data-lazy-src]', 'data-lazy-src']
  1290. }
  1291. }, // Pixabay
  1292. logosc: {
  1293. host: 'www.logosc.cn',
  1294. functionStart: function() {if (location.pathname.indexOf('/so/') > -1) {curSite = DBSite.logosc;}},
  1295. pager: {
  1296. type: 2,
  1297. nextL: 'css;button.so-pablo-button',
  1298. interval: 1500,
  1299. scrollD: 1500
  1300. }
  1301. }, // 搜图神器 (免费无版权)
  1302. puxiang: {
  1303. host: 'www.puxiang.com',
  1304. functionStart: function() {if (location.pathname === '/search/favorite') {
  1305. curSite = DBSite.puxiang_collect;
  1306. } else if (location.pathname === '/search/puxiang' || location.pathname === '/list' || location.pathname === '/galleries' || location.pathname === '/articles') {
  1307. curSite = DBSite.puxiang;
  1308. } else if (location.pathname === '/') {
  1309. curSite = DBSite.puxiang; curSite.pager.scrollD = 4000;
  1310. }},
  1311. pager: {
  1312. type: 1,
  1313. nextL: 'css;li.next > a',
  1314. pageE: 'css;.work-list > div',
  1315. insertP: ['css;.work-list', 3],
  1316. replaceE: 'css;.pagerbar',
  1317. scrollD: 1500
  1318. }
  1319. }, // 普象网 - 作品集/搜索页
  1320. puxiang_collect: {
  1321. pager: {
  1322. type: 1,
  1323. nextL: 'css;li.next > a',
  1324. pageE: 'css;.collect-list > div',
  1325. insertP: ['css;.collect-list', 3],
  1326. replaceE: 'css;.pagerbar',
  1327. scrollD: 1500
  1328. }
  1329. }, // 普象网 - 收藏夹
  1330. om: {
  1331. host: 'www.om.cn',
  1332. functionStart: function() {if (location.pathname != '/') {curSite = DBSite.om;}},
  1333. pager: {
  1334. type: 1,
  1335. nextL: 'css;li.next > a',
  1336. pageE: 'css;.main_content > ul > li',
  1337. insertP: ['css;.main_content > ul', 3],
  1338. replaceE: 'css;ul.pagination',
  1339. scrollD: 1500
  1340. }
  1341. }, // 欧模网
  1342. xiadele: {
  1343. host: ['www.xiadele.com', 'search.xiadele.com'],
  1344. functionStart: function() {if (location.pathname != '/') {curSite = DBSite.xiadele;}},
  1345. insStyle: '.last-li-carousel-img {display: none !important;}',
  1346. pager: {
  1347. type: 1,
  1348. nextL: 'css;li.next_page a[rel="next"]',
  1349. pageE: 'css;ul.list-page-ul > li',
  1350. insertP: ['css;ul.list-page-ul', 3],
  1351. replaceE: 'css;ul.pagination',
  1352. scrollD: 2000
  1353. }
  1354. }, // 下得乐
  1355. _3dmgame: {
  1356. host: 'www.3dmgame.com',
  1357. functionStart: function() {
  1358. if (getCSS('.ztliswrap > div.lis')) {
  1359. curSite = DBSite._3dmgame_list;
  1360. } else if (getCSS('.newsleft > ul')) {
  1361. curSite = DBSite._3dmgame_list2;
  1362. } else if (location.pathname.indexOf('/resource') > -1) {
  1363. curSite = DBSite._3dmgame_list3;
  1364. } else {
  1365. curSite = DBSite._3dmgame;
  1366. }},
  1367. pager: {
  1368. type: 3,
  1369. nextL: 'css;li.next > a',
  1370. pageE: 'css;script[src*="common.js"], .news_warp_center > *',
  1371. insertP: ['css;.news_warp_center', 3],
  1372. replaceE: 'css;.pagewrap',
  1373. scrollE: 'css;.pagewrap',
  1374. scriptT: 3,
  1375. scrollD: 600
  1376. }
  1377. }, // 3DM
  1378. _3dmgame_list: {
  1379. pager: {
  1380. type: 1,
  1381. nextL: 'css;li.next > a',
  1382. pageE: 'css;.ztliswrap > div.lis',
  1383. insertP: ['css;.pagewrap', 1],
  1384. replaceE: 'css;.pagewrap',
  1385. scrollD: 1000
  1386. },
  1387. function: {
  1388. bF: src_bF,
  1389. pF: [0, 'img[data-original]', 'data-original']
  1390. }
  1391. }, // 3DM - 分类页
  1392. _3dmgame_list2: {
  1393. pager: {
  1394. type: 1,
  1395. nextL: 'css;li.next > a',
  1396. pageE: 'css;.newsleft > ul > li',
  1397. insertP: ['css;.newsleft > ul', 3],
  1398. replaceE: 'css;.pagewrap',
  1399. scrollD: 1000
  1400. },
  1401. function: {
  1402. bF: src_bF,
  1403. pF: [0, 'img[data-original]', 'data-original']
  1404. }
  1405. }, // 3DM - 游戏专区 - 分类页
  1406. _3dmgame_list3: {
  1407. pager: {
  1408. type: 1,
  1409. nextL: 'css;li.next > a',
  1410. pageE: 'css;.item > ul',
  1411. insertP: ['css;.item > ul:last-child', 1],
  1412. replaceE: 'css;.pagewrap',
  1413. scrollD: 800
  1414. }
  1415. }, // 3DM - 游戏专区 - 资源页
  1416. _3dmgame_mod: {
  1417. host: 'mod.3dmgame.com',
  1418. pager: {
  1419. type: 1,
  1420. nextL: _3dmgame_mod_nextL,
  1421. pageE: '//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")]',
  1422. insertP: ['//div[contains(@class, "game-mod-wrap") or contains(@class, "search-mod ")]', 3],
  1423. scriptT: 2,
  1424. history: true,
  1425. scrollD: 1200
  1426. }
  1427. }, // 3DM MOD站
  1428. ali213_www: {
  1429. host: 'www.ali213.net',
  1430. pager: {
  1431. type: 3,
  1432. nextL: 'css;#after_this_page',
  1433. pageE: 'css;#Content >*:not(.news_ding):not(.page_fenye)',
  1434. insertP: ['css;.page_fenye', 1],
  1435. replaceE: 'css;.page_fenye',
  1436. scrollE: 'css;.page_fenye',
  1437. scrollD: 600
  1438. }
  1439. }, // 游侠网
  1440. ali213_list: {
  1441. host: 'down.ali213.net',
  1442. functionStart: function() {if (getCSS('.famous-ul > .famous-li')) {curSite = DBSite.ali213_list;}},
  1443. pager: {
  1444. type: 1,
  1445. nextL: 'css;a.page-next',
  1446. pageE: 'css;.famous-ul > .famous-li',
  1447. insertP: ['css;.famous-ul', 3],
  1448. replaceE: 'css;.page-container',
  1449. scrollD: 1000
  1450. },
  1451. function: {
  1452. bF: src_bF,
  1453. pF: [0, 'img[data-original]', 'data-original']
  1454. }
  1455. }, // 游侠网 - 分类页
  1456. ali213_gl: {
  1457. host: 'gl.ali213.net',
  1458. insStyle: '.n_show_b {display: none !important;}',
  1459. pager: {
  1460. type: 3,
  1461. nextL: 'css;a.next',
  1462. pageE: 'css;.c-detail >*',
  1463. insertP: ['css;.c-detail', 3],
  1464. replaceE: 'css;.page_fenye',
  1465. scrollE: 'css;.page_fenye',
  1466. scrollD: 400
  1467. }
  1468. }, // 游侠网 - 攻略
  1469. ali213_pic: {
  1470. host: 'pic.ali213.net',
  1471. insStyle: 'a.prev, a.next {display: none !important;}',
  1472. pager: {
  1473. type: 1,
  1474. nextL: 'css;a.next',
  1475. pageE: 'css;#image-show > img',
  1476. insertP: ['css;#image-show', 3],
  1477. replaceE: 'css;#image-show > a',
  1478. scrollD: 1200
  1479. }
  1480. }, // 游侠网 - 图库
  1481. gamersky_ent: {
  1482. host: 'www.gamersky.com',
  1483. functionStart: function() {if (location.pathname.indexOf('/ent/') > -1) {curSite = DBSite.gamersky_ent;} else {curSite = DBSite.gamersky_gl;}},
  1484. pager: {
  1485. type: 3,
  1486. nextL: '//div[@class="page_css"]/a[text()="下一页"]',
  1487. pageE: 'css;.Mid2L_con > *:not(.gs_nc_editor):not(.pagecss):not(.page_css):not(.gs_ccs_solve):not(.post_ding)',
  1488. insertP: ['css;.page_css', 1],
  1489. replaceE: 'css;.page_css',
  1490. scrollE: 'css;.page_css',
  1491. scrollD: 100
  1492. }
  1493. }, // 游民星空
  1494. gamersky_gl: {
  1495. pager: {
  1496. type: 3,
  1497. nextL: '//div[@class="page_css"]/a[text()="下一页"]',
  1498. forceHTTPS: true,
  1499. pageE: 'css;.Mid2L_con > *:not(.gs_nc_editor):not(.pagecss):not(.gs_ccs_solve):not(.post_ding)',
  1500. insertP: ['css;.gs_nc_editor', 1],
  1501. replaceE: 'css;.page_css',
  1502. scrollE: 'css;.page_css',
  1503. scrollD: 100
  1504. },
  1505. function: {
  1506. bF: gamersky_gl_bF
  1507. }
  1508. }, // 游民星空 - 攻略
  1509. nexusmods: {
  1510. host: 'www.nexusmods.com',
  1511. pager: {
  1512. type: 4,
  1513. nextL: nexusmods_nextL,
  1514. pageE: 'css;ul.tiles > li',
  1515. insertP: ['css;ul.tiles', 3],
  1516. insertE: nexusmods_insertE,
  1517. replaceE: 'css;.pagination',
  1518. scrollD: 3000
  1519. }
  1520. }, // NexusMods
  1521. steamcommunity: {
  1522. host: 'steamcommunity.com',
  1523. functionStart: function() {if (location.pathname.indexOf('/workshop/browse') > -1) {curSite = DBSite.steamcommunity;}},
  1524. pager: {
  1525. type: 1,
  1526. nextL: '//a[@class="pagebtn"][last()]',
  1527. pageE: 'css;.workshopBrowseItems > *',
  1528. insertP: ['css;.workshopBrowseItems', 3],
  1529. replaceE: 'css;.workshopBrowsePaging',
  1530. scriptT: 2,
  1531. scrollD: 1500
  1532. }
  1533. }, // 创意工坊 - 项目列表
  1534. yikm: {
  1535. host: 'www.yikm.net',
  1536. pager: {
  1537. type: 1,
  1538. nextL: '//ul[@class="pager"]//a[text()="下一页"]',
  1539. pageE: '//h2[contains(text(), "所有游戏") or contains(text(), "搜索结果")]/following-sibling::div[1]/div',
  1540. insertP: ['//h2[contains(text(), "所有游戏") or contains(text(), "搜索结果")]/following-sibling::div[1]', 3],
  1541. replaceE: 'css;ul.pager',
  1542. scrollD: 1500
  1543. }
  1544. }, // 小霸王其乐无穷
  1545. cs_rin_ru: {
  1546. host: 'cs.rin.ru',
  1547. functionStart: function() {if (location.pathname === '/forum/viewforum.php') { // 版块帖子列表
  1548. curSite = DBSite.cs_rin_ru;
  1549. } else if (location.pathname === '/forum/viewtopic.php') { // 帖子内
  1550. if (GM_getValue('menu_discuz_thread_page')) curSite = DBSite.cs_rin_ru_list;
  1551. } else if (location.pathname === '/forum/search.php') { // 搜索结果
  1552. curSite = DBSite.cs_rin_ru_search;
  1553. }},
  1554. pager: {
  1555. type: 1,
  1556. nextL: '//td[@class="gensmall"][@align="right"]//a[text()="Next"]',
  1557. pageE: 'css;#pagecontent > table.tablebg > tbody > tr:not([align])',
  1558. insertP: ['css;#pagecontent > table.tablebg > tbody > tr[align]', 1],
  1559. replaceE: 'css;#pagecontent > table:first-child',
  1560. scrollD: 1500
  1561. },
  1562. function: {
  1563. bF: cs_rin_ru_bF
  1564. }
  1565. }, // cs.rin.ru - 各版块帖子列表
  1566. cs_rin_ru_list: {
  1567. pager: {
  1568. type: 1,
  1569. nextL: 'id("pageheader")/p[@class="gensmall"]//a[text()="Next"]',
  1570. pageE: 'css;#pagecontent > table.tablebg:not(:nth-last-child(2)):not(:nth-child(2))',
  1571. insertP: ['css;#pagecontent > table.tablebg:nth-last-child(2)', 1],
  1572. replaceE: 'css;#pagecontent >table:not(.tablebg), #pageheader p.gensmall',
  1573. scrollD: 2000
  1574. }
  1575. }, // cs.rin.ru - 帖子内
  1576. cs_rin_ru_search: {
  1577. pager: {
  1578. type: 1,
  1579. nextL: 'id("wrapcentre")/div[@class="nav"]//a[text()="Next"]',
  1580. pageE: 'css;#wrapcentre > form > table.tablebg > tbody > tr[valign]',
  1581. insertP: ['css;#wrapcentre > form > table.tablebg > tbody > tr:last-child', 1],
  1582. replaceE: 'css;#wrapcentre > div',
  1583. scrollD: 1500
  1584. }
  1585. }, // cs.rin.ru - 搜索页
  1586. crackhub: {
  1587. host: 'crackhub.site',
  1588. insStyle: 'html.wp-dark-mode-active .inside-article {background-color: var(--wp-dark-mode-bg);}',
  1589. pager: {
  1590. type: 1,
  1591. nextL: 'css;a.next.page-numbers',
  1592. pageE: 'css;article[id^="post-"]',
  1593. insertP: ['css;nav.paging-navigation', 1],
  1594. replaceE: 'css;nav.paging-navigation',
  1595. scrollD: 2000
  1596. }
  1597. }, // Crackhub213
  1598. fitgirl: {
  1599. host: 'fitgirl-repacks.site',
  1600. pager: {
  1601. type: 1,
  1602. nextL: 'css;a.next.page-numbers',
  1603. pageE: 'css;article[id^="post-"]',
  1604. insertP: ['css;nav.paging-navigation', 1],
  1605. replaceE: 'css;nav.paging-navigation',
  1606. scrollD: 2500
  1607. }
  1608. }, // FitGirl Repacks
  1609. bilibili_search: {
  1610. host: 'search.bilibili.com',
  1611. functionStart: function() {locationChange = true; curSite = DBSite.bilibili_search;},
  1612. pager: {
  1613. type: 1,
  1614. nextL: bilibili_search_nextL,
  1615. pageE: '//ul[contains(@class, "video-list")]/li | //script[contains(text(), "window.__INITIAL_STATE__")]',
  1616. insertP: ['css;ul.video-list', 3],
  1617. replaceE: 'css;ul.pages',
  1618. scriptT: 2,
  1619. history: function() {if (/page=\d+/.test(location.search)) {return false;} else {return true;}},// 解决 locationChange 与 history 冲突的问题,只有返回 true 才会重置规则+页码
  1620. scrollD: 1000
  1621. },
  1622. function: {
  1623. aF: bilibili_search_aF
  1624. }
  1625. }, // B 站(Bilibili) - 搜索页
  1626. pianku: {
  1627. host: /pianku/,
  1628. functionStart: function() {if (location.pathname != '/') {curSite = DBSite.pianku;}},
  1629. pager: {
  1630. type: 1,
  1631. nextL: 'css;a.a1',
  1632. pageE: 'css;.content-list > li',
  1633. insertP: ['css;.content-list', 3],
  1634. replaceE: 'css;.pages',
  1635. scrollD: 1500
  1636. },
  1637. function: {
  1638. bF: src_bF,
  1639. pF: [0, 'img[data-src]', 'data-src']
  1640. }
  1641. }, // 片库
  1642. cupfox: {
  1643. host: 'www.cupfox.com',
  1644. pager: {
  1645. type: 2,
  1646. nextL: 'css;.load-more',
  1647. nextText: '点击加载更多',
  1648. scrollD: 700
  1649. }
  1650. }, // 茶杯狐
  1651. novipnoad: {
  1652. host: 'www.novipnoad.com',
  1653. functionStart: function() {if (location.pathname != '/' && location.pathname.indexOf('.html') === -1) {curSite = DBSite.novipnoad;}},
  1654. pager: {
  1655. type: 1,
  1656. nextL: 'css;a.nextpostslink',
  1657. pageE: 'css;.video-listing-content .row > div',
  1658. insertP: ['css;.video-listing-content .row', 3],
  1659. replaceE: 'css;.wp-pagenavi',
  1660. scrollD: 1500
  1661. },
  1662. function: {
  1663. bF: src_bF,
  1664. pF: [0, 'img[data-original]', 'data-original']
  1665. }
  1666. }, // NO视频
  1667. ddrk: {
  1668. host: ['ddrk.me', 'ddys.tv'],
  1669. functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/category/') > -1 || location.pathname.indexOf('/tag/') > -1) {curSite = DBSite.ddrk;}},
  1670. pager: {
  1671. type: 1,
  1672. nextL: 'css;a.next',
  1673. pageE: 'css;.post-box-list > article',
  1674. insertP: ['css;.post-box-list', 3],
  1675. replaceE: 'css;.pagination_wrap',
  1676. scrollD: 1500
  1677. }
  1678. }, // 低端影视
  1679. nfmovies: {
  1680. host: 'www.nfmovies.com',
  1681. functionStart: function() {if (location.pathname === '/search.php' || location.pathname.indexOf('/list/') > -1) {curSite = DBSite.nfmovies;}},
  1682. pager: {
  1683. type: 1,
  1684. nextL: '//ul[contains(@class, "myui-page")]/li/a[contains(text(), "下一页")]',
  1685. pageE: 'css;ul.myui-vodlist > li',
  1686. insertP: ['css;ul.myui-vodlist', 3],
  1687. replaceE: 'css;ul.myui-page',
  1688. scrollD: 1500
  1689. },
  1690. function: {
  1691. bF: src_bF,
  1692. pF: [1, 'a[data-original]', 'data-original']
  1693. }
  1694. }, // 奈菲影视
  1695. zxzj: {
  1696. host: 'www.zxzj.me',
  1697. functionStart: function() {if (location.pathname != '/' && location.pathname.indexOf('/detail/') === -1) {curSite = DBSite.zxzj;}},
  1698. insStyle: 'div.stui-page__all {display: none !important;}',
  1699. pager: {
  1700. type: 1,
  1701. nextL: '//ul[contains(@class, "stui-page__item")]//a[contains(text(), "下一页")]',
  1702. pageE: 'css;ul.stui-vodlist > li',
  1703. insertP: ['css;ul.stui-vodlist', 3],
  1704. replaceE: 'css;ul.stui-page__item',
  1705. scrollD: 1000
  1706. },
  1707. function: {
  1708. bF: src_bF,
  1709. pF: [1, 'a[data-original]', 'data-original']
  1710. }
  1711. }, // 在线之家
  1712. enlienli: {
  1713. host: 'enlienli.com',
  1714. functionStart: function() {if (location.pathname.indexOf('/show/') > -1 || location.pathname.indexOf('/search') > -1) {curSite = DBSite.enlienli;}},
  1715. pager: {
  1716. type: 1,
  1717. nextL: 'css;a.page-number.page-next',
  1718. pageE: 'css;.module-items > *',
  1719. insertP: ['css;.module-items', 3],
  1720. replaceE: 'css;#page',
  1721. scrollD: 1000
  1722. },
  1723. function: {
  1724. bF: src_bF,
  1725. pF: [0, 'img[data-src]', 'data-src']
  1726. }
  1727. }, // 嗯哩嗯哩
  1728. _91mjw: {
  1729. host: '91mjw.com',
  1730. functionStart: function() {if (location.pathname.indexOf('/video/') === -1 || location.pathname.indexOf('/vplay/') === -1) {curSite = DBSite._91mjw;}},
  1731. pager: {
  1732. type: 1,
  1733. nextL: 'css;.next-page > a',
  1734. pageE: 'css;.m-movies > article',
  1735. insertP: ['css;.pagination', 1],
  1736. replaceE: 'css;.pagination',
  1737. scrollD: 1500
  1738. },
  1739. function: {
  1740. bF: src_bF,
  1741. pF: [0, 'img[data-original]', 'data-original']
  1742. }
  1743. }, // 91 美剧网
  1744. zhenbuka: {
  1745. host: ['www.zhenbuka3.com', 'www.zhenbuka5.com'],
  1746. functionStart: function() {if (location.pathname.indexOf('/vodtype/') > -1) {curSite = DBSite.zhenbuka;}},
  1747. pager: {
  1748. type: 1,
  1749. nextL: '//ul[contains(@class, "stui-page")]/li/a[contains(text(), "下一页")]',
  1750. pageE: 'css;ul.stui-vodlist > li',
  1751. insertP: ['css;ul.stui-vodlist', 3],
  1752. replaceE: 'css;ul.stui-page',
  1753. scrollD: 1500
  1754. },
  1755. function: {
  1756. bF: src_bF,
  1757. pF: [1, 'a[data-original]', 'data-original']
  1758. }
  1759. }, // 真不卡影院
  1760. zzzfun: {
  1761. host: 'www.zzzfun.com',
  1762. functionStart: function() {
  1763. if (location.pathname.indexOf('/vod_type') > -1 || location.pathname.indexOf('/vod_show') > -1) {
  1764. curSite = DBSite.zzzfun;
  1765. } else if (location.pathname.indexOf('/vod_search') > -1) {
  1766. curSite = DBSite.zzzfun_search;
  1767. }},
  1768. pager: {
  1769. type: 1,
  1770. nextL: 'css;#page a[title="下一页"]',
  1771. pageE: 'css;ul.search-result > a',
  1772. insertP: ['css;ul.search-result', 3],
  1773. replaceE: 'css;#page',
  1774. scrollD: 1000
  1775. },
  1776. function: {
  1777. bF: src_bF,
  1778. pF: [0, 'img[data-original]', 'data-original']
  1779. }
  1780. }, // ZzzFun 动漫
  1781. zzzfun_search: {
  1782. pager: {
  1783. type: 1,
  1784. nextL: 'css;#page a[title="下一页"]',
  1785. pageE: 'css;ul.show-list > li',
  1786. insertP: ['css;ul.show-list', 3],
  1787. replaceE: 'css;#page',
  1788. scrollD: 1000
  1789. },
  1790. function: {
  1791. bF: src_bF,
  1792. pF: [0, 'img[data-original]', 'data-original']
  1793. }
  1794. }, // ZzzFun 动漫 - 搜索页
  1795. tucao: {
  1796. host: 'www.tucao.one',
  1797. functionStart: function() {if (location.pathname.indexOf('/list/') > -1) {
  1798. curSite = DBSite.tucao;
  1799. } else if (location.search.indexOf('search') > -1) {
  1800. curSite = DBSite.tucao_search;
  1801. }},
  1802. pager: {
  1803. type: 1,
  1804. nextL: 'css;.pagego a',
  1805. pageE: 'css;.list > ul > li',
  1806. insertP: ['css;.list > ul', 3],
  1807. replaceE: 'css;.newpages, .pagego, #float_show',
  1808. scrollD: 1000
  1809. }
  1810. }, // 吐槽弹幕网
  1811. tucao_search: {
  1812. pager: {
  1813. type: 1,
  1814. nextL: '//a[@class="a1"][contains(text(), "下一页")]',
  1815. pageE: 'css;.search_list > *',
  1816. insertP: ['css;.search_list', 3],
  1817. replaceE: 'css;.pages',
  1818. scrollD: 1000
  1819. }
  1820. }, // 吐槽弹幕网 - 搜索页
  1821. mandao: {
  1822. host: 'www.mandao.tv',
  1823. functionStart: function() {if (location.pathname != '/' && location.pathname.indexOf('/man') === -1) {
  1824. curSite = DBSite.mandao;
  1825. }},
  1826. pager: {
  1827. type: 1,
  1828. nextL: '//div[contains(@class, "page")]/a[contains(text(), ">")]',
  1829. pageE: 'css;.index-tj > ul > li',
  1830. insertP: ['css;.index-tj > ul', 3],
  1831. replaceE: 'css;.page',
  1832. scrollD: 1000
  1833. },
  1834. function: {
  1835. bF: src_bF,
  1836. pF: [0, 'img[data-original]', 'data-original']
  1837. }
  1838. }, // 漫岛动漫
  1839. yxdm: {
  1840. host: 'www.yxdm.li',
  1841. functionStart: function() {if (location.pathname.indexOf('/search') > -1 || location.pathname.indexOf('/category') > -1) {curSite = DBSite.yxdm;}},
  1842. pager: {
  1843. type: 1,
  1844. nextL: '//a[@class="nextPage" or contains(text(), "下一页")]',
  1845. pageE: 'css;.dhnew > ul > li',
  1846. insertP: ['css;.dhnew > ul', 3],
  1847. replaceE: 'css;.pagelist',
  1848. scrollD: 2000
  1849. }
  1850. }, // 怡萱动漫
  1851. nicotv: {
  1852. host: 'www.nicotv.me',
  1853. functionStart: function() {if (location.pathname.indexOf('/search') > -1 || location.pathname.indexOf('/type') > -1) {curSite = DBSite.nicotv;}},
  1854. pager: {
  1855. type: 1,
  1856. nextL: '//ul[contains(@class, "pagination ")]//a[contains(text(), "»")]',
  1857. pageE: 'css;ul.list-unstyled > li',
  1858. insertP: ['css;ul.list-unstyled', 3],
  1859. replaceE: 'css;ul.pagination ',
  1860. scrollD: 1000
  1861. },
  1862. function: {
  1863. bF: src_bF,
  1864. pF: [0, 'img[data-original]', 'data-original']
  1865. }
  1866. }, // 妮可动漫
  1867. yhdm: {
  1868. host: 'www.imomoe.la',
  1869. functionStart: function() {if (location.pathname.indexOf('/list/') > -1) {
  1870. curSite = DBSite.yhdm;
  1871. } else if (location.pathname === '/so.asp' || location.pathname === '/search.asp') {
  1872. curSite = DBSite.yhdm_;
  1873. }},
  1874. pager: {
  1875. type: 1,
  1876. nextL: '//div[@class="pages"]/a[contains(text(), "下一页")]',
  1877. pageE: 'css;#contrainer > .img> ul > li',
  1878. insertP: ['css;#contrainer > .img> ul', 3],
  1879. replaceE: 'css;.pages',
  1880. scrollD: 1000
  1881. }
  1882. }, // 樱花动漫
  1883. yhdm_: {
  1884. pager: {
  1885. type: 1,
  1886. nextL: '//div[@class="pages"]/a[contains(text(), "下一页")]',
  1887. pageE: 'css;#contrainer .fire .pics > ul > li',
  1888. insertP: ['css;#contrainer .fire .pics > ul', 3],
  1889. replaceE: 'css;.pages',
  1890. scrollD: 1000
  1891. }
  1892. }, // 樱花动漫 - 搜索页等
  1893. agefans: {
  1894. host: 'www.agefans.cc',
  1895. functionStart: function() {if (location.pathname.indexOf('/catalog/') > -1 || location.pathname === '/search') {
  1896. curSite = DBSite.agefans;
  1897. } else if (location.pathname === '/recommend' || location.pathname === '/update') {
  1898. curSite = DBSite.agefans_;
  1899. } else if (location.pathname === '/rank') {
  1900. curSite = DBSite.agefans_rank;
  1901. }},
  1902. pager: {
  1903. type: 1,
  1904. nextL: 'id("container")//div[@class="blockcontent"]/div[@style][not(@class)]/li/a[contains(text(), "下一页")]',
  1905. pageE: 'css;#container .blockcontent1 > div',
  1906. insertP: ['css;#container .blockcontent1', 3],
  1907. replaceE: 'css;#container .blockcontent > div[style]:not([class])',
  1908. scrollD: 1000
  1909. }
  1910. }, // AGE 动漫 - 全部/搜索
  1911. agefans_: {
  1912. pager: {
  1913. type: 1,
  1914. nextL: 'id("container")//div[@class="blockcontent"]/div[@style][not(@class)]/li/a[contains(text(), "下一页")]',
  1915. pageE: 'css;#container .blockcontent > ul > li',
  1916. insertP: ['css;#container .blockcontent > ul', 3],
  1917. replaceE: 'css;#container .blockcontent > div[style]:not([class])',
  1918. scrollD: 1000
  1919. }
  1920. }, // AGE 动漫 - 其他页
  1921. agefans_rank: {
  1922. pager: {
  1923. type: 1,
  1924. nextL: 'id("container")/ul[@style][not(@class)]/li/a[contains(text(), "下一页")]',
  1925. pageE: 'css;#container > .div_right .blockcontent.div_right_r_3 > ul',
  1926. insertP: ['css;#container > .div_right .blockcontent.div_right_r_3', 3],
  1927. replaceE: 'css;#container > ul[style]:not([class])',
  1928. scrollD: 1000
  1929. }
  1930. }, // AGE 动漫 - 排行榜
  1931. dm233: {
  1932. host: 'www.dm233.cc',
  1933. functionStart: function() {if (location.pathname.indexOf('/catalog/') > -1 || location.pathname === '/recommend/' || location.pathname === '/search') {
  1934. curSite = DBSite.dm233;
  1935. } else if (location.pathname === '/article/') {
  1936. curSite = DBSite.dm233_article;
  1937. } else if (location.pathname === '/rank/') {
  1938. curSite = DBSite.dm233_rank;
  1939. }},
  1940. pager: {
  1941. type: 1,
  1942. nextL: '//div[@class="pagelist"]//a[contains(text(), "下一页") or contains(text(), "下一頁")]',
  1943. pageE: 'css;.dhnew ul > li',
  1944. insertP: ['css;.dhnew ul', 3],
  1945. replaceE: 'css;.pagelist',
  1946. scrollD: 1000
  1947. }
  1948. }, // 233 动漫
  1949. dm233_article: {
  1950. pager: {
  1951. type: 1,
  1952. nextL: '//div[@class="pagelist"]//a[contains(text(), "下一页") or contains(text(), "下一頁")]',
  1953. pageE: 'css;.xgyd ul > li',
  1954. insertP: ['css;.xgyd ul', 3],
  1955. replaceE: 'css;.pagelist',
  1956. scrollD: 1000
  1957. }
  1958. }, // 233 动漫 - 动漫情报/资讯
  1959. dm233_rank: {
  1960. pager: {
  1961. type: 1,
  1962. nextL: '//div[@class="pagelist"]//a[contains(text(), "下一页") or contains(text(), "下一頁")]',
  1963. pageE: 'css;.side-update.normal-wai > .normal-nei',
  1964. insertP: ['css;.side-update.normal-wai', 3],
  1965. replaceE: 'css;.pagelist',
  1966. scrollD: 1000
  1967. }
  1968. }, // 233 动漫 - 排行榜
  1969. anime1: {
  1970. host: 'anime1.me',
  1971. functionStart: function() {if (location.search.indexOf('s=') > -1) {
  1972. curSite = DBSite.anime1_search;
  1973. } else if (location.pathname === '/') {
  1974. curSite = DBSite.anime1;
  1975. }},
  1976. pager: {
  1977. type: 4,
  1978. nextL: anime1_nextL,
  1979. interval: 500,
  1980. scrollD: 800
  1981. }
  1982. }, // Anime1
  1983. anime1_search: {
  1984. pager: {
  1985. type: 1,
  1986. nextL: 'css;.nav-previous > a',
  1987. pageE: 'css;#main > article',
  1988. insertP: ['css;nav.navigation', 1],
  1989. replaceE: 'css;nav.navigation',
  1990. scrollD: 1200
  1991. }
  1992. }, // Anime1 - 搜索页
  1993. yinfans: {
  1994. host: 'www.yinfans.net',
  1995. insStyle: '#post_container {height: auto !important;} #post_container > li {position: static !important; float: left !important; height: 620px !important;}',
  1996. pager: {
  1997. type: 1,
  1998. nextL: 'css;a.next',
  1999. pageE: 'css;#post_container > li',
  2000. insertP: ['css;#post_container', 3],
  2001. replaceE: 'css;.pagination',
  2002. scrollD: 1500
  2003. }
  2004. }, // 音范丝
  2005. btbtt: {
  2006. host: /btbtt/,
  2007. pager: {
  2008. type: 1,
  2009. nextL: '//div[@class="page"]/a[contains(text(), "▶") or contains(text(), "下一页")]',
  2010. pageE: 'css;#threadlist > table, #threadlist > hr',
  2011. insertP: ['css;#threadlist', 3],
  2012. replaceE: 'css;.page',
  2013. scrollD: 2000
  2014. }
  2015. }, // BT 之家
  2016. bdys: {
  2017. host: 'www.bd2020.com',
  2018. functionStart: function() {if (location.pathname != '/' && !(/\/\d+\.htm/.test(location.pathname))) {curSite = DBSite.bdys;}},
  2019. pager: {
  2020. type: 2,
  2021. nextL: 'css;div.layui-flow-more > a',
  2022. nextText: '加载更多',
  2023. scrollD: 1000
  2024. }
  2025. }, // BD 影视
  2026. gaoqing_fm: {
  2027. host: 'gaoqing.fm',
  2028. pager: {
  2029. type: 2,
  2030. nextL: 'css;.col-md-12 > a, #loadmore > a',
  2031. interval: 1500,
  2032. scrollD: 1000
  2033. }
  2034. }, // 高清电台
  2035. yyds: {
  2036. host: 'yyds.fans',
  2037. functionStart: function() {
  2038. if (location.search != '' && location.search.indexOf('p=') === -1) {
  2039. curSite = DBSite.yyds;
  2040. }},
  2041. pager: {
  2042. type: 1,
  2043. nextL: 'css;a.next.page-numbers',
  2044. pageE: 'css;.list-grouped > div',
  2045. insertP: ['css;.list-grouped', 3],
  2046. replaceE: 'css;nav.pagination',
  2047. scrollD: 1100
  2048. }
  2049. }, // YYDS 电影
  2050. kisssub: {
  2051. host: ['www.kisssub.org','www.comicat.org'],
  2052. pager: {
  2053. type: 1,
  2054. nextL: 'css;a.nextprev',
  2055. pageE: 'css;#data_list > tr',
  2056. insertP: ['css;#data_list', 3],
  2057. replaceE: 'css;.pages',
  2058. scrollD: 2500
  2059. }
  2060. }, // 爱恋动漫
  2061. dmhy: {
  2062. host: ['share.dmhy.org', 'dmhy.anoneko.com'],
  2063. pager: {
  2064. type: 1,
  2065. nextL: '//div[@class="nav_title"]/a[contains(text(), "下一")]',
  2066. pageE: 'css;#topic_list > tbody > tr',
  2067. insertP: ['css;#topic_list > tbody', 3],
  2068. replaceE: 'css;.nav_title',
  2069. scrollD: 1500
  2070. },
  2071. function: {
  2072. aF: 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');`;}
  2073. }
  2074. }, // 动漫花园
  2075. futaacg: {
  2076. host: 'futaacg.com',
  2077. pager: {
  2078. type: 1,
  2079. nextL: 'css;ul.pagination a[rel="next"]',
  2080. pageE: 'css;.topic-list > div',
  2081. insertP: ['css;.topic-list', 3],
  2082. replaceE: 'css;ul.pagination',
  2083. scrollD: 1500
  2084. }
  2085. }, // 扶她动漫
  2086. bangumi: {
  2087. host: 'bangumi.moe',
  2088. pager: {
  2089. type: 2,
  2090. nextL: 'css;[torrent-list="lattorrents"] button[ng-click="loadMore()"] ,[torrent-list="torrents"] button[ng-click="loadMore()"]',
  2091. interval: 1000,
  2092. scrollD: 1500
  2093. }
  2094. }, // 萌番组
  2095. miobt: {
  2096. host: ['miobt.com', 'www.36dm.club'],
  2097. functionStart: function() {curSite = DBSite.miobt;
  2098. if (location.host === 'www.36dm.club') {
  2099. curSite.pager.scrollD = 1000;
  2100. }},
  2101. pager: {
  2102. type: 1,
  2103. nextL: '//a[@class="nextprev"][contains(text(), "〉") or contains(text(), "下一页") or contains(text(), "»")]',
  2104. pageE: 'css;#data_list > tr',
  2105. insertP: ['css;#data_list', 3],
  2106. replaceE: 'css;.pages',
  2107. scrollD: 2000
  2108. }
  2109. }, // MioBT + 简单动漫
  2110. nyaa: {
  2111. host: /nyaa\.si/,
  2112. pager: {
  2113. type: 1,
  2114. nextL: 'css;a[rel="next"], li.next > a',
  2115. pageE: 'css;table.torrent-list > tbody > tr',
  2116. insertP: ['css;table.torrent-list > tbody', 3],
  2117. replaceE: 'css;ul.pagination',
  2118. scrollD: 2000
  2119. }
  2120. }, // Nyaa
  2121. skrbt: {
  2122. host: /skrbt/,
  2123. functionStart: function() {if (location.pathname === '/search') curSite = DBSite.skrbt;},
  2124. pager: {
  2125. type: 1,
  2126. nextL: skrbt_nextL,
  2127. pageE: 'css;div[class="row"] > .col-md-6 > ul',
  2128. insertP: ['css;nav[aria-label*="Page"]', 1],
  2129. replaceE: 'css;ul.pagination',
  2130. scrollD: 900
  2131. }
  2132. }, // SkrBT
  2133. rarbgprx: {
  2134. host: /rarbg/,
  2135. functionStart: function() {if (location.pathname === '/torrents.php') {curSite = DBSite.rarbgprx;}},
  2136. pager: {
  2137. type: 1,
  2138. nextL: 'css;#pager_links > a[title="next page"]',
  2139. pageE: 'css;table.lista2t tr.lista2',
  2140. insertP: ['css;table.lista2t > tbody', 3],
  2141. replaceE: 'css;#pager_links',
  2142. scrollD: 1000
  2143. }
  2144. }, // RARBG
  2145. subdh: {
  2146. host: 'subdh.com',
  2147. functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/list/new') > -1) {
  2148. curSite = DBSite.subdh;
  2149. } else if (location.pathname.indexOf('/search') > -1) {
  2150. curSite = DBSite.subdh_search;
  2151. }},
  2152. pager: {
  2153. type: 1,
  2154. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  2155. pageE: 'css;.col-lg-9 .bg-white.shadow-sm.rounded-3 > .row.gx-0',
  2156. insertP: ['css;.col-lg-9 .bg-white.shadow-sm.rounded-3', 3],
  2157. replaceE: 'css;ul.pagination',
  2158. scrollD: 1000
  2159. }
  2160. }, // SubDH
  2161. subdh_search: {
  2162. pager: {
  2163. type: 1,
  2164. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  2165. pageE: 'css;.col-lg-9 .bg-white.shadow-sm.rounded-3',
  2166. insertP: ['css;nav[aria-label="pagination"]', 1],
  2167. replaceE: 'css;ul.pagination',
  2168. scrollD: 1000
  2169. }
  2170. }, // SubDH - 搜索页
  2171. mini4k: {
  2172. host: 'www.mini4k.com',
  2173. functionStart: function() {if (location.pathname != '/' && !(/\/\d{3,}/.test(location.pathname))) {curSite = DBSite.mini4k;};},
  2174. pager: {
  2175. type: 1,
  2176. nextL: 'css;a.pager__item--next',
  2177. pageE: 'css;div[class*="-item-list"] > ul > li',
  2178. insertP: ['css;div[class*="-item-list"] > ul', 3],
  2179. replaceE: 'css;.pagination',
  2180. scrollD: 2000
  2181. }
  2182. }, // MINI4K
  2183. bthaha: {
  2184. host: /bthaha/,
  2185. functionStart: function() {if (location.pathname.indexOf('/search/') > -1) {
  2186. curSite = DBSite.bthaha;
  2187. document.querySelectorAll('[id^="list_top"], [id^="list_bottom"]').forEach(function (one) {one.parentElement.parentElement.hidden = true;});
  2188. }},
  2189. insStyle: '[id^="list_top"], [id^="list_bottom"] {display: none !important;}',
  2190. pager: {
  2191. type: 1,
  2192. nextL: '//ul[@class="pagination"]/li/a[contains(text(), "下一页")]',
  2193. pageE: 'css;table.table > tbody > tr',
  2194. insertP: ['css;table.table > tbody', 3],
  2195. replaceE: 'css;ul.pagination',
  2196. scrollD: 1000
  2197. },
  2198. function: {
  2199. bF: bthaha_bF
  2200. }
  2201. }, // BTHaha
  2202. a4k: {
  2203. host: 'www.a4k.net',
  2204. functionStart: function() {if (location.pathname.indexOf('/subtitle/') === -1) {curSite = DBSite.a4k;};},
  2205. pager: {
  2206. type: 1,
  2207. nextL: 'css;a.pager__item--next',
  2208. pageE: 'css;ul.list > li',
  2209. insertP: ['css;ul.list', 3],
  2210. replaceE: 'css;.pagination',
  2211. scrollD: 1000
  2212. }
  2213. }, // A4k 字幕网(字幕)
  2214. assrt: {
  2215. host: 'assrt.net',
  2216. functionStart: function() {if (location.pathname != '/') {curSite = DBSite.assrt;};},
  2217. pager: {
  2218. type: 1,
  2219. nextL: assrt_nextL,
  2220. pageE: 'css;.resultcard > div:not(#top-banner):not(#bottom-banner)',
  2221. insertP: ['css;.pagelinkcard', 1],
  2222. replaceE: 'css;.pagelinkcard',
  2223. scrollD: 1000
  2224. }
  2225. }, // 射手网(字幕)
  2226. subhd: {
  2227. host: 'subhd.tv',
  2228. functionStart: function() {if (location.pathname === '/forum/forum') {
  2229. curSite = DBSite.subhd_forum;
  2230. } else if (location.pathname != '/' && location.pathname != '/zu' && location.pathname.indexOf('/a/') === -1 && location.pathname.indexOf('/d/') === -1 && location.pathname.indexOf('/forum/') === -1) {
  2231. curSite = DBSite.subhd;
  2232. }},
  2233. pager: {
  2234. type: 1,
  2235. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  2236. pageE: 'css;.bg-white.shadow-sm.rounded-3',
  2237. insertP: ['css;nav.clearfix', 1],
  2238. replaceE: 'css;nav.clearfix',
  2239. scrollD: 1000
  2240. }
  2241. }, // SubHD(字幕)
  2242. subhd_forum: {
  2243. pager: {
  2244. type: 1,
  2245. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  2246. pageE: 'css;.bg-white.shadow-sm.rounded-3 > div',
  2247. insertP: ['css;.bg-white.shadow-sm.rounded-3', 3],
  2248. replaceE: 'css;nav.clearfix',
  2249. scrollD: 800
  2250. }
  2251. }, // SubHD - forum(字幕)
  2252. manben: {
  2253. host: 'www.manben.com',
  2254. functionStart: function() {if (/\/m\d+/.test(location.pathname)) {
  2255. if (getCookie('showtype') != '2') {
  2256. document.cookie='showtype=2; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 开启 [垂直阅读] 模式
  2257. location.reload(); // 刷新网页
  2258. }
  2259. curSite = DBSite.mhxqiu;
  2260. }}
  2261. }, // 漫本
  2262. cartoonmad: {
  2263. host: ['www.cartoonmad.com','www.cartoonmad.cc'],
  2264. functionStart: function() {if (location.pathname.indexOf('/comic/') > -1) {
  2265. document.querySelector('body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child > a').href = 'javascript:void(0);'; // 清理图片上的链接
  2266. curSite = DBSite.cartoonmad;
  2267. } else if (location.pathname != '/') {
  2268. curSite = DBSite.cartoonmad_list;
  2269. }},
  2270. insStyle: '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;}',
  2271. pager: {
  2272. type: 1,
  2273. nextL: cartoonmad_nextL,
  2274. pageE: 'css;body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child img',
  2275. insertP: ['css;body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child > a', 3],
  2276. replaceE: 'css;body > table > tbody > tr:nth-child(2), body > table > tbody > tr:nth-child(5)',
  2277. scrollD: 2000
  2278. }
  2279. }, // 动漫狂
  2280. cartoonmad_list: {
  2281. pager: {
  2282. type: 1,
  2283. nextL: '//a[@class="pages"][contains(text(), "下一頁")]',
  2284. pageE: 'css;td[background="/image/content_box4.gif"]+td > table > tbody > tr',
  2285. insertP: ['css;td[background="/image/content_box4.gif"]+td > table > tbody', 3],
  2286. replaceE: '//a[@class="pages"]/parent::td/parent::tr | //font[contains(text(), "目前在第")]',
  2287. scrollD: 1000
  2288. }
  2289. }, // 动漫狂 - 分类/搜索页
  2290. manhuacat: {
  2291. host: 'www.manhuacat.com',
  2292. functionStart: function() {if (/\/manga\/\d+\/.+\.html/.test(location.pathname)) {
  2293. if (getCookie('is_pull') == 'true') { // 强制关闭 [下拉] 模式
  2294. document.cookie='is_pull=false; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 关闭 [下拉] 模式
  2295. location.reload(); // 刷新网页
  2296. }
  2297. setTimeout(manhuacat_init, 100);
  2298. curSite = DBSite.manhuacat;
  2299. } else if (location.pathname.indexOf('/list') > -1) {
  2300. curSite = DBSite.manhuacat_list;
  2301. } else if (location.pathname.indexOf('/search') > -1 || location.pathname.indexOf('/update') > -1) {
  2302. curSite = DBSite.manhuacat_search;
  2303. }},
  2304. insStyle: '#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;}', // 隐藏不需要的元素,调整图片
  2305. pager: {
  2306. type: 4,
  2307. nextL: manhuacat_nextL,
  2308. insertP: ['css;.img-content', 3],
  2309. insertE: manhuacat_insertE,
  2310. replaceE: 'css;.comic-detail > .breadcrumb-bar, .comic-detail >h2.h4, title, .vg-r-data, body > script:not([src])',
  2311. interval: 2000,
  2312. scrollD: 3000
  2313. }
  2314. }, // 漫画猫
  2315. manhuacat_list: {
  2316. pager: {
  2317. type: 1,
  2318. nextL: '//div[contains(@class, "pagination")]//a[contains(text(), "下一页") or contains(text(), "下页")]',
  2319. pageE: 'css;.comic-main-section > *',
  2320. insertP: ['css;.comic-main-section', 3],
  2321. replaceE: 'css;.pagination',
  2322. scrollD: 1000
  2323. },
  2324. function: {
  2325. bF: src_bF,
  2326. pF: [0, 'img[data-original]', 'data-original']
  2327. }
  2328. }, // 漫画猫 - 分类页
  2329. manhuacat_search: {
  2330. pager: {
  2331. type: 1,
  2332. nextL: '//div[contains(@class, "pagination")]//a[contains(text(), "下一页") or contains(text(), "下页")]',
  2333. pageE: 'css;.comic-main-section .row > div',
  2334. insertP: ['css;.comic-main-section .row', 3],
  2335. replaceE: 'css;.pagination',
  2336. scrollD: 1000
  2337. }
  2338. }, // 漫画猫 - 搜索页
  2339. manhuatai: {
  2340. host: 'www.manhuatai.net',
  2341. functionStart: function() {if (location.pathname.indexOf('/manhua/') > -1) {
  2342. curSite = DBSite.manhuatai;
  2343. } else if (location.pathname.indexOf('/fenlei_') > -1 || location.pathname.indexOf('/top_') > -1) {
  2344. curSite = DBSite.manhuatai_list;
  2345. } else if (location.pathname.indexOf('/search') > -1) {
  2346. curSite = DBSite.manhuatai_search;
  2347. }},
  2348. pager: {
  2349. type: 1,
  2350. nextL: '//div[contains(@class, "page")]//a[@href][contains(text(), "下一页") or contains(text(), "下一章")]',
  2351. pageE: 'css;#htmlContent p.img > img',
  2352. insertP: ['css;#htmlContent p.img', 3],
  2353. replaceE: 'css;.page, .title, title',
  2354. history: true,
  2355. scrollD: 2000
  2356. }
  2357. }, // 漫画台
  2358. manhuatai_list: {
  2359. pager: {
  2360. type: 1,
  2361. nextL: 'css;#pagelink a.next',
  2362. pageE: 'css;.article-list',
  2363. insertP: ['css;#pagelink', 1],
  2364. replaceE: 'css;#pagelink',
  2365. scrollD: 1500
  2366. }
  2367. }, // 漫画台 - 分类页
  2368. manhuatai_search: {
  2369. pager: {
  2370. type: 1,
  2371. nextL: 'css;#pagelink a.next',
  2372. pageE: 'css;#content > table > tbody > tr:not([align])',
  2373. insertP: ['css;#content > table > tbody', 3],
  2374. replaceE: 'css;#pagelink',
  2375. scrollD: 1500
  2376. }
  2377. }, // 漫画台 - 搜索页
  2378. manhuadb: {
  2379. host: 'www.manhuadb.com',
  2380. functionStart: function() {if (/\/manhua\/\d+\/.+\.html/.test(location.pathname)) {
  2381. if (document.querySelector('img.img-fluid.show-pic')) document.querySelector('img.img-fluid.show-pic').style.display = 'none'; // 隐藏第一个图片(避免重复)
  2382. setTimeout(manhuadb_init, 100);
  2383. curSite = DBSite.manhuadb;
  2384. } else if (location.pathname.indexOf('/list') > -1) {
  2385. curSite = DBSite.manhuacat_list;
  2386. } else if (location.pathname.indexOf('/search') > -1 || location.pathname.indexOf('/update') > -1) {
  2387. curSite = DBSite.manhuacat_search;
  2388. }},
  2389. insStyle: '.row.m-0.pt-3.ad_2_wrap, .row.m-0.ad_1_wrap, .pagination.justify-content-center, #left, #right {display: none !important;}',
  2390. pager: {
  2391. type: 4,
  2392. nextL: manhuadb_nextL,
  2393. pageE: 'css;body > script:not([type]):not([src]), .vg-r-data, ol.links-of-books.num_div',
  2394. insertP: ['css;.pjax-container', 3],
  2395. insertE: manhuadb_insertE,
  2396. interval: 5000,
  2397. scrollD: 3000
  2398. }
  2399. }, // 漫画 DB
  2400. hicomic: {
  2401. host: 'www.hicomic.net',
  2402. functionStart: function() {if (location.pathname.indexOf('/chapters/') > -1) {
  2403. setTimeout(hicomic_init, 100);
  2404. curSite = DBSite.hicomic;
  2405. }},
  2406. insStyle: '.content {height: auto !important;} .footer, .left_cursor, .right_cursor, .finish {display: none !important;} .content > img {display: block !important;margin: 0 auto !important;}',
  2407. pager: {
  2408. type: 4,
  2409. nextL: hicomic_nextL,
  2410. insertP: ['css;.content', 3],
  2411. insertE: hicomic_insertE,
  2412. interval: 5000,
  2413. scrollD: 3000
  2414. }
  2415. }, // HiComic (嗨漫画)
  2416. dmzj: {
  2417. host: 'www.dmzj.com',
  2418. functionStart: function() {if (location.pathname.indexOf('/view/') > -1) {
  2419. if (getCookie('display_mode') != '1') { // 强制开启 [上下滚动阅读] 模式
  2420. document.cookie='display_mode=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 开启 [上下滚动阅读] 模式
  2421. location.reload(); // 刷新网页
  2422. }
  2423. setTimeout(dmzj_init, 100);
  2424. curSite = DBSite.dmzj;
  2425. } else if (location.pathname.indexOf('/category') > -1 || location.pathname.indexOf('/update') > -1) {
  2426. curSite = DBSite.dmzj_list;
  2427. } else if (location.pathname.indexOf('/rank') > -1) {
  2428. curSite = DBSite.dmzj_rank;
  2429. }},
  2430. insStyle: '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;}', // 隐藏中间的页数信息
  2431. pager: {
  2432. type: 4,
  2433. nextL: dmzj_nextL,
  2434. insertP: ['css;.comic_wraCon', 3],
  2435. insertE: dmzj_insertE,
  2436. replaceE: 'css;.wrap_last_mid, .wrap_last_head, title',
  2437. interval: 2000,
  2438. scrollD: 3000
  2439. }
  2440. }, // 动漫之家 - 原创
  2441. dmzj_list: {
  2442. insStyle: '.wrap_mhlist_l.con_left, .wrap_list {height: auto!important;}',
  2443. pager: {
  2444. type: 1,
  2445. nextL: 'css;a.pg_next',
  2446. pageE: 'css;ul.list_con_li > li',
  2447. insertP: ['css;ul.list_con_li', 3],
  2448. replaceE: 'css;.page',
  2449. scrollD: 1000
  2450. }
  2451. }, // 动漫之家 - 原创 - 分类页
  2452. dmzj_rank: {
  2453. insStyle: '.wrap_mhlist_l.con_left {height: auto!important;}',
  2454. pager: {
  2455. type: 1,
  2456. nextL: 'css;a.pg_next',
  2457. pageE: 'css;.ph_r_con_li > div:not(.ad_column)',
  2458. insertP: ['css;.ph_r_con_li', 3],
  2459. replaceE: 'css;.page',
  2460. scrollD: 1000
  2461. }
  2462. }, // 动漫之家 - 原创 - 排行榜
  2463. dmzj_manhua: {
  2464. host: 'manhua.dmzj.com',
  2465. functionStart: function() {if (/\/\d+\.shtml/.test(location.pathname)) {
  2466. let chapterScroll = document.getElementById('qiehuan_txt') // 强制为 [上下滚动阅读] 模式
  2467. if (chapterScroll && chapterScroll.textContent === '切换到上下滚动阅读') {chapterScroll.click();}
  2468. setTimeout(dmzj_manhua_init, 100);
  2469. curSite = DBSite.dmzj_manhua;
  2470. } else if (location.pathname.indexOf('/update') > -1) {
  2471. curSite = DBSite.dmzj_manhua_update;
  2472. }},
  2473. insStyle: '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;}', // 隐藏中间的页数信息
  2474. pager: {
  2475. type: 4,
  2476. nextL: dmzj_manhua_nextL,
  2477. insertP: ['css;#center_box', 3],
  2478. insertE: dmzj_manhua_insertE,
  2479. replaceE: 'css;.display_graybg, title',
  2480. interval: 2000,
  2481. scrollD: 3000
  2482. }
  2483. }, // 动漫之家 - 日漫
  2484. dmzj_manhua_update: {
  2485. pager: {
  2486. type: 1,
  2487. nextL: '//div[@class="pages"]/a[contains(text(), "下一页")]',
  2488. pageE: 'css;.newpic_content > *:not(.pages)',
  2489. insertP: ['css;.newpic_content', 3],
  2490. replaceE: 'css;.pages',
  2491. scrollD: 1000
  2492. }
  2493. }, //动漫之家 - 日漫 - 最新更新
  2494. copymanga: {
  2495. host: 'www.copymanga.com',
  2496. functionStart: function() {if (location.pathname.indexOf('/chapter/') > -1) {
  2497. curSite = DBSite.copymanga;
  2498. } else if (location.pathname.indexOf('/comics') > -1) {
  2499. curSite = DBSite.copymanga_list;
  2500. }},
  2501. iframe: true,
  2502. insStyle: '.upMember, .comicContainerAds, .footer, #Autopage_number {display: none !important;}',
  2503. pager: {
  2504. type: 4,
  2505. nextL: copymanga_nextL,
  2506. pageE: 'css;ul.comicContent-list > li',
  2507. insertP: ['css;ul.comicContent-list', 2],
  2508. scrollD: 3000
  2509. }
  2510. }, // 拷贝漫画
  2511. copymanga_list: {
  2512. pager: {
  2513. type: 1,
  2514. nextL: 'css;li.next > a',
  2515. pageE: 'css;.exemptComic-box > div',
  2516. insertP: ['css;.exemptComic-box', 3],
  2517. replaceE: 'css;ul.page-all',
  2518. scrollD: 1500
  2519. },
  2520. function: {
  2521. bF: src_bF,
  2522. pF: [0, 'img[data-src]', 'data-src']
  2523. }
  2524. }, // 拷贝漫画 - 分类页
  2525. mhxqiu: {
  2526. host: 'www.mhxqiu.com',
  2527. functionStart: function() {if (/\/\d+\.html/.test(location.pathname)) { // 阅读页
  2528. curSite = DBSite.mhxqiu;
  2529. } else if (/\/\d+\/$/.test(location.pathname)) { // 目录页
  2530. setTimeout(function(){if (document.getElementById('zhankai')) document.getElementById('zhankai').click();}, 500)
  2531. } else if (/\/(sort|rank)\//.test(location.pathname)) { // 分类页
  2532. curSite = DBSite.mhxqiu_list;
  2533. }},
  2534. insStyle: '.imgFloat_1, .imgFloat_2, .main_control, span.comic-ft {display: none !important;} html, body, #mainView {height: auto !important;} body.view .main ul.comic-contain li{margin:0 auto !important;} .comic-contain .loaded{box-shadow: none !important;}',
  2535. pager: {
  2536. type: 4,
  2537. nextL: mhxqiu_nextL,
  2538. insertP: ['css;#comicContain', 3],
  2539. insertE: mhxqiu_insertE,
  2540. replaceE: 'css;.main_control, h1.chaptername_title, span.title-comicHeading, title',
  2541. interval: 4000,
  2542. scrollD: 3000
  2543. }
  2544. }, // 漫画星球
  2545. mhxqiu_list: {
  2546. pager: {
  2547. type: 1,
  2548. nextL: '//div[@class="NewPages"]//a[contains(text(), "下一页")]',
  2549. pageE: 'css;.cy_list_mh > ul',
  2550. insertP: ['css;.cy_list_mh', 3],
  2551. replaceE: 'css;.NewPages',
  2552. scrollD: 1000
  2553. }
  2554. }, // 漫画星球 - 分类页
  2555. fffdm: {
  2556. host: 'manhua.fffdm.com',
  2557. functionStart: function() {if (location.pathname.split('/').length === 4) {curSite = DBSite.fffdm;}},
  2558. insStyle: '#footer, #header {display: none !important;}',
  2559. pager: {
  2560. type: 4,
  2561. nextL: fffdm_nextL,
  2562. insertP: ['css;#mhimg0', 3],
  2563. insertE: fffdm_insertE,
  2564. replaceE: 'css;.navigation, #weizhi, h1, title',
  2565. scrollD: 2000
  2566. }
  2567. }, // 风之动漫
  2568. gufengmh: {
  2569. host: /gufengmh/,
  2570. functionStart: function() {if (/\/\d+.+\.html/.test(location.pathname)) {
  2571. let chapterScroll = document.getElementById('chapter-scroll') // 强制为 [下拉阅读] 模式
  2572. if (chapterScroll && chapterScroll.className === '') {chapterScroll.click();}
  2573. curSite = DBSite.gufengmh;
  2574. } else if (location.pathname.indexOf('/update') > -1 || location.pathname.indexOf('/list') > -1 || location.pathname.indexOf('/search') > -1) {
  2575. curSite = DBSite.gufengmh_list;
  2576. }},
  2577. insStyle: 'p.img_info {display: none !important;}', // 隐藏中间的页数信息
  2578. pager: {
  2579. type: 4,
  2580. nextL: gufengmh_nextL,
  2581. pageE: 'css;body > script:first-child',
  2582. insertP: ['css;#images', 3],
  2583. insertE: gufengmh_insertE,
  2584. interval: 5000,
  2585. scrollD: 4000
  2586. }
  2587. }, // 古风漫画网
  2588. gufengmh_list: {
  2589. pager: {
  2590. type: 1,
  2591. nextL: 'css;li.next > a',
  2592. pageE: 'css;ul.book-list > li',
  2593. insertP: ['css;ul.book-list', 3],
  2594. replaceE: 'css;ul.pagination',
  2595. scrollD: 1000
  2596. }
  2597. }, // 古风漫画网 - 分类页
  2598. szcdmj: {
  2599. host: 'www.szcdmj.com',
  2600. functionStart: function() {
  2601. if (location.pathname.indexOf('/szcchapter/') > -1) {
  2602. curSite = DBSite.szcdmj;
  2603. } else if (location.pathname.indexOf('/szcbook/') > -1) {
  2604. if (document.querySelector('#detail-list-more')) document.querySelector('#detail-list-more').click();
  2605. } else if (location.pathname === '/szcbolist' || location.pathname === '/update') {
  2606. curSite = DBSite.szcdmj_list;
  2607. }},
  2608. insStyle: '.header {opacity: 0.3 !important;}',
  2609. pager: {
  2610. type: 1,
  2611. nextL: '//div[@class="fanye"][1]/a[@href][text()="下一页" or text()="下一话"]',
  2612. pageE: 'css;.comicpage > div',
  2613. insertP: ['css;.comicpage', 3],
  2614. replaceE: 'css;.fanye,h1.title',
  2615. history: true,
  2616. scrollD: 2000
  2617. },
  2618. function: {
  2619. bF: szcdmj_bF
  2620. }
  2621. }, // 砂之船动漫家
  2622. szcdmj_list: {
  2623. pager: {
  2624. type: 1,
  2625. nextL: 'css;#nextPage',
  2626. pageE: 'css;ul.mh-list > li',
  2627. insertP: ['css;ul.mh-list', 3],
  2628. replaceE: 'css;.pagination',
  2629. scrollD: 1000
  2630. }
  2631. }, // 砂之船动漫家 - 分类/搜索页
  2632. mangabz: {
  2633. host: ['mangabz.com', 'www.mangabz.com'],
  2634. functionStart: function() {if (/\/m\d+/.test(location.pathname)) {
  2635. setTimeout(mangabz_init, 500);
  2636. curSite = DBSite.mangabz;
  2637. } else if (/\/\d+bz\//.test(location.pathname)) {
  2638. if (document.querySelector('.detail-list-form-more')) document.querySelector('.detail-list-form-more').click();
  2639. } else if (location.pathname.indexOf('/manga-list') > -1 || location.pathname === '/search') {
  2640. curSite = DBSite.mangabz_list;
  2641. }},
  2642. insStyle: '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;}',
  2643. pager: {
  2644. type: 4,
  2645. nextL: mangabz_nextL,
  2646. insertP: ['css;#cp_img', 3],
  2647. insertE: mangabz_insertE,
  2648. replaceE: 'css;p.top-title, body > .container > div:not([id]), title',
  2649. interval: 500,
  2650. scrollD: 1000
  2651. }
  2652. }, // Mangabz 漫画
  2653. mangabz_list: {
  2654. pager: {
  2655. type: 1,
  2656. nextL: '//div[@class="page-pagination"]//a[contains(text(), ">")]',
  2657. pageE: 'css;ul.mh-list > li',
  2658. insertP: ['css;ul.mh-list', 3],
  2659. replaceE: 'css;.page-pagination',
  2660. scrollD: 800
  2661. }
  2662. }, // Mangabz 漫画 - 分类/搜索页
  2663. xmanhua: {
  2664. host: ['xmanhua.com', 'www.xmanhua.com'],
  2665. functionStart: function() {if (/\/m\d+/.test(location.pathname)) {
  2666. setTimeout(mangabz_init, 500);
  2667. curSite = DBSite.xmanhua;
  2668. } else if (/\/\d+xm\//.test(location.pathname)) {
  2669. if (document.querySelector('.detail-list-form-more')) document.querySelector('.detail-list-form-more').click();
  2670. } else if (location.pathname.indexOf('/manga-list') > -1 || location.pathname === '/search') {
  2671. curSite = DBSite.xmanhua_list;
  2672. }},
  2673. insStyle: '#Autopage_number, a.reader-bottom-page {display: none !important;} .header, .reader-bottom {opacity: 0.3 !important;} #cp_img > img{display: block !important;margin: 0 auto !important;width: auto !important; height: auto !important;}',
  2674. pager: {
  2675. type: 4,
  2676. nextL: xmanhua_nextL,
  2677. insertP: ['css;#cp_img', 3],
  2678. insertE: xmanhua_insertE,
  2679. replaceE: 'css;.reader-title, body > .container > div:not([id]), title',
  2680. interval: 500,
  2681. scrollD: 1500
  2682. }
  2683. }, // Xmanhua 漫画
  2684. xmanhua_list: {
  2685. pager: {
  2686. type: 1,
  2687. nextL: '//div[@class="page-pagination"]//a[contains(text(), ">")]',
  2688. pageE: 'css;ul.mh-list > li',
  2689. insertP: ['css;ul.mh-list', 3],
  2690. replaceE: 'css;.page-pagination',
  2691. scrollD: 1000
  2692. }
  2693. }, // Xmanhua 漫画 - 分类/搜索页
  2694. cocomanga: {
  2695. host: 'www.cocomanga.com',
  2696. functionStart: function() {if (location.pathname.indexOf('.html') > -1) {
  2697. if (!(getCookie('mh_readmode') === '' || getCookie('mh_readmode') === '3')) {
  2698. document.cookie='mh_readmode=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/'; // 强制开启自带的无缝翻页功能
  2699. location.reload(); // 刷新网页
  2700. }
  2701. setTimeout(cocomanga_init, 500);
  2702. curSite = DBSite.cocomanga;
  2703. } else if (/\/\d+\/$/.test(location.pathname)) {
  2704. setTimeout(function(){if (document.querySelector('a.website-display-all')) document.querySelector('a.website-display-all').click();}, 300)
  2705. } else if (location.pathname === '/show') {
  2706. curSite = DBSite.cocomanga_list;
  2707. } else if (location.pathname === '/search') {
  2708. curSite = DBSite.cocomanga_search;
  2709. }},
  2710. insStyle: '.mh_readend, .mh_footpager, .mh_readmode {display: none !important;} .mh_comicpic img {cursor: unset !important;}',
  2711. pager: {
  2712. type: 4,
  2713. nextL: cocomanga_nextL,
  2714. insertP: ['css;#mangalist', 3],
  2715. insertE: cocomanga_insertE,
  2716. replaceE: 'css;.mh_readtitle, .mh_headpager > a.mh_prevbook, .mh_readend, head > title',
  2717. interval: 1000,
  2718. scrollD: 2500
  2719. }
  2720. }, // COCOMANGA 漫画
  2721. cocomanga_list: {
  2722. pager: {
  2723. type: 1,
  2724. nextL: cocomanga_list_nextL,
  2725. pageE: 'css;ul.fed-list-info > li',
  2726. insertP: ['css;ul.fed-list-info', 3],
  2727. replaceE: 'css;.fed-page-info',
  2728. scrollD: 1000
  2729. },
  2730. function: {
  2731. bF: src_bF,
  2732. pF: [1, 'a[data-original]', 'data-original']
  2733. }
  2734. }, // COCOMANGA 漫画 - 分类页
  2735. cocomanga_search: {
  2736. pager: {
  2737. type: 1,
  2738. nextL: cocomanga_list_nextL,
  2739. pageE: 'css;dl.fed-deta-info',
  2740. insertP: ['css;.fed-page-info', 1],
  2741. replaceE: 'css;.fed-page-info',
  2742. scrollD: 1000
  2743. },
  2744. function: {
  2745. bF: src_bF,
  2746. pF: [1, 'a[data-original]', 'data-original']
  2747. }
  2748. }, // COCOMANGA 漫画 - 搜索页
  2749. qidian: {
  2750. host: 'www.qidian.com',
  2751. functionStart: function() {if (location.pathname.indexOf('/all/') > -1) {curSite = DBSite.qidian;}},
  2752. pager: {
  2753. type: 1,
  2754. nextL: 'css;a[class*="pagination-next"]',
  2755. pageE: 'css;ul.all-img-list > li',
  2756. insertP: ['css;ul.all-img-list', 3],
  2757. replaceE: 'css;#page-container',
  2758. scrollD: 900
  2759. }
  2760. }, // 起点小说
  2761. qidian_read: {
  2762. host: 'read.qidian.com',
  2763. insStyle: '.admire-wrap {display: none !important;}',
  2764. pager: {
  2765. type: 1,
  2766. nextL: 'css;a[id$="chapterNext"]',
  2767. pageE: 'css;.main-text-wrap > div:not(.admire-wrap)',
  2768. insertP: ['css;.main-text-wrap', 3],
  2769. replaceE: 'css;.chapter-control, title',
  2770. history: true,
  2771. scrollD: 900
  2772. }
  2773. }, // 起点小说 - 阅读页
  2774. baoshuu: {
  2775. host: 'www.baoshuu.com',
  2776. functionStart: function() {if (location.pathname.indexOf('/TXT/list') > -1) curSite = DBSite.baoshuu;},
  2777. pager: {
  2778. type: 1,
  2779. nextL: '//div[@class="listl2"]//a[text()="下一页"]',
  2780. pageE: 'css;.listl2 > ul > li',
  2781. insertP: ['css;.listl2 > ul', 3],
  2782. replaceE: 'css;.listl2 > dl',
  2783. scrollD: 900
  2784. }
  2785. }, // 宝书网
  2786. baoshuu_m: {
  2787. host: 'm.baoshuu.com',
  2788. functionStart: function() {if (location.pathname.indexOf('/TXT/list') > -1) curSite = DBSite.baoshuu_m;},
  2789. pager: {
  2790. type: 1,
  2791. nextL: '//div[@class="man_first"]//a[text()="下一页"]',
  2792. pageE: 'css;.man_first > ul > li',
  2793. insertP: ['css;.man_first > ul', 3],
  2794. replaceE: 'css;.man_first > dl',
  2795. scrollD: 900
  2796. }
  2797. }, // 宝书网- 手机版
  2798. yushubo: {
  2799. host: 'www.yushubo.com',
  2800. functionStart: function() {if (location.pathname.indexOf('/read_') > -1) {
  2801. curSite = DBSite.yushubo;
  2802. } else if (location.pathname.indexOf('/lists/') > -1) {
  2803. curSite = DBSite.yushubo_list;
  2804. } else if (location.pathname.indexOf('/all') > -1) {
  2805. curSite = DBSite.yushubo_all;
  2806. }},
  2807. insStyle: '.readbg.mt10 {display: none !important;}',
  2808. pager: {
  2809. type: 1,
  2810. nextL: '//div[contains(@class, "articlebtn")]/a[contains(text(), "下一页") or contains(text(), "下一章")]',
  2811. pageE: 'css;#BookText',
  2812. insertP: ['css;#BookText', 5],
  2813. replaceE: 'css;.articlebtn, head > title',
  2814. history: true,
  2815. scrollD: 1000
  2816. }
  2817. }, // 御书网
  2818. yushubo_list: {
  2819. pager: {
  2820. type: 1,
  2821. nextL: 'id("pager")//a[contains(text(), "下一页")]',
  2822. pageE: 'css;.books-list > ul > li',
  2823. insertP: ['css;.books-list > ul', 3],
  2824. replaceE: 'css;#pager',
  2825. scrollD: 1000
  2826. }
  2827. }, // 御书网 - 分类页
  2828. yushubo_all: {
  2829. pager: {
  2830. type: 1,
  2831. nextL: 'id("pager")//a[contains(text(), "下一页")]',
  2832. pageE: 'css;ul.search-list > li',
  2833. insertP: ['css;ul.search-list', 3],
  2834. replaceE: 'css;#pager',
  2835. scrollD: 1000
  2836. }
  2837. }, // 御书网 - 书库页
  2838. xineyby: {
  2839. host: 'www.xineyby.com',
  2840. functionStart: function() {if (location.pathname.indexOf('/read/') > -1) {
  2841. curSite = DBSite.xineyby;
  2842. } else if (location.pathname.indexOf('/list/') > -1 || location.pathname.indexOf('/quanben/') > -1 || location.pathname.indexOf('/search') > -1) {
  2843. curSite = DBSite.xineyby_list;
  2844. }},
  2845. pager: {
  2846. type: 1,
  2847. nextL: 'id("footlink")/a[contains(text(), "下一页")]',
  2848. pageE: 'css;#contents',
  2849. insertP: ['css;#contents', 5],
  2850. replaceE: 'css;#footlink, head > title, #amain dd h1',
  2851. history: true,
  2852. scrollD: 900
  2853. }
  2854. }, // 无错小说网
  2855. xineyby_list: {
  2856. pager: {
  2857. type: 1,
  2858. nextL: 'css;#pagelink a.next',
  2859. pageE: 'css;#content > dd tbody > tr:not(:first-child)',
  2860. insertP: ['css;#content > dd tbody', 3],
  2861. replaceE: 'css;#pagelink',
  2862. scrollD: 900
  2863. }
  2864. }, // 无错小说网 - 分类/搜索页
  2865. linovel: {
  2866. host: 'www.linovel.net',
  2867. functionStart: function() {if (/\/book\/\d+\/.+\.html/.test(location.pathname)) {
  2868. insStyle('.reward-section {display: none !important;}');
  2869. } else if (location.pathname.indexOf('/cat/') > -1) {
  2870. curSite = DBSite.linovel;
  2871. }},
  2872. pager: {
  2873. type: 1,
  2874. nextL: '//ul[@class="pagination"]/li/a[contains(text(), "下一页")]',
  2875. pageE: 'css;.rank-book-list > div',
  2876. insertP: ['css;.rank-book-list', 3],
  2877. replaceE: 'css;ul.pagination',
  2878. scrollD: 1000
  2879. }
  2880. }, // 轻之文库
  2881. _23qb: {
  2882. host: 'www.23qb.net',
  2883. functionStart: function() {if (/\/book\/\d+\/.+\.html/.test(location.pathname)) {
  2884. curSite = DBSite._23qb;
  2885. } else if (location.pathname != '/' && !(/\/book\/\d+\//.test(location.pathname))) {
  2886. curSite = DBSite._23qb_list;
  2887. }},
  2888. pager: {
  2889. type: 1,
  2890. nextL: function() {return (location.origin + ReadParams.url_next)},
  2891. pageE: 'id("mlfy_main_text")/* | //script[contains(text(), "ReadParams")]',
  2892. insertP: ['css;#mlfy_main_text', 3],
  2893. replaceE: 'css;title',
  2894. scriptT: 2,
  2895. scrollD: 1500
  2896. }
  2897. }, // 铅笔小说
  2898. _23qb_list: {
  2899. pager: {
  2900. type: 1,
  2901. nextL: 'css;.pages a.next, .pages > strong+a',
  2902. pageE: 'css;#sitebox > dl',
  2903. insertP: ['css;#sitebox', 3],
  2904. replaceE: 'css;.pages',
  2905. scrollD: 1000
  2906. },
  2907. function: {
  2908. bF: src_bF,
  2909. pF: [0, 'img[_src]', '_src']
  2910. }
  2911. }, // 铅笔小说 - 分类页
  2912. linovelib: {
  2913. host: 'www.linovelib.com',
  2914. functionStart: function() {if (/\/novel\/\d+\/.+\.html/.test(location.pathname)) {
  2915. curSite = DBSite.linovelib;
  2916. } else if (location.pathname.indexOf('/wenku/') > -1) {
  2917. curSite = DBSite.linovelib_wenku;
  2918. } else if (location.pathname.indexOf('/top/') > -1 || location.pathname.indexOf('/topfull/') > -1 || location.pathname.indexOf('toplist.php') > -1) {
  2919. curSite = DBSite.linovelib_top;
  2920. }},
  2921. pager: {
  2922. type: 1,
  2923. nextL: '//p[@class="mlfy_page"]/a[contains(text(), "下一页") or contains(text(), "下一章")]',
  2924. pageE: 'css;#mlfy_main_text > *',
  2925. insertP: ['css;#mlfy_main_text', 3],
  2926. replaceE: 'css;p.mlfy_page, head > title',
  2927. history: true,
  2928. scrollD: 1000
  2929. }
  2930. }, // 哔哩轻小说
  2931. linovelib_wenku: {
  2932. pager: {
  2933. type: 1,
  2934. nextL: 'css;#pagelink > a.next',
  2935. pageE: 'css;.store_collist > div.bookbox',
  2936. insertP: ['css;.store_collist', 3],
  2937. replaceE: 'css;#pagelink',
  2938. scrollD: 1000
  2939. },
  2940. function: {
  2941. bF: src_bF,
  2942. pF: [0, 'img[data-original]', 'data-original']
  2943. }
  2944. }, // 哔哩轻小说 - 文库
  2945. linovelib_top: {
  2946. pager: {
  2947. type: 1,
  2948. nextL: 'css;#pagelink > a.next',
  2949. pageE: 'css;.rankpage_box > div.rank_d_list',
  2950. insertP: ['css;div.pages', 1],
  2951. replaceE: 'css;#pagelink',
  2952. scrollD: 1000
  2953. },
  2954. function: {
  2955. bF: src_bF,
  2956. pF: [0, 'img[data-original]', 'data-original']
  2957. }
  2958. }, // 哔哩轻小说 - 全本
  2959. linovelib_w: {
  2960. host: 'w.linovelib.com',
  2961. functionStart: function() {if (/\/novel\/\d+\/.+\.html/.test(location.pathname)) {
  2962. curSite = DBSite.linovelib_w;
  2963. } else if (location.pathname.indexOf('/wenku/') > -1 || location.pathname.indexOf('/sa/') > -1) {
  2964. curSite = DBSite.linovelib_w_wenku;
  2965. }},
  2966. pager: {
  2967. type: 1,
  2968. nextL: function() {if (ReadParams) {return ReadParams.url_next}; return ''},
  2969. pageE: '//body/script[contains(text(), "var ReadParams")] | id("apage")/div',
  2970. insertP: ['css;#apage', 3],
  2971. replaceE: 'css;head > title',
  2972. history: true,
  2973. scriptT: 2,
  2974. scrollD: 1000
  2975. }
  2976. }, // 哔哩轻小说 (手机版)
  2977. linovelib_w_wenku: {
  2978. pager: {
  2979. type: 1,
  2980. nextL: 'css;#pagelink > strong+a ,#pagelink a.next',
  2981. pageE: 'css;ol.book-ol > li',
  2982. insertP: ['css;ol.book-ol', 3],
  2983. replaceE: 'css;#pagelink',
  2984. scrollD: 1000
  2985. },
  2986. function: {
  2987. bF: src_bF,
  2988. pF: [0, 'img[data-original]', 'data-original']
  2989. }
  2990. }, // 哔哩轻小说 (手机版) - 文库
  2991. _423down: {
  2992. host: 'www.423down.com',
  2993. functionStart: function() {if (location.pathname.indexOf('.html') === -1) curSite = DBSite._423down;},
  2994. pager: {
  2995. type: 1,
  2996. nextL: '//div[@class="paging"]//a[contains(text(),"下一页")]',
  2997. pageE: 'css;div.content-wrap ul.excerpt > li',
  2998. insertP: ['css;div.content-wrap ul.excerpt', 3],
  2999. replaceE: 'css;div.paging',
  3000. scrollD: 2000
  3001. }
  3002. }, // 423Down
  3003. iao_su: {
  3004. host: 'iao.su',
  3005. pager: {
  3006. type: 1,
  3007. nextL: 'css;li.next > a',
  3008. pageE: 'css;#index > article, #archive > article',
  3009. insertP: ['css;ol.page-navigator', 1],
  3010. replaceE: 'css;ol.page-navigator',
  3011. scriptT: 4,
  3012. scrollD: 1000
  3013. }
  3014. }, // 不死鸟
  3015. sharerw: {
  3016. host: 'www.sharerw.com',
  3017. functionStart: function() {if (location.pathname.indexOf('.html') === -1) {
  3018. if (location.pathname === '/search.php') {curSite = DBSite.sharerw_search;} else {curSite = DBSite.sharerw;};};},
  3019. pager: {
  3020. type: 1,
  3021. nextL: 'css;span.next > a',
  3022. pageE: 'css;.new-post > article',
  3023. insertP: ['css;.new-post', 3],
  3024. replaceE: 'css;.pagebar',
  3025. scrollD: 1500
  3026. }
  3027. }, // 分享者
  3028. sharerw_search: {
  3029. pager: {
  3030. type: 1,
  3031. nextL: 'css;span.next > a',
  3032. pageE: 'css;#mainbox > article',
  3033. insertP: ['css;.pagebar', 1],
  3034. replaceE: 'css;.pagebar',
  3035. scrollD: 1500
  3036. }
  3037. }, // 分享者 - 搜索页
  3038. extfans: {
  3039. host: 'www.extfans.com',
  3040. functionStart: function() {if (location.pathname != '/') {curSite = DBSite.extfans;}},
  3041. pager: {
  3042. type: 1,
  3043. nextL: 'css;.page a[data-page="next"]',
  3044. pageE: 'css;.side-left > ul[class*="-list"] > li',
  3045. insertP: ['css;.side-left > ul[class*="-list"]', 3],
  3046. replaceE: 'css;.page',
  3047. scrollD: 2000
  3048. }
  3049. }, // 扩展迷
  3050. chrome_zzzmh: {
  3051. host: 'chrome.zzzmh.cn',
  3052. pager: {
  3053. type: 2,
  3054. nextL: 'css;button.more-btn',
  3055. interval: 1000,
  3056. scrollD: 1500
  3057. }
  3058. }, // 极简插件
  3059. appinn: {
  3060. host: 'www.appinn.com',
  3061. pager: {
  3062. type: 1,
  3063. nextL: 'css;a.next.page-numbers',
  3064. pageE: 'css;section#latest-posts > article',
  3065. insertP: ['css;nav.navigation.pagination', 1],
  3066. replaceE: 'css;div.nav-links',
  3067. scrollD: 1500
  3068. }
  3069. }, // 小众软件
  3070. isharepc: {
  3071. host: 'www.isharepc.com',
  3072. pager: {
  3073. type: 1,
  3074. nextL: 'css;a.next',
  3075. pageE: 'css;.content > div',
  3076. insertP: ['css;nav.pagination', 1],
  3077. replaceE: 'css;nav.pagination',
  3078. scrollD: 1000
  3079. }
  3080. }, // 乐软博客
  3081. ghxi: {
  3082. host: 'www.ghxi.com',
  3083. functionStart: function() {if (location.pathname === '/' && !location.search) {curSite = DBSite.ghxi;} else {curSite = DBSite.ghxi_list;}},
  3084. pager: {
  3085. type: 2,
  3086. nextL: 'css;.load-more',
  3087. interval: 1000,
  3088. scrollD: 5000
  3089. }
  3090. }, // 果核剥壳 - 首页
  3091. ghxi_list: {
  3092. pager: {
  3093. type: 1,
  3094. nextL: 'css;a.next',
  3095. pageE: 'css;ul.post-loop > li',
  3096. insertP: ['css;ul.post-loop', 3],
  3097. replaceE: 'css;ul.pagination',
  3098. scrollD: 1500
  3099. },
  3100. function: {
  3101. bF: src_bF,
  3102. pF: [0, 'img[data-original]', 'data-original']
  3103. }
  3104. }, // 果核剥壳 - 分类/搜索页
  3105. sixyin: {
  3106. host: 'www.sixyin.com',
  3107. functionStart: function() {if (location.pathname === '/' && location.search === '') { // 首页
  3108. curSite = DBSite.sixyin;
  3109. } else if (location.pathname.indexOf('.html') === -1) { // 分类页
  3110. curSite = DBSite.sixyin_list;
  3111. }},
  3112. pager: {
  3113. type: 2,
  3114. nextL: 'css;.load-more',
  3115. nextHTML: '点击查看更多',
  3116. scrollD: 1500
  3117. }
  3118. }, // 六音软件 - 首页
  3119. sixyin_list: {
  3120. pager: {
  3121. type: 1,
  3122. nextL: 'css;a.next',
  3123. pageE: 'css;ul.post-loop > li',
  3124. insertP: ['css;ul.post-loop', 3],
  3125. replaceE: 'css;ul.pagination',
  3126. scrollD: 1500
  3127. }
  3128. }, // 六音软件 - 分类页
  3129. apprcn: {
  3130. host: ['www.apprcn.com', 'free.apprcn.com'],
  3131. functionStart: function() {if (location.pathname === '/' || location.pathname.indexOf('/category/') > -1) {curSite = DBSite.apprcn;}},
  3132. pager: {
  3133. type: 1,
  3134. nextL: '//div[@class="pagination"]//a[contains(text(), "Next")]',
  3135. pageE: 'css;article.article',
  3136. insertP: ['css;.pagination', 1],
  3137. replaceE: 'css;.pagination',
  3138. scrollD: 1000
  3139. }
  3140. }, // 反斗软件
  3141. weidown: {
  3142. host: 'www.weidown.com',
  3143. functionStart: function() {if (location.pathname.indexOf('/search/') > -1) { //搜索页
  3144. curSite = DBSite.weidown_search;
  3145. } else if (location.pathname.indexOf('/special') > -1) { // 专题页
  3146. curSite = DBSite.weidown_special;
  3147. } else {
  3148. curSite = DBSite.weidown;
  3149. }},
  3150. pager: {
  3151. type: 1,
  3152. nextL: 'css;a.nextpage',
  3153. pageE: 'css;.articleWrapper > .itemArticle, .articleWrapper > .richTextItem.search',
  3154. insertP: ['css;.articleWrapper', 3],
  3155. replaceE: 'css;#pageGroup',
  3156. scrollD: 1500
  3157. }
  3158. }, // 微当下载
  3159. weidown_search: {
  3160. pager: {
  3161. type: 1,
  3162. nextL: 'css;a.nextpage',
  3163. pageE: 'css;.articleListWrapper > .richTextItem.search',
  3164. insertP: ['css;#pageGroup', 1],
  3165. replaceE: 'css;#pageGroup',
  3166. scrollD: 700
  3167. }
  3168. }, // 微当下载 - 搜索页
  3169. weidown_special: {
  3170. pager: {
  3171. type: 1,
  3172. nextL: 'css;a.nextpage',
  3173. pageE: 'css;.special > .item, .articleWrapper > div',
  3174. insertP: ['css;.special, .articleWrapper', 3],
  3175. replaceE: 'css;#pageGroup',
  3176. scrollD: 700
  3177. }
  3178. }, // 微当下载 - 专题页
  3179. fsylr: {
  3180. host: 'fsylr.com',
  3181. functionStart: function() {if (location.pathname.indexOf('.html') === -1) {curSite = DBSite.fsylr;}},
  3182. pager: {
  3183. type: 1,
  3184. nextL: 'css;a.next.page-numbers',
  3185. pageE: 'css;.posts-con > div:not([class*="posts-"])',
  3186. insertP: ['css;.posts-con', 3],
  3187. replaceE: 'css;nav.pagination',
  3188. scrollD: 1000
  3189. }
  3190. }, // 发烧友绿软
  3191. iplaysoft: {
  3192. host: 'www.iplaysoft.com',
  3193. functionStart: function() {if (location.pathname.indexOf('.html') > -1 || location.pathname.indexOf('/p/') > -1) { // 文章内
  3194. curSite = DBSite.iplaysoft_comment;
  3195. } else { // 其他页面
  3196. curSite = DBSite.iplaysoft;
  3197. }},
  3198. pager: {
  3199. type: 1,
  3200. nextL: 'css;.pagenavi a[title="下一页"]',
  3201. pageE: 'css;#postlist > div.entry',
  3202. insertP: ['css;#postlist > .pagenavi-button', 1],
  3203. replaceE: 'css;.pagenavi-button, .pagenavi',
  3204. scrollD: 1200
  3205. },
  3206. function: {
  3207. bF: src_bF,
  3208. pF: [0, 'img[data-src]', 'data-src']
  3209. }
  3210. }, // 异次元软件
  3211. iplaysoft_comment: {
  3212. pager: {
  3213. type: 2,
  3214. nextL: 'css;#loadHistoryComments',
  3215. nextTextOf: '展开后面',
  3216. scrollD: 1200
  3217. }
  3218. }, // 异次元软件 - 评论
  3219. mpyit: {
  3220. host: 'www.mpyit.com',
  3221. functionStart: function() {if (location.pathname === '/' && !location.search) {
  3222. curSite = DBSite.mpyit;
  3223. } else if (location.pathname.indexOf('/category/') > -1 || location.search.indexOf('?s=') > -1) { // 搜索页 / 分类页
  3224. curSite = DBSite.mpyit_category;
  3225. }},
  3226. pager: {
  3227. type: 1,
  3228. nextL: 'css;a.page-numbers[title="下一页"]',
  3229. pageE: 'css;#post > div[id^="post-"]',
  3230. insertP: ['css;#post > #pagenavi', 1],
  3231. replaceE: 'css;#post > #pagenavi',
  3232. scrollD: 1700
  3233. }
  3234. }, // 老殁 | 殁漂遥
  3235. mpyit_category: {
  3236. pager: {
  3237. type: 1,
  3238. nextL: 'css;a.page-numbers[title="下一页"]',
  3239. pageE: 'css;#content > div[class^="entry_box"]',
  3240. insertP: ['css;#content > #pagenavi', 1],
  3241. replaceE: 'css;#content > #pagenavi',
  3242. scrollD: 1700
  3243. }
  3244. }, // 老殁 | 殁漂遥 - 搜索页/分类页
  3245. tenlonstudio: {
  3246. host: 'www.tenlonstudio.com',
  3247. functionStart: function() {if (location.pathname === '/' && !location.search) {
  3248. curSite = DBSite.tenlonstudio;
  3249. } else {
  3250. curSite = DBSite.tenlonstudio_list;
  3251. }},
  3252. pager: {
  3253. type: 2,
  3254. nextL: 'css;.load-more',
  3255. nextText: '加载更多',
  3256. interval: 500,
  3257. scrollD: 1000
  3258. }
  3259. }, // 腾龙工作室
  3260. tenlonstudio_list: {
  3261. pager: {
  3262. type: 1,
  3263. nextL: '//div[@class="btn-pager"]/a[contains(text(), "❯")]',
  3264. pageE: 'css;li.post-list-item',
  3265. insertP: ['css;li.post-list-item:last-child', 4],
  3266. replaceE: 'css;.ajax-pager',
  3267. scrollD: 1000
  3268. }
  3269. }, // 腾龙工作室 - 分类/搜索页
  3270. yxssp: {
  3271. host: 'www.yxssp.com',
  3272. pager: {
  3273. type: 1,
  3274. nextL: '//div[contains(@class, "page-nav")]/a[last()]',
  3275. pageE: 'css;.td-modules-container.td-module-number4 > div',
  3276. insertP: ['css;.td-modules-container.td-module-number4', 3],
  3277. replaceE: 'css;.page-nav.td-pb-padding-side',
  3278. scrollD: 1000
  3279. }
  3280. }, // 异星软件空间
  3281. yrxitong: {
  3282. host: 'www.yrxitong.com',
  3283. functionStart: function() {
  3284. if (location.pathname === '/sr.jsp') {
  3285. curSite = DBSite.yrxitong_search;
  3286. } else if (location.pathname.indexOf('/h-nd-') === -1) {
  3287. curSite = DBSite.yrxitong;
  3288. }
  3289. },
  3290. pager: {
  3291. type: 1,
  3292. nextL: 'css;span.pageNext > a',
  3293. pageE: 'css;#containerFormsCenter .m_news_list > div',
  3294. insertP: ['css;#containerFormsCenter .m_news_list', 3],
  3295. replaceE: 'css;.pagenation',
  3296. scrollD: 1200
  3297. },
  3298. function: {
  3299. bF: src_bF,
  3300. pF: [1, 'a[data-original]', 'data-original']
  3301. }
  3302. }, // 小鱼儿 yr 系统
  3303. yrxitong_search: {
  3304. pager: {
  3305. type: 1,
  3306. nextL: 'css;span.pageNext > a',
  3307. pageE: 'css;#containerFormsCenter .newsList > div',
  3308. insertP: ['css;#containerFormsCenter .newsList', 3],
  3309. replaceE: 'css;.pagenation',
  3310. scrollD: 2000
  3311. }
  3312. }, // 小鱼儿 yr 系统 - 搜索页
  3313. sordum: {
  3314. host: 'www.sordum.org',
  3315. pager: {
  3316. type: 1,
  3317. nextL: 'css;a.next.page-numbers',
  3318. pageE: 'css;.article > article',
  3319. insertP: ['css;nav.navigation.posts-navigation', 1],
  3320. replaceE: 'css;nav.navigation.posts-navigation',
  3321. scrollD: 1500
  3322. }
  3323. }, // (下面这几个都是国外博客网站)
  3324. winaero: {
  3325. host: 'winaero.com',
  3326. functionStart: function() {if (location.pathname === '/blog/' || location.pathname.indexOf('/category/') > -1) curSite = DBSite.winaero;},
  3327. pager: {
  3328. type: 1,
  3329. nextL: 'css;.nav-previous > a',
  3330. pageE: 'css;#content > article',
  3331. insertP: ['css;#nav-below', 1],
  3332. replaceE: 'css;#nav-below',
  3333. scrollD: 1500
  3334. }
  3335. },
  3336. lrepacks: {
  3337. host: 'lrepacks.net',
  3338. functionStart: function() {if (location.pathname.indexOf('.html') === -1) curSite = DBSite.lrepacks;},
  3339. pager: {
  3340. type: 1,
  3341. nextL: 'css;.page_next > a',
  3342. pageE: 'css;#main .post-list article',
  3343. insertP: ['css;.page_nav', 1],
  3344. replaceE: 'css;.page_nav',
  3345. scrollD: 1500
  3346. },
  3347. function: {
  3348. bF: lrepacks_bF
  3349. }
  3350. },
  3351. winhelponline: {
  3352. host: 'www.winhelponline.com',
  3353. functionStart: function() {if (location.pathname === '/blog/') {curSite = DBSite.winhelponline;}},
  3354. pager: {
  3355. type: 1,
  3356. nextL: 'css;span.prev > a',
  3357. pageE: 'css;#main > article',
  3358. insertP: ['css;nav.paging-navigation', 1],
  3359. replaceE: 'css;nav.paging-navigation',
  3360. scrollD: 2000
  3361. }
  3362. },
  3363. windowslatest: {
  3364. host: 'www.windowslatest.com',
  3365. pager: {
  3366. type: 1,
  3367. nextL: '//div[contains(@class, "page-nav")]/a[last()]',
  3368. pageE: 'css;.td-ss-main-content > div:not(.td-block-title-wrap):not(.page-nav)',
  3369. insertP: ['css;.page-nav', 1],
  3370. replaceE: 'css;.page-nav',
  3371. scrollD: 2000
  3372. }
  3373. },
  3374. thewindowsclub: {
  3375. host: 'www.thewindowsclub.com',
  3376. functionStart: function() {curSite = DBSite.thewindowsclub; if (location.pathname === '/') {curSite.pager.scrollD = 2000;}},
  3377. pager: {
  3378. type: 1,
  3379. nextL: 'css;li.pagination-next > a',
  3380. pageE: 'css;#genesis-content > article',
  3381. insertP: ['css;.pagination', 1],
  3382. replaceE: 'css;.pagination',
  3383. scrollD: 1500
  3384. }
  3385. },
  3386. gitee: {
  3387. host: 'search.gitee.com',
  3388. functionStart: function() {if (location.search) curSite = DBSite.gitee;},
  3389. pager: {
  3390. type: 1,
  3391. nextL: 'css;li.next:not(.disabled) > a',
  3392. pageE: 'css;#hits-list > div',
  3393. insertP: ['css;#hits-list', 3],
  3394. replaceE: 'css;ul.pagination',
  3395. scrollD: 1000
  3396. }
  3397. }, // Gitee - 搜索页
  3398. github_star: {
  3399. host: 'github.com',
  3400. functionStart: function() {locationChange = true;
  3401. if (location.search.indexOf('tab=stars') > -1) {
  3402. curSite = DBSite.github_star;
  3403. } else if ((location.pathname.indexOf('/issues') > -1 && location.pathname.indexOf('/issues/') === -1) || (location.pathname.indexOf('/pulls') > -1 && location.pathname.indexOf('/pulls/') === -1)) {
  3404. curSite = DBSite.github_issues;
  3405. } else if (location.pathname.indexOf('/discussions') > -1 && !(/\/discussions\/\d+/.test(location.pathname)) && location.pathname.indexOf('new') === -1) {
  3406. curSite = DBSite.github_discussions;
  3407. } else if (location.pathname.indexOf('/releases') > -1 && location.pathname.indexOf('/releases/tag/') === -1 && location.pathname.indexOf('edit') === -1) {
  3408. curSite = DBSite.github_releases;
  3409. } else if (location.pathname.indexOf('/tags') > -1 && location.pathname.indexOf('/tags/') === -1) {
  3410. curSite = DBSite.github_tags;
  3411. } else if (location.pathname.indexOf('/commits') > -1) {
  3412. curSite = DBSite.github_commits;
  3413. } else if (location.pathname.indexOf('/notifications') > -1) {
  3414. curSite = DBSite.github_notifications;
  3415. } else if (location.pathname.indexOf('/search') > -1) {
  3416. if (!location.search) return
  3417. if (location.search.indexOf('type=Repositories') > -1 || location.search.indexOf('type=') === -1) {
  3418. curSite = DBSite.github_search;
  3419. } else if (location.search.indexOf('type=code') > -1) {
  3420. curSite = DBSite.github_search_code;
  3421. } else if (location.search.indexOf('type=commits') > -1) {
  3422. curSite = DBSite.github_search_commit;
  3423. } else if (location.search.indexOf('type=issues') > -1 || location.search.indexOf('type=discussions') > -1) {
  3424. curSite = DBSite.github_search_issue;
  3425. } else if (location.search.indexOf('type=registrypackages') > -1) {
  3426. curSite = DBSite.github_search_package;
  3427. } else if (location.search.indexOf('type=marketplace') > -1) {
  3428. curSite = DBSite.github_search_marketplace;
  3429. } else if (location.search.indexOf('type=topics') > -1) {
  3430. curSite = DBSite.github_search_topics;
  3431. } else if (location.search.indexOf('type=wikis') > -1) {
  3432. curSite = DBSite.github_search_wiki;
  3433. } else if (location.search.indexOf('type=users') > -1) {
  3434. curSite = DBSite.github_search_user;
  3435. }
  3436. }},
  3437. pager: {
  3438. type: 1,
  3439. nextL: '//div[@class="paginate-container"]//a[contains(text(), "Next")]',
  3440. pageE: 'css;#js-pjax-container .position-relative div[class^="col-lg-"] > div:not(.position-relative):not(.paginate-container)',
  3441. insertP: ['css;.paginate-container', 1],
  3442. replaceE: 'css;.paginate-container',
  3443. scrollD: 3000
  3444. }
  3445. }, // Github - 用户 Star 列表
  3446. github_issues: {
  3447. pager: {
  3448. type: 1,
  3449. nextL: 'css;a.next_page',
  3450. pageE: 'css;.js-navigation-container.js-active-navigation-container > div[id^="issue_"]',
  3451. insertP: ['css;.js-navigation-container.js-active-navigation-container', 3],
  3452. replaceE: 'css;.pagination',
  3453. scrollD: 3000
  3454. }
  3455. }, // Github - Issues 列表 / PR 列表
  3456. github_discussions: {
  3457. pager: {
  3458. type: 1,
  3459. nextL: 'css;a.next_page',
  3460. pageE: 'css;#repo-content-pjax-container div[data-discussion-hovercards-enabled] > div',
  3461. insertP: ['css;#repo-content-pjax-container div[data-discussion-hovercards-enabled]', 3],
  3462. replaceE: 'css;.pagination',
  3463. scrollD: 3000
  3464. }
  3465. }, // Github - Discussions 列表
  3466. github_releases: {
  3467. pager: {
  3468. type: 1,
  3469. nextL: 'css;a.next_page',
  3470. pageE: 'css;#repo-content-pjax-container > div[data-pjax] > div:not(.paginate-container)',
  3471. insertP: ['//div[contains(@class, "paginate-container")][1]', 1],
  3472. replaceE: 'css;.pagination',
  3473. scrollD: 3000
  3474. }
  3475. }, // Github - Releases 列表
  3476. github_tags: {
  3477. pager: {
  3478. type: 1,
  3479. nextL: '//div[@class="pagination"]/a[contains(text(), "Next")]',
  3480. pageE: 'css;.Box-body > div.Box-row',
  3481. insertP: ['css;.Box-body', 3],
  3482. replaceE: 'css;.pagination',
  3483. scrollD: 3000
  3484. }
  3485. }, // Github - Tags 列表
  3486. github_commits: {
  3487. pager: {
  3488. type: 1,
  3489. nextL: '//div[@class="paginate-container"]//a[contains(text(), "Older")]',
  3490. pageE: 'css;div.js-navigation-container > div',
  3491. insertP: ['css;div.js-navigation-container', 3],
  3492. replaceE: 'css;.paginate-container',
  3493. scrollD: 3000
  3494. }
  3495. }, // Github - Commits 列表
  3496. github_notifications: {
  3497. pager: {
  3498. type: 1,
  3499. nextL: 'css;nav.paginate-container > a[aria-label="Next"]',
  3500. pageE: 'css;li.notifications-list-item',
  3501. insertP: ['css;li.notifications-list-item:last-child', 4],
  3502. replaceE: 'css;nav.paginate-container, .js-notifications-list-paginator-counts',
  3503. scrollD: 3000
  3504. }
  3505. }, // Github - Notifications 列表
  3506. github_search: {
  3507. pager: {
  3508. type: 1,
  3509. nextL: 'css;a.next_page',
  3510. pageE: 'css;ul.repo-list > li',
  3511. insertP: ['css;ul.repo-list', 3],
  3512. replaceE: 'css;.pagination',
  3513. scrollD: 1500
  3514. }
  3515. }, // Github - Search 列表
  3516. github_search_code: {
  3517. pager: {
  3518. type: 1,
  3519. nextL: 'css;a.next_page',
  3520. pageE: 'css;.code-list > div',
  3521. insertP: ['css;.code-list', 3],
  3522. replaceE: 'css;.pagination',
  3523. scrollD: 1500
  3524. }
  3525. }, // Github - Search 列表 - Code
  3526. github_search_commit: {
  3527. pager: {
  3528. type: 1,
  3529. nextL: 'css;a.next_page',
  3530. pageE: 'css;#commit_search_results > div',
  3531. insertP: ['css;#commit_search_results', 3],
  3532. replaceE: 'css;.pagination',
  3533. scrollD: 1500
  3534. }
  3535. }, // Github - Search 列表 - Commit
  3536. github_search_issue: {
  3537. pager: {
  3538. type: 1,
  3539. nextL: 'css;a.next_page',
  3540. pageE: 'css;.issue-list > div > div',
  3541. insertP: ['css;.issue-list > div', 3],
  3542. replaceE: 'css;.pagination',
  3543. scrollD: 1500
  3544. }
  3545. }, // Github - Search 列表 - Issues/Discussions
  3546. github_search_package: {
  3547. pager: {
  3548. type: 1,
  3549. nextL: 'css;a.next_page',
  3550. pageE: 'css;#package_search_results > div',
  3551. insertP: ['css;#package_search_results', 3],
  3552. replaceE: 'css;.pagination',
  3553. scrollD: 1500
  3554. }
  3555. }, // Github - Search 列表 - Package
  3556. github_search_marketplace: {
  3557. pager: {
  3558. type: 1,
  3559. nextL: 'css;a.next_page',
  3560. pageE: 'css;.issue-list > div',
  3561. insertP: ['css;.issue-list', 3],
  3562. replaceE: 'css;.pagination',
  3563. scrollD: 1500
  3564. }
  3565. }, // Github - Search 列表 - Marketplace
  3566. github_search_topics: {
  3567. pager: {
  3568. type: 1,
  3569. nextL: 'css;a.next_page',
  3570. pageE: 'css;.topic-list > div',
  3571. insertP: ['css;.topic-list', 3],
  3572. replaceE: 'css;.pagination',
  3573. scrollD: 1500
  3574. }
  3575. }, // Github - Search 列表 - Topics
  3576. github_search_wiki: {
  3577. pager: {
  3578. type: 1,
  3579. nextL: 'css;a.next_page',
  3580. pageE: 'css;#wiki_search_results > div:first-child > div',
  3581. insertP: ['css;#wiki_search_results > div:first-child', 3],
  3582. replaceE: 'css;.pagination',
  3583. scrollD: 1500
  3584. }
  3585. }, // Github - Search 列表 - wiki
  3586. github_search_user: {
  3587. pager: {
  3588. type: 1,
  3589. nextL: 'css;a.next_page',
  3590. pageE: 'css;#user_search_results > div:first-child > div',
  3591. insertP: ['css;#user_search_results > div:first-child', 3],
  3592. replaceE: 'css;.pagination',
  3593. scrollD: 1500
  3594. }
  3595. }, // Github - Search 列表 - user
  3596. stackoverflow: {
  3597. host: 'stackoverflow.com',
  3598. functionStart: function() {if (location.pathname.indexOf('/questions') > -1) {
  3599. curSite = DBSite.stackoverflow;
  3600. } else if (location.pathname === '/search') {
  3601. curSite = DBSite.stackoverflow_search;
  3602. } else if (location.pathname === '/tags') {
  3603. curSite = DBSite.stackoverflow_tags;
  3604. } else if (location.pathname === '/users') {
  3605. curSite = DBSite.stackoverflow_users;
  3606. }},
  3607. pager: {
  3608. type: 1,
  3609. nextL: 'css;a[rel="next"]',
  3610. pageE: 'css;#questions > div',
  3611. insertP: ['css;#questions', 3],
  3612. replaceE: 'css;.pager',
  3613. scrollD: 1500
  3614. }
  3615. }, // StackOverflow - Questions
  3616. stackoverflow_tags: {
  3617. pager: {
  3618. type: 1,
  3619. nextL: 'css;a[rel="next"]',
  3620. pageE: 'css;#tags-browser > div',
  3621. insertP: ['css;#tags-browser', 3],
  3622. replaceE: 'css;.pager',
  3623. scrollD: 1500
  3624. }
  3625. }, // StackOverflow - Tags
  3626. stackoverflow_users: {
  3627. pager: {
  3628. type: 1,
  3629. nextL: 'css;a[rel="next"]',
  3630. pageE: 'css;#user-browser > div:first-child > div',
  3631. insertP: ['css;#user-browser > div:first-child', 3],
  3632. replaceE: 'css;.pager',
  3633. scrollD: 1500
  3634. }
  3635. }, // StackOverflow - Users
  3636. stackoverflow_search: {
  3637. pager: {
  3638. type: 1,
  3639. nextL: 'css;a[rel="next"]',
  3640. pageE: 'css;.js-search-results > div:first-child > div',
  3641. insertP: ['css;.js-search-results > div:first-child', 3],
  3642. replaceE: 'css;.pager',
  3643. scrollD: 1500
  3644. }
  3645. }, // StackOverflow - Search
  3646. segmentfault: {
  3647. host: 'segmentfault.com',
  3648. functionStart: function() {locationChange = true;
  3649. if (location.pathname.indexOf('/questions') > -1) {
  3650. curSite = DBSite.segmentfault;
  3651. } else if (location.pathname === '/search') {
  3652. curSite = DBSite.segmentfault_search;
  3653. }},
  3654. pager: {
  3655. type: 1,
  3656. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  3657. pageE: 'css;ul.list-group > li',
  3658. insertP: ['css;ul.list-group', 3],
  3659. replaceE: 'css;ul.pagination',
  3660. scrollD: 1000
  3661. }
  3662. }, // SegmentFault - Questions
  3663. segmentfault_search: {
  3664. pager: {
  3665. type: 1,
  3666. nextL: 'css;a[rel="next"]',
  3667. pageE: 'css;.search-result > section',
  3668. insertP: ['css;.search-result > div:last-child', 1],
  3669. replaceE: 'css;ul.pagination',
  3670. scrollD: 1000
  3671. }
  3672. }, // SegmentFault - Search
  3673. w3school_cn: {
  3674. host: 'www.w3school.com.cn',
  3675. functionStart: function() {if (location.pathname.split('/').length > 2) {curSite = DBSite.w3school_cn;}},
  3676. insStyle: '#maincontent h1:not(:nth-of-type(1)) {margin-top: 30px;}',
  3677. pager: {
  3678. type: 3,
  3679. nextL: function() { // 过滤部分非本页的参考手册
  3680. let next = document.querySelector('li.next > a[href]')
  3681. if (next && next.href.indexOf('/index.') === -1) return next.href;
  3682. curSite = {SiteTypeID: 0}; return ''
  3683. },
  3684. pageE: 'css;#maincontent > *:not(.prenextnav):not(#bpn):not(#tpn)',
  3685. insertP: ['id("bpn") | //div[@class="prenextnav"][last()]', 1],
  3686. replaceE: 'css;ul.prenext, #navsecond, title',
  3687. scrollE: 'id("bpn") | //div[@class="prenextnav"][last()]',
  3688. history: true,
  3689. forceHTTPS: true,
  3690. scrollD: 500
  3691. }
  3692. }, // W3school
  3693. runoob: {
  3694. host: 'www.runoob.com',
  3695. functionStart: function() {if (location.pathname.split('/').length > 2 && document.getElementById('leftcolumn')) {curSite = DBSite.runoob;}},
  3696. insStyle: '#comments, #postcomments, #respond, #footer {display: none !important;} .article-intro h1:not(:nth-of-type(1)) {margin: 30px 0 10px 0;}',
  3697. pager: {
  3698. type: 1,
  3699. nextL: function() { // 过滤部分非本页的参考手册
  3700. let next = document.querySelector('#leftcolumn > a[style]~a[href]')
  3701. if (next && next.href.split('/').length === location.href.split('/').length && next.href.split('/')[3] === location.href.split('/')[3]) return next.href;
  3702. next.href = location.href; curSite = {SiteTypeID: 0}; return ''
  3703. },
  3704. pageE: 'css;#content > *',
  3705. insertP: ['css;#content', 3],
  3706. replaceE: 'css;.previous-next-links, #leftcolumn, head > title',
  3707. history: true,
  3708. forceHTTPS: true,
  3709. scrollD: 1000
  3710. },
  3711. function: {
  3712. aF: function() { // 左侧栏高亮当前页面标题
  3713. let title = document.title.split(' | '); if (title.length > 1) {title = title[0]; document.querySelectorAll('#leftcolumn > a').forEach(function(e){if (e.innerText === title) {e.style = 'background-color: rgb(150, 185, 125); font-weight: bold; color: rgb(255, 255, 255);';}})}
  3714. }
  3715. }
  3716. }, // 菜鸟教程
  3717. cnblogs: {
  3718. host: ['www.cnblogs.com', 'zzk.cnblogs.com'],
  3719. functionStart: function() {
  3720. if (location.host === 'zzk.cnblogs.com') {
  3721. curSite = DBSite.cnblogs_search;
  3722. } else if (document.getElementById('post_list')) {
  3723. curSite = DBSite.cnblogs_list;
  3724. } else if (location.pathname.split('/').length === 3 && document.querySelector('.topicListFooter')) {
  3725. curSite = DBSite.cnblogs;
  3726. if (!document.getElementById('homepage_top_pager')) {
  3727. document.querySelector('.forFlow').insertAdjacentHTML(getAddTo(2), '<div id="homepage_top_pager" class="topicListFooter"></div>');
  3728. document.querySelector('.forFlow').insertAdjacentHTML(getAddTo(3), '<div id="homepage_bottom_pager" class="topicListFooter"></div>');
  3729. }
  3730. }
  3731. },
  3732. pager: {
  3733. type: 1,
  3734. nextL: '//div[@class="topicListFooter"]//a[contains(text(), "下一页")]',
  3735. pageE: 'css;div.day',
  3736. insertP: ['css;.topicListFooter:not([id])', 1],
  3737. replaceE: 'css;.topicListFooter',
  3738. scrollD: 1000
  3739. }
  3740. }, // 博客园 - 文章列表(个人)
  3741. cnblogs_list: {
  3742. pager: {
  3743. type: 1,
  3744. nextL: '//div[@class="pager"]//a[contains(text(), ">")]',
  3745. pageE: 'css;#post_list > article',
  3746. insertP: ['css;#post_list', 3],
  3747. replaceE: 'css;.pager',
  3748. scrollD: 1000
  3749. }
  3750. }, // 博客园 - 文章列表
  3751. cnblogs_search: {
  3752. pager: {
  3753. type: 1,
  3754. nextL: '//div[@class="pager"]//a[contains(text(), ">")]',
  3755. pageE: 'css;div.searchItem',
  3756. insertP: ['css;#paging_block', 1],
  3757. replaceE: 'css;.pager',
  3758. scrollD: 1000
  3759. }
  3760. }, // 博客园 - 搜索页
  3761. zhutix: {
  3762. host: 'zhutix.com',
  3763. functionStart: function() {if (document.getElementById('post-list')) {
  3764. curSite = DBSite.zhutix;
  3765. } else {
  3766. curSite = DBSite.zhutix_list;
  3767. }},
  3768. pager: {
  3769. type: 1,
  3770. nextL: '//li[@class="next-page"]/a | //div[@class="btn-pager"]/a[contains(text(), "❯")]',
  3771. pageE: 'css;#post-list > ul > li',
  3772. insertP: ['css;#post-list > ul', 3],
  3773. replaceE: 'css;.pagination, .b2-pagenav.post-nav',
  3774. scrollD: 1500
  3775. }
  3776. }, // 致美化
  3777. zhutix_list: {
  3778. pager: {
  3779. type: 1,
  3780. nextL: 'css;li.next-page a',
  3781. pageE: 'css;#primary-home > div:not(.pagination)',
  3782. insertP: ['css;.pagination', 1],
  3783. replaceE: 'css;.pagination',
  3784. scrollD: 1500
  3785. }
  3786. }, // 致美化 - 文章列表
  3787. lanzou: {
  3788. host: /\.lanzou[a-z]/,
  3789. hiddenPN: true,
  3790. pager: {
  3791. type: 2,
  3792. nextL: 'css;#filemore',
  3793. nextTextOf: '更多',
  3794. isHidden: true,
  3795. scrollD: 800
  3796. }
  3797. }, // 蓝奏云 - 分享链接列表
  3798. lanzou_: {
  3799. host: 'pc.woozooo.com',
  3800. iframe: true,
  3801. hiddenPN: true,
  3802. pager: {
  3803. type: 2,
  3804. nextL: 'css;#filemore > span[onclick]',
  3805. nextText: '显示更多文件',
  3806. isHidden: true,
  3807. scrollD: 800
  3808. }
  3809. }, // 蓝奏云 - 后台
  3810. libgen: {
  3811. host: /libgen/,
  3812. functionStart: function() {if (location.pathname === '/search.php') {curSite = DBSite.libgen;}},
  3813. pager: {
  3814. type: 1,
  3815. nextL: '//font/a[contains(text(), "►")]',
  3816. pageE: 'css;table[rules="rows"] > tbody > tr:nth-of-type(n+2), .paginator+script:not([src])',
  3817. insertP: ['css;table[rules="rows"] > tbody', 3],
  3818. replaceE: '//td[./font/a[contains(text(), "►")]]',
  3819. scriptT: 2,
  3820. history: true,
  3821. scrollD: 2000
  3822. }
  3823. }, // 学术
  3824. pubmed: {
  3825. host: 'pubmed.ncbi.nlm.nih.gov',
  3826. pager: {
  3827. type: 2,
  3828. nextL: 'css;button.load-button.next-page',
  3829. nextText: 'Show more',
  3830. scrollD: 1500
  3831. }
  3832. }, // 学术
  3833. acs: {
  3834. host: ['pubs.acs.org','onlinelibrary.wiley.com'],
  3835. functionStart: function() {if (location.pathname.indexOf('/doSearch') > -1) {curSite = DBSite.acs;}},
  3836. pager: {
  3837. type: 1,
  3838. nextL: 'css;a.pagination__btn--next',
  3839. pageE: 'css;ul.items-results > *',
  3840. insertP: ['css;ul.items-results', 3],
  3841. replaceE: 'css;.pagination',
  3842. history: true,
  3843. scrollD: 3000
  3844. }
  3845. }, // 学术
  3846. x_mol: {
  3847. host: 'www.x-mol.com',
  3848. functionStart: function() {if (location.pathname.indexOf('/search/q') > -1) {curSite = DBSite.x_mol;}},
  3849. pager: {
  3850. type: 1,
  3851. nextL: x_mol_mod_nextL,
  3852. pageE: 'css;.magazine-senior-search-results-list > ul > li',
  3853. insertP: ['css;.magazine-senior-search-results-list > ul', 3],
  3854. replaceE: 'css;.pagination',
  3855. history: true,
  3856. scrollD: 2000
  3857. }
  3858. }, // 学术
  3859. google_scholar: {
  3860. pager: {
  3861. type: 1,
  3862. nextL: '//a[./span[contains(@class, "next")]]',
  3863. pageE: 'css;#gs_res_ccl_mid > *',
  3864. insertP: ['css;#gs_res_ccl_mid', 3],
  3865. replaceE: 'id("gs_n")',
  3866. scriptT: 1,
  3867. scrollD: 2000
  3868. }
  3869. }, // 谷歌学术
  3870. bing_academic: {
  3871. insStyle: 'li.aca_algo_count {display: none !important;}',
  3872. pager: {
  3873. type: 1,
  3874. nextL: 'css;a.sb_pagN',
  3875. pageE: 'css;#b_results > li.aca_algo',
  3876. insertP: ['css;#b_results .b_pag', 1],
  3877. replaceE: 'css;#b_results .b_pag',
  3878. scrollD: 1000
  3879. }
  3880. }, // 必应学术
  3881. baidu_xueshu: {
  3882. host: 'xueshu.baidu.com',
  3883. functionStart: function() {if (location.pathname === '/s') {
  3884. curSite = DBSite.baidu_xueshu;
  3885. } else if (location.pathname.indexOf('journal/navigation') > -1) {
  3886. curSite = DBSite.baidu_xueshu_journal;
  3887. } else if (location.pathname.indexOf('paper/show') > -1) {
  3888. curSite = DBSite.baidu_xueshu_paper;
  3889. }},
  3890. pager: {
  3891. type: 1,
  3892. nextL: 'id("page")/a[./i[@class="c-icon-pager-next"]]',
  3893. pageE: 'css;#bdxs_result_lists > div.result',
  3894. insertP: ['css;#bdxs_result_lists', 3],
  3895. replaceE: 'css;#page',
  3896. history: true,
  3897. scrollD: 1000
  3898. }
  3899. }, // 百度学术
  3900. baidu_xueshu_journal: {
  3901. pager: {
  3902. type: 1,
  3903. nextL: 'css;a.res-page-next',
  3904. pageE: 'css;#journaldetail > div',
  3905. insertP: ['css;#journaldetail', 3],
  3906. replaceE: 'css;.res-page',
  3907. history: true,
  3908. scrollD: 1000
  3909. }
  3910. }, // 百度学术
  3911. baidu_xueshu_paper: {
  3912. pager: {
  3913. type: 2,
  3914. nextL: 'css;div:not([style*="display: none"]) > .more_btn',
  3915. nextText: '加载更多',
  3916. scrollD: 1000
  3917. }
  3918. }, // 百度学术
  3919. so_xueshu: {
  3920. host: 'xueshu.so.com',
  3921. functionStart: function() {if (location.pathname === '/s') {curSite = DBSite.so_xueshu;}},
  3922. pager: {
  3923. type: 1,
  3924. nextL: 'css;a#snext',
  3925. pageE: 'css;ul.list > li',
  3926. insertP: ['css;ul.list', 3],
  3927. replaceE: 'css;#page',
  3928. scrollD: 1000
  3929. }
  3930. }, // 360 学术
  3931. cadtutor: {
  3932. host: 'www.cadtutor.net',
  3933. functionStart: function() {
  3934. if (location.pathname.indexOf('/forum/forum/') > -1) {
  3935. curSite = DBSite.cadtutor;
  3936. } else if (location.pathname.indexOf('/forum/topic/') > -1 && GM_getValue('menu_discuz_thread_page')) {
  3937. curSite = DBSite.cadtutor_post;
  3938. } else if (location.pathname.indexOf('/forum/search/') > -1) {
  3939. curSite = DBSite.cadtutor_search;
  3940. }},
  3941. pager: {
  3942. type: 1,
  3943. nextL: 'css;a[rel="next"]',
  3944. pageE: 'css;ol.ipsDataList > li:not([data-rowid])~li',
  3945. insertP: ['css;ol.ipsDataList', 3],
  3946. replaceE: 'css;ul.ipsPagination',
  3947. scrollD: 2000
  3948. }
  3949. }, // CADTutor - 列表页
  3950. cadtutor_post: {
  3951. pager: {
  3952. type: 1,
  3953. nextL: 'css;a[rel="next"]',
  3954. pageE: 'css;#elPostFeed > form > *:not(input):not(.after-first-post)',
  3955. insertP: ['css;#elPostFeed > form', 3],
  3956. replaceE: 'css;ul.ipsPagination',
  3957. scrollD: 2000
  3958. }
  3959. }, // CADTutor - 帖子内
  3960. cadtutor_search: {
  3961. pager: {
  3962. type: 1,
  3963. nextL: 'css;a[rel="next"]',
  3964. pageE: 'css;ol.ipsStream > li',
  3965. insertP: ['css;ol.ipsStream', 3],
  3966. replaceE: 'css;ul.ipsPagination',
  3967. scrollD: 2000
  3968. }
  3969. }, // CADTutor - 搜索页
  3970. theswamp: {
  3971. host: 'www.theswamp.org',
  3972. functionStart: function() {
  3973. if (!location.search) return
  3974. if (location.search.indexOf('board=') > -1) {
  3975. curSite = DBSite.theswamp;
  3976. } else if (location.search.indexOf('topic=') > -1 && GM_getValue('menu_discuz_thread_page')) {
  3977. curSite = DBSite.theswamp_post;
  3978. }},
  3979. pager: {
  3980. type: 1,
  3981. nextL: 'css;.pagelinks > strong+a',
  3982. pageE: 'css;#messageindex tbody > tr:not([class])',
  3983. insertP: ['css;#messageindex tbody', 3],
  3984. replaceE: 'css;.pagelinks',
  3985. scrollD: 2000
  3986. }
  3987. }, // TheSwamp - 列表页
  3988. theswamp_post: {
  3989. pager: {
  3990. type: 1,
  3991. nextL: 'css;.pagelinks > strong+a',
  3992. pageE: 'css;#forumposts form > *',
  3993. insertP: ['css;#forumposts form', 3],
  3994. replaceE: 'css;.pagelinks',
  3995. scrollD: 2000
  3996. }
  3997. }, // TheSwamp - 帖子内
  3998. wikihow: {
  3999. host: ['www.wikihow.com', 'zh.wikihow.com'],
  4000. functionStart: function() {if (location.pathname.indexOf('/Category:') > -1) {
  4001. curSite = DBSite.wikihow;
  4002. } else if (location.pathname.indexOf('/wikiHowTo') > -1 && location.search.indexOf('?search=') > -1) {
  4003. curSite = DBSite.wikihow_search;
  4004. }},
  4005. pager: {
  4006. type: 1,
  4007. nextL: 'css;a.pag_next',
  4008. pageE: 'css;#cat_all > .cat_grid > div',
  4009. insertP: ['css;#cat_all > .cat_grid', 3],
  4010. replaceE: 'css;#large_pagination',
  4011. scriptT: 4,
  4012. scrollD: 2000
  4013. }
  4014. }, // 指南
  4015. wikihow_search: {
  4016. pager: {
  4017. type: 1,
  4018. nextL: 'css;#searchresults_footer > a.buttonright',
  4019. pageE: 'css;#searchresults_list > a',
  4020. insertP: ['css;#searchresults_list', 3],
  4021. replaceE: 'css;#searchresults_footer',
  4022. scrollD: 3000
  4023. }
  4024. }, // 指南 - 搜索页
  4025. oi_wiki: {
  4026. host: 'oi-wiki.org',
  4027. insStyle: 'blockquote.page-copyright, h2#__comments, form#gitalk-form {display: none !important;} article.md-content__inner{min-height: 700px;}',
  4028. pager: {
  4029. type: 1,
  4030. nextL: 'css;li.md-nav__item.md-nav__item--active.md-nav__item--nested li.md-nav__item--active+li a',
  4031. pageE: 'css;article.md-content__inner',
  4032. insertP: ['css;article.md-content__inner', 5],
  4033. replaceE: 'css;.md-sidebar.md-sidebar--primary',
  4034. history: true,
  4035. scrollD: 1300
  4036. }
  4037. }, // 编程竞赛
  4038. afreecatv: {
  4039. host: 'www.afreecatv.com',
  4040. pager: {
  4041. type: 2,
  4042. nextL: 'css;.btn-more > button',
  4043. interval: 2000,
  4044. scrollD: 1000
  4045. }
  4046. }, // 直播
  4047. greasyfork: {
  4048. host: 'greasyfork.org',
  4049. functionStart: function() {if (/\/scripts$/.test(location.pathname) || location.pathname.indexOf('/scripts/by-site/') > -1) {
  4050. curSite = DBSite.greasyfork;
  4051. } else if (/\/feedback$/.test(location.pathname)) {
  4052. curSite = DBSite.greasyfork_feedback;
  4053. } else if (location.pathname.indexOf('/discussions') > -1 && !(/\/\d+/.test(location.pathname))) {
  4054. curSite = DBSite.greasyfork_discussions;
  4055. }},
  4056. pager: {
  4057. type: 1,
  4058. nextL: 'css;a.next_page',
  4059. pageE: 'css;ol#browse-script-list > li',
  4060. insertP: ['css;ol#browse-script-list', 3],
  4061. replaceE: 'css;.pagination',
  4062. scrollD: 1300
  4063. }
  4064. }, // 脚本
  4065. greasyfork_feedback: {
  4066. pager: {
  4067. type: 1,
  4068. nextL: 'css;a.next_page',
  4069. pageE: 'css;.script-discussion-list > div',
  4070. insertP: ['css;.script-discussion-list', 3],
  4071. replaceE: 'css;.pagination',
  4072. scrollD: 1800
  4073. }
  4074. }, // 脚本 - 反馈页
  4075. greasyfork_discussions: {
  4076. pager: {
  4077. type: 1,
  4078. nextL: 'css;a.next_page',
  4079. pageE: 'css;.discussion-list > div',
  4080. insertP: ['css;.discussion-list', 3],
  4081. replaceE: 'css;.pagination',
  4082. scrollD: 1300
  4083. }
  4084. }, // 脚本 - 讨论页
  4085. smzdm: {
  4086. host: ['www.smzdm.com', 'search.smzdm.com'],
  4087. functionStart: function() {if (location.host === 'search.smzdm.com' || location.pathname.indexOf('/fenlei/') > -1) {
  4088. curSite = DBSite.smzdm;
  4089. }},
  4090. pager: {
  4091. type: 1,
  4092. nextL: '//ul[@class="pagenation-list"]//a[contains(text() ,"下一页")] | //ul[@class="pagenation-list"]/li[contains(@class, "next-page")]/a',
  4093. pageE: 'css;#feed-main-list > li',
  4094. insertP: ['css;#feed-main-list', 3],
  4095. replaceE: 'css;ul.pagenation-list',
  4096. scrollD: 1500
  4097. }
  4098. }, // 什么值得买 - 分类/搜索页
  4099. ruyile_xuexiao: {
  4100. host: 'www.ruyile.com',
  4101. functionStart: function() {
  4102. if (location.pathname === '/xuexiao/') {
  4103. curSite = DBSite.ruyile_xuexiao;
  4104. } else if (location.pathname === '/data/') {
  4105. curSite = DBSite.ruyile_data;
  4106. } else if (location.pathname === '/shijuan/') {
  4107. curSite = DBSite.ruyile_shijuan;
  4108. }},
  4109. pager: {
  4110. type: 1,
  4111. nextL: '//div[@class="fy"]/a[contains(text(), "下一页")]',
  4112. pageE: 'css;.xxlb > .sk',
  4113. insertP: ['css;.xxlb', 3],
  4114. replaceE: 'css;.fy',
  4115. scrollD: 1000
  4116. }
  4117. }, // 如意了教育 - 学校
  4118. ruyile_data: {
  4119. pager: {
  4120. type: 1,
  4121. nextL: '//div[@class="fy"]/a[contains(text(), "下一页")]',
  4122. pageE: 'css;.m1_z > .lbk',
  4123. insertP: ['css;.page', 1],
  4124. replaceE: 'css;.fy',
  4125. scrollD: 1000
  4126. }
  4127. }, // 如意了教育 - 数据
  4128. ruyile_shijuan: {
  4129. pager: {
  4130. type: 1,
  4131. nextL: '//div[@class="fy"]/a[contains(text(), "下一页")]',
  4132. pageE: 'css;.m1_z > .m2_lb',
  4133. insertP: ['css;.page', 1],
  4134. replaceE: 'css;.fy',
  4135. scrollD: 1000
  4136. }
  4137. }, // 如意了教育 - 试卷
  4138. netbian: {
  4139. host: 'pic.netbian.com',
  4140. insStyle: 'li.nextpage {display: none !important;}',
  4141. pager: {
  4142. type: 1,
  4143. nextL: '//div[@class="page"]/a[contains(text(),"下一页")]',
  4144. pageE: 'css;.slist ul > li:not(.nextpage)',
  4145. insertP: ['css;.slist ul', 3],
  4146. replaceE: 'css;.page',
  4147. scrollD: 1000
  4148. }
  4149. }, // 彼岸图网
  4150. ioliu: {
  4151. host: 'bing.ioliu.cn',
  4152. functionStart: function() {if (location.pathname.indexOf('/photo/') === -1 && location.pathname.indexOf('.html') === -1) {curSite = DBSite.ioliu; document.head.appendChild(document.createElement('base')).target = '_blank';}},
  4153. insStyle: '.progressive--not-loaded {filter: none !important;}',
  4154. pager: {
  4155. type: 1,
  4156. nextL: '//div[@class="page"]/a[contains(text(), "下一页")]',
  4157. pageE: 'css;body > .container > div.item',
  4158. insertP: ['css;body > .container', 3],
  4159. replaceE: 'css;.page',
  4160. scrollD: 1000
  4161. }
  4162. }, // 必应壁纸
  4163. nastol: {
  4164. host: 'www.nastol.com.ua',
  4165. pager: {
  4166. type: 1,
  4167. nextL: '//a[./span[@class="nav-next"]]',
  4168. pageE: 'css;#dle-content > div',
  4169. insertP: ['css;#dle-content > noindex', 1],
  4170. replaceE: 'css;.navigation',
  4171. scrollD: 1000
  4172. }
  4173. }, // 壁纸
  4174. hdqwalls: {
  4175. host: 'hdqwalls.com',
  4176. pager: {
  4177. type: 1,
  4178. nextL: 'css;a#next',
  4179. pageE: 'css;.wallpapers_container > div.wall-resp',
  4180. insertP: ['css;div.pagination_container, .wallpapers_container > div.wall-resp+div:not(.wall-resp)', 1],
  4181. replaceE: 'css;ul.pagination',
  4182. scrollD: 1000
  4183. }
  4184. }, // 壁纸
  4185. xinpianchang: {
  4186. host: 'www.xinpianchang.com',
  4187. insStyle: '.lazy-img {opacity: 1 !important;}',
  4188. pager: {
  4189. type: 1,
  4190. nextL: 'css;.page > a[title="下一页"]',
  4191. pageE: 'css;div[class*="-container"] div[class*="-con"] > ul > li, div[class*="-container"] div[class*="-con"] > div[class*="-wrap"] > ul > li',
  4192. insertP: ['css;div[class*="-container"] div[class*="-con"] > ul, div[class*="-container"] div[class*="-con"] > div[class*="-wrap"] > ul', 3],
  4193. replaceE: 'css;.page',
  4194. scrollD: 2000
  4195. },
  4196. function: {
  4197. bF: src_bF,
  4198. pF: [0, 'img[_src]', '_src']
  4199. }
  4200. }, // 新片场
  4201. tujigu: {
  4202. host: 'www.tujigu.net',
  4203. functionStart: function() {
  4204. if (location.pathname.indexOf('/a/') > -1) {
  4205. curSite = DBSite.tujigu;
  4206. } else if (location.pathname != '/' && location.pathname.indexOf('/search/') === -1) {
  4207. curSite = DBSite.tujigu_list;
  4208. }},
  4209. insStyle: '.content img {display: block !important;}',
  4210. pager: {
  4211. type: 1,
  4212. nextL: 'id("pages")/a[contains(text(), "下一页")]',
  4213. pageE: 'css;.content > img',
  4214. insertP: ['css;.content', 3],
  4215. replaceE: 'css;#pages',
  4216. scrollD: 2000
  4217. },
  4218. function: {
  4219. bF: src_bF,
  4220. pF: [0, 'img[original]', 'original']
  4221. }
  4222. }, // 图集谷 - 图片页
  4223. tujigu_list: {
  4224. pager: {
  4225. type: 1,
  4226. nextL: 'id("pages")/a[contains(text(), "下一页")]',
  4227. pageE: 'css;.hezi > ul > li',
  4228. insertP: ['//div[@class="hezi"][last()]/ul', 3],
  4229. replaceE: 'css;#pages',
  4230. scrollD: 1000
  4231. }
  4232. }, // 图集谷 - 分类页
  4233. mvtui: {
  4234. host: 'mvtui.com',
  4235. functionStart: function() {if (location.pathname.indexOf('.html') > -1) {curSite = DBSite.mvtui;} else {curSite = DBSite.mvtui_list;}},
  4236. pager: {
  4237. type: 1,
  4238. nextL: 'css;.article-paging span.current+a',
  4239. pageE: 'css;.article-content > p',
  4240. insertP: ['css;.article-paging', 1],
  4241. replaceE: 'css;.article-paging',
  4242. scrollD: 3000
  4243. }
  4244. }, // 美女推 - 图片页
  4245. mvtui_list: {
  4246. pager: {
  4247. type: 1,
  4248. nextL: 'css;li.next-page a',
  4249. pageE: 'css;#posts > div',
  4250. insertP: ['css;#posts', 3],
  4251. replaceE: 'css;.pagination',
  4252. scrollD: 1500
  4253. },
  4254. function: {
  4255. bF: src_bF,
  4256. pF: [0, 'img[data-src]', 'data-src']
  4257. }
  4258. }, // 美女推 - 分类页
  4259. xiurenji: {
  4260. host: /.xiurenji./,
  4261. functionStart: function() {insStyle('img[src$=".gif"]:not([src*="logo"]) {display: none !important;}');
  4262. if (location.pathname.indexOf('.html') > -1 && location.pathname.indexOf('/index') === -1) {
  4263. curSite = DBSite.xiurenji;
  4264. } else if (location.pathname.indexOf('search') > -1) {
  4265. curSite = DBSite.xiurenji_search;
  4266. } else {
  4267. curSite = DBSite.xiurenji_list;
  4268. }},
  4269. pager: {
  4270. type: 1,
  4271. nextL: '//div[@class="page"]/a[contains(text(), "后")]',
  4272. pageE: 'css;div.img > p > *',
  4273. insertP: ['css;div.img > p', 3],
  4274. replaceE: 'css;.page',
  4275. scrollD: 2000
  4276. }
  4277. }, // 秀人集 - 图片页
  4278. xiurenji_list: {
  4279. pager: {
  4280. type: 1,
  4281. nextL: '//div[@class="page"]/a[contains(text(), "下页")]',
  4282. pageE: 'css;td >.tp2 > *',
  4283. insertP: ['css;td >.tp2', 3],
  4284. replaceE: 'css;.page',
  4285. scrollD: 1000
  4286. }
  4287. }, // 秀人集 - 分类页
  4288. xiurenji_search: {
  4289. pager: {
  4290. type: 1,
  4291. nextL: 'css;.page > a.current+a',
  4292. pageE: 'css;.node > *',
  4293. insertP: ['css;.node', 3],
  4294. replaceE: 'css;.page',
  4295. scrollD: 1000
  4296. }
  4297. }, // 秀人集 - 搜索页
  4298. mm131: {
  4299. host: 'www.mm131.net',
  4300. functionStart: function() {if (location.pathname.indexOf('.html') > -1) {curSite = DBSite.mm131;} else {curSite = DBSite.mm131_list;}},
  4301. pager: {
  4302. type: 1,
  4303. nextL: '//div[@class="content-page"]/a[contains(text(), "下一页")]',
  4304. pageE: 'css;.content-pic img',
  4305. insertP: ['css;.content-pic', 3],
  4306. replaceE: 'css;.content-page',
  4307. scrollD: 2000
  4308. }
  4309. }, // MM131 - 图片页
  4310. mm131_list: {
  4311. pager: {
  4312. type: 1,
  4313. nextL: '//dd[@class="page"]/a[contains(text(), "下一页")]',
  4314. pageE: 'css;dl.list-left > dd:not([class="page"])',
  4315. insertP: ['css;.page', 1],
  4316. replaceE: 'css;.page',
  4317. scrollD: 1000
  4318. }
  4319. }, // MM131 - 分类页
  4320. fnvshen: {
  4321. host: 'www.fnvshen.com',
  4322. functionStart: function() {
  4323. if (location.pathname.indexOf('/gallery/') > -1 || location.pathname.indexOf('/tag/') > -1) {
  4324. curSite = DBSite.fnvshen_list;
  4325. } else if (location.pathname.indexOf('/g/') > -1) {
  4326. curSite = DBSite.fnvshen;
  4327. } else if (/\/article\/\d+\//.test(location.pathname)) {
  4328. curSite = DBSite.fnvshen_article;
  4329. } else if (location.pathname.indexOf('/article/') > -1) {
  4330. curSite = DBSite.fnvshen_article_list;
  4331. }},
  4332. pager: {
  4333. type: 1,
  4334. nextL: 'id("pages")/a[contains(text(), "下一页")]',
  4335. pageE: 'css;#hgallery > img',
  4336. insertP: ['css;#hgallery', 3],
  4337. replaceE: 'css;#pages',
  4338. scrollD: 1000
  4339. }
  4340. }, // 宅男女神 - 图片页
  4341. fnvshen_list: {
  4342. insStyle: '.yalayi_box {display: none !important; margin: -4px 0 !important;}',
  4343. pager: {
  4344. type: 1,
  4345. nextL: '//div[@class="pagesYY"]//a[contains(text(), "下一页")]',
  4346. pageE: 'css;#listdiv > ul > li',
  4347. insertP: ['css;#listdiv > ul', 3],
  4348. replaceE: 'css;.pagesYY',
  4349. scrollD: 1000
  4350. },
  4351. function: {
  4352. bF: src_bF,
  4353. pF: [0, 'img[data-original]', 'data-original']
  4354. }
  4355. }, // 宅男女神 - 分类页
  4356. fnvshen_article_list: {
  4357. pager: {
  4358. type: 1,
  4359. nextL: '//div[@class="pagesYY"]//a[contains(text(), "下一页")]',
  4360. pageE: 'css;li.other_girlli',
  4361. insertP: ['//ul[./li[@class="other_girlli"]]', 3],
  4362. replaceE: 'css;.pagesYY',
  4363. scrollD: 1000
  4364. }
  4365. }, //宅男女神 - 文章列表
  4366. fnvshen_article: {
  4367. pager: {
  4368. type: 1,
  4369. nextL: 'css;.pagesYY a.cur+a',
  4370. pageE: 'css;#articleDiv',
  4371. insertP: ['css;#articleDiv', 5],
  4372. replaceE: 'css;.pagesYY',
  4373. scrollD: 1000
  4374. }
  4375. }, // 宅男女神 - 文章内
  4376. xrmn5: {
  4377. host: 'www.xrmn5.com',
  4378. functionStart: function() {if (/\d+\.html/.test(location.pathname)) {
  4379. curSite = DBSite.xrmn5;
  4380. } else if (location.pathname.indexOf('/search') > -1) {
  4381. curSite = DBSite.xrmn5_search;
  4382. /*} else {
  4383. curSite = DBSite.xrmn5_list;*/
  4384. }},
  4385. pager: {
  4386. type: 1,
  4387. nextL: '//div[contains(@class, "page")]//a[contains(text(), "下页")]',
  4388. pageE: 'css;.content_left > p > img',
  4389. insertP: ['css;.content_left > p', 3],
  4390. replaceE: 'css;.page',
  4391. scrollD: 3000
  4392. }
  4393. }, // 秀人美女网 - 图片页
  4394. xrmn5_list: {
  4395. pager: {
  4396. type: 1,
  4397. nextL: '//div[contains(@class, "page")]//a[contains(text(), "下页")]',
  4398. pageE: 'css;ul.update_area_lists > li',
  4399. insertP: ['css;ul.update_area_lists', 3],
  4400. replaceE: 'css;.page',
  4401. scrollD: 2000
  4402. }
  4403. }, // 秀人美女网 - 分类页
  4404. xrmn5_search: {
  4405. pager: {
  4406. type: 1,
  4407. nextL: 'css;.page a.current+a',
  4408. pageE: 'css;div.sousuo',
  4409. insertP: ['//div[contains(@class, "sousuo")][last()]', 4],
  4410. replaceE: 'css;.page',
  4411. scrollD: 2000
  4412. }
  4413. } // 秀人美女网 - 搜索页
  4414. };
  4415. // 生成 SiteTypeID
  4416. setSiteTypeID();
  4417. // 用于脚本判断(针对部分特殊的网站)
  4418. SiteType = {
  4419. BAIDU_TIEBA: DBSite.baidu_tieba.SiteTypeID,
  4420. BILIBILI_SEARCH: DBSite.bilibili_search.SiteTypeID
  4421. };
  4422. }
  4423.  
  4424.  
  4425. if (webType != 1) {
  4426. switch (webType) {
  4427. case 2: // < 所有 Discuz!论坛 >
  4428. discuz_(); break;
  4429. case 3: // < 所有 Flarum 论坛 >
  4430. DBSite.flarum.functionStart(); break;
  4431. case 4: // < 所有 phpBB 论坛 >
  4432. DBSite.phpbb.functionStart(); break;
  4433. case 5: // < 所有 Xiuno 论坛 >
  4434. DBSite.xiuno.functionStart(); break;
  4435. case 6: // < 所有 XenForo 论坛 >
  4436. DBSite.xenforo.functionStart(); break;
  4437. case 100: // < 所有使用 WordPress DUX 主题的网站 >
  4438. DBSite.dux.functionStart(); if (location.host === 'apphot.cc') {curSite.pager.scrollD = 2500;}; break;
  4439. case 101: // < 所有使用 WordPress XIU 主题的网站 >
  4440. DBSite.dux.functionStart(); curSite.function = {bF: src_bF, pF: [0, 'img.thumb[data-original]', 'data-original']}; break;
  4441. case 102: // < 所有使用 WordPress D8 主题的网站 >
  4442. DBSite.dux.functionStart(); delete curSite.function; break;
  4443. case 103: // < 所有使用 WordPress Begin 主题的网站 >
  4444. DBSite.begin.functionStart(); break;
  4445. case 200: // < 所有使用 笔趣阁 模板的小说网站 >
  4446. DBSite.biquge.functionStart(); break;
  4447. }
  4448. }
  4449.  
  4450. // 显示页码
  4451. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');}
  4452. // 左键双击网页空白处暂停翻页
  4453. pausePageEvent();
  4454.  
  4455. if (locationChange) { // 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则
  4456. nowLocation = location.href
  4457. addLocationchange(); // 自定义 locationChange 事件
  4458. if (webType === 1) {
  4459. window.addEventListener('locationChange', function(){
  4460. let history = true;
  4461. if (curSite.SiteTypeID > 0 && curSite.pager.history) history = curSite.pager.history(); // 解决 locationChange 与 history 冲突的问题,只有返回 true 才会重置规则+页码
  4462. if (history && nowLocation != location.href) {
  4463. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  4464. registerMenuCommand(); // 重新判断规则
  4465. curSite.pageUrl = ''; // 下一页URL
  4466. pageLoading(); // 自动无缝翻页
  4467.  
  4468. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  4469. pausePageEvent(); // 左键双击网页空白处暂停翻页
  4470. }
  4471. })
  4472. } else if (webType === 3) {
  4473. window.addEventListener('locationChange', function(){
  4474. if (nowLocation != location.href) {
  4475. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  4476. DBSite.flarum.functionStart(); // 重新判断规则
  4477. pageLoading(); // 自动无缝翻页
  4478.  
  4479. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  4480. pausePageEvent(); // 左键双击网页空白处暂停翻页
  4481. }
  4482. })
  4483. }
  4484. }
  4485. if (curSite.insStyle) insStyle(curSite.insStyle)
  4486.  
  4487. curSite.pageUrl = ''; // 下一页URL
  4488. //console.log(curSite);
  4489. pageLoading(); // 自动无缝翻页
  4490.  
  4491.  
  4492. // [Discuz! 论坛] 判断各版块帖子列表类型
  4493. function discuzForum() {
  4494. if (document.getElementById('autopbn')) { // 判断是否有 [下一页] 按钮
  4495. curSite = DBSite.discuz_forum;
  4496. } else if (document.getElementById('waterfall')) { // 判断是否为图片模式
  4497. if (!document.querySelector('#pgbtn, .pgbtn')) { // 如果各版块帖子列表已存在这个元素,说明自带了无缝翻页
  4498. curSite = DBSite.discuz_waterfall; waterfallStyle(); // 图片模式列表样式预处理
  4499. }
  4500. } else {
  4501. curSite = DBSite.discuz_guide;
  4502. }
  4503. }
  4504. function discuz_() {
  4505. if (document.querySelector('body[id="nv_forum"][class^="pg_"][onkeydown*="27"]')) {
  4506. switch (document.querySelector('body[id="nv_forum"][class^="pg_"][onkeydown*="27"]').className) {
  4507. case 'pg_forumdisplay': // < 各版块帖子列表 >
  4508. discuzForum(); break;
  4509. case 'pg_viewthread': // < 帖子内 >
  4510. if (GM_getValue('menu_discuz_thread_page')) curSite = DBSite.discuz_thread; break;
  4511. case 'pg_guide': // < 导读帖子列表等 >
  4512. curSite = DBSite.discuz_guide; break;
  4513. case 'pg_collection': // < 淘贴列表 >
  4514. curSite = DBSite.discuz_collection; break;
  4515. }
  4516. }
  4517. // 如果上面没有匹配的则继续 < 搜索结果 >
  4518. if (curSite.SiteTypeID === 0) {
  4519. if (location.pathname.indexOf('search') > -1 || document.querySelector('body[id="nv_search"][onkeydown*="27"]')) {
  4520. curSite = DBSite.discuz_search;
  4521. }
  4522. }
  4523. // 如果上面没有匹配的则继续
  4524. if (curSite.SiteTypeID === 0) {
  4525. if (location.pathname.indexOf('.html') > -1) { // 判断是不是静态网页(.html 结尾)
  4526. if (location.pathname.indexOf('/forum-') > -1) { // < 各版块帖子列表 >
  4527. discuzForum();
  4528. } else if (location.pathname.indexOf('/thread-') > -1) { // < 帖子内 >
  4529. if (GM_getValue('menu_discuz_thread_page')) curSite = DBSite.discuz_thread;
  4530. }
  4531. }
  4532. }
  4533. // 如果上面没有匹配的则继续
  4534. if (curSite.SiteTypeID === 0) {
  4535. if (location.search.indexOf('mod=forumdisplay') > -1 || location.pathname.indexOf('forumdisplay.php') > -1) { // < 各版块帖子列表 >
  4536. discuzForum();
  4537. } else if (location.search.indexOf('mod=viewthread') > -1 || location.pathname.indexOf('viewthread.php') > -1) { // < 帖子内 >
  4538. if (GM_getValue('menu_discuz_thread_page')) curSite = DBSite.discuz_thread;
  4539. } else if (location.search.indexOf('mod=guide') > -1) { // < 导读帖子列表 >
  4540. curSite = DBSite.discuz_guide;
  4541. } else if(location.search.indexOf('mod=space') > -1 && location.search.indexOf('do=thread') > -1) { // 别人的主题/回复
  4542. curSite = DBSite.discuz_youspace;
  4543. } else if (location.search.indexOf('mod=collection') > -1) { // < 淘贴列表 >
  4544. curSite = DBSite.discuz_collection;
  4545. } else if (document.getElementById('threadlist')) { // < 部分论坛的各板块 URL 是自定义的 >
  4546. discuzForum();
  4547. } else if (document.getElementById('postlist')) { // < 部分论坛的帖子内 URL 是自定义的 >
  4548. if (GM_getValue('menu_discuz_thread_page')) curSite = DBSite.discuz_thread;
  4549. }
  4550. }
  4551. }
  4552. // [Discuz! 论坛] 图片模式列表样式预处理
  4553. function waterfallStyle() {
  4554. let width = document.querySelector('#waterfall > li:first-child').style.width;
  4555. insStyle(`#waterfall {height: auto !important; width: 100% !important;} #waterfall > li {width: ${width} !important; float: left !important; position: inherit !important; left: auto !important; top: auto !important;}`);
  4556. }
  4557.  
  4558.  
  4559. // 插入 Style 样式
  4560. function insStyle(style) {
  4561. document.lastElementChild.appendChild(document.createElement('style')).textContent = style;
  4562. }
  4563.  
  4564.  
  4565. // 通用型插入前函数(加载图片)
  4566. function src_bF(pageElems, css) {
  4567. pageElems.forEach(function (one) {
  4568. if (css[0] == 0) { // src 图片
  4569. one.querySelectorAll(css[1]).forEach(function (now) {
  4570. now.src = now.getAttribute(css[2]);
  4571. });
  4572. } else if (css[0] == 1) { // 背景图片
  4573. one.querySelectorAll(css[1]).forEach(function (now) {
  4574. now.style.backgroundImage = 'url("' + now.getAttribute(css[2]) + '")';
  4575. });
  4576. }
  4577. });
  4578. return pageElems
  4579. }
  4580.  
  4581.  
  4582. // [头条搜索] 的插入前函数(过滤相关搜索)
  4583. function toutiao_bF(pageElems) {
  4584. for (let i = 0; i < pageElems.length; i++) {
  4585. let now = pageElems[i].querySelector('div[class*="-header"]')
  4586. if (now && now.textContent === '相关搜索') {
  4587. pageElems.splice(i,1)
  4588. }
  4589. }
  4590. return pageElems
  4591. }
  4592.  
  4593.  
  4594. // [Startpage] 获取下一页地址
  4595. function startpage_nextL() {
  4596. let form = getXpath('//div[contains(@class, "pagination ")]/form[./button[@class="pagination__next-prev-button next"]]');
  4597. if (form) {
  4598. let action = form.action, value = ''; // 获取提交表单 URL
  4599. form.querySelectorAll('input[name]').forEach(function(input) {value += input.name + '=' + input.value + '&';}) // 生成表单参数
  4600. value = encodeURI(value.replace(/&$/,'')); // 清理最后一个 & 符号,并替换页码
  4601. if (action && value) return (action + '?' + value)
  4602. }
  4603. return '';
  4604. }
  4605.  
  4606.  
  4607. // [百度贴吧](发帖按钮点击事件)
  4608. function baidu_tieba_1() {
  4609. let button = document.querySelector('.tbui_aside_fbar_button.tbui_fbar_post > a');
  4610. if (button) {
  4611. button.remove();
  4612. document.querySelector('li.tbui_aside_fbar_button.tbui_fbar_down').insertAdjacentHTML(getAddTo(4), '<li class="tbui_aside_fbar_button tbui_fbar_post"><a href="javascript:void(0);" title="因为 [自动无缝翻页] 的原因,请点击该按钮发帖!"></a></li>')
  4613. button = document.querySelector('.tbui_aside_fbar_button.tbui_fbar_post > a');
  4614. if (button) {
  4615. button.onclick = function(){
  4616. let button2 = document.querySelector('div.edui-btn.edui-btn-fullscreen.edui-btn-name-portrait');
  4617. if (button2) {
  4618. button2.click();
  4619. } else {
  4620. alert('提示:登录后才能发帖!');
  4621. }
  4622. return false;
  4623. }
  4624. }
  4625. }
  4626. }
  4627. // [百度贴吧] 的插入前函数(加载图片)
  4628. function baidu_tieba_bF(pageElems) {
  4629. pageElems.forEach(function (one) {
  4630. one.querySelectorAll('img.threadlist_pic[data-original]').forEach(function (now) {
  4631. now.src = now.dataset.original;
  4632. now.style.display = 'inline';
  4633. })
  4634. });
  4635. return pageElems
  4636. }
  4637. // [百度贴吧] 获取下一页地址
  4638. function baidu_tieba_nextL() {
  4639. let next = document.querySelector('a.next.pagination-item');
  4640. if (next != null && next.nodeType === 1 && next.href && next.href.slice(0,4) === 'http') {
  4641. var url = next.href + '&pagelets=frs-list%2Fpagelet%2Fthread&pagelets_stamp=' + new Date().getTime();
  4642. if (url === curSite.pageUrl) return
  4643. curSite.pageUrl = url;
  4644. getPageElems(curSite.pageUrl);
  4645. };
  4646. }
  4647. // [百度贴吧] 插入数据
  4648. function baidu_tieba_insertE(newBody, type) {
  4649. if (!newBody) return
  4650. let toElement = getAll(curSite.pager.insertP[0])[0], pageElems;
  4651. // 插入位置
  4652. let addTo = getAddTo(curSite.pager.insertP[1]);
  4653. // 获取 <script> 内容
  4654. const scriptElems = getXpath(`//script[contains(text(), 'Bigpipe.register("frs-list/pagelet/thread_list", ')]`, newBody, newBody);
  4655. if (scriptElems) {
  4656. // 从 <script> 中提取帖子列表字符串
  4657. let scriptText = scriptElems.textContent.replace('Bigpipe.register("frs-list/pagelet/thread_list", ','');
  4658. scriptText = scriptText.slice(0, scriptText.indexOf(').'));
  4659. // 字符串格式化并转为 Element 元素
  4660. var temp_baidu_tieba = document.createElement('div'); temp_baidu_tieba.innerHTML = JSON.parse(scriptText).content;
  4661. // 插入前执行函数
  4662. pageElems = curSite.function.bF(getAll(curSite.pager.pageE, temp_baidu_tieba, temp_baidu_tieba));
  4663. // 插入元素
  4664. pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo, one);});
  4665. // 当前页码 + 1
  4666. pageNum.now = pageNum._now + 1
  4667. // 替换元素
  4668. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  4669. repE = getAll(curSite.pager.replaceE, temp_baidu_tieba, temp_baidu_tieba);
  4670. if (oriE.length === repE.length) {
  4671. for (let i = 0; i < oriE.length; i++) {
  4672. oriE[i].outerHTML = repE[i].outerHTML;
  4673. }
  4674. }
  4675. }
  4676. }
  4677.  
  4678.  
  4679. // [NGA(玩家社区)] 的插入后函数(加载各版块帖子列表样式)
  4680. function nga_thread_aF() {
  4681. document.body.appendChild(document.createElement('script')).textContent = 'commonui.topicArg.loadAll();';
  4682. }
  4683.  
  4684.  
  4685. // [V2EX] 的插入后函数(新标签页打开链接)
  4686. function v2ex_aF(css) {
  4687. let links = document.querySelectorAll(css);if (!links) return
  4688. links.forEach(function (_this) {_this.target = '_blank';});
  4689. }
  4690.  
  4691.  
  4692. // [龙的天空] 获取下一页地址
  4693. function lkong_nextL() {
  4694. let next = document.querySelector('li.ant-pagination-next'), page;
  4695. if (next && next.getAttribute('aria-disabled') === 'false') {
  4696. page = document.querySelector('li.ant-pagination-item-active[title]');
  4697. if (page && page.title) {
  4698. if (curSite.pager.interval) {
  4699. let _SiteTypeID = curSite.SiteTypeID; curSite.SiteTypeID = 0;
  4700. setTimeout(function(){curSite.SiteTypeID = _SiteTypeID;}, curSite.pager.interval)
  4701. }
  4702. return (location.origin + location.pathname + '?page=' + ++page.title);
  4703. }
  4704. }
  4705. return '';
  4706. }
  4707.  
  4708.  
  4709. // [3DM MOD] 获取下一页地址
  4710. function _3dmgame_mod_nextL() {
  4711. let nextNum = getXpath('//li[@class="page-list active"]/following-sibling::li[contains(@class, "page-list")]/a');
  4712. var url = '';
  4713. if (nextNum && nextNum.textContent) {
  4714. nextNum = 'Page=' + nextNum.textContent;
  4715. if (location.search) {
  4716. let search = location.search.replace(/(&)?Page=\d+(&)?/, '');
  4717. if (search === '?') {
  4718. url += location.origin + location.pathname + search + nextNum;
  4719. } else {
  4720. url += location.origin + location.pathname + search + '&' + nextNum;
  4721. }
  4722. } else {
  4723. url += location.origin + location.pathname + '?' + nextNum;
  4724. }
  4725. }
  4726. //console.log(url)
  4727. return url
  4728. }
  4729.  
  4730.  
  4731. // [X-MOL] 获取下一页地址
  4732. function x_mol_mod_nextL() {
  4733. let nextNum = getCSS('.pagination li.active+li > a');
  4734. var url;
  4735. if (nextNum && nextNum.textContent) {
  4736. if (location.search) {
  4737. let search;
  4738. if (location.search.indexOf('pageIndex=') > -1) {
  4739. search = location.search.replace(/pageIndex=\d+/, 'pageIndex=' + nextNum.textContent);
  4740. } else {
  4741. search = location.search + '&pageIndex=' + nextNum.textContent;
  4742. }
  4743. url = location.origin + location.pathname + search;
  4744. }
  4745. }
  4746. //console.log(url)
  4747. return url
  4748. }
  4749.  
  4750.  
  4751. // [游民星空-攻略] 的插入前函数(移除下一页底部的 "更多相关内容请关注:xxx" 文字)
  4752. function gamersky_gl_bF(pageElems) {
  4753. pageElems.forEach(function (one) {
  4754. if (one.tagName === 'P' && one.textContent.indexOf('更多相关内容请关注') > -1) {one.style.display = 'none';}
  4755. });
  4756. return pageElems
  4757. }
  4758.  
  4759.  
  4760. // [NexusMods] 获取下一页地址
  4761. function nexusmods_nextL() {
  4762. if (document.querySelector('.nexus-ui-blocker')) return
  4763. let modList;
  4764. if (location.pathname.indexOf('/news') > -1) {modList = RH_NewsTabContent;} else {modList = RH_ModList;}
  4765. let out_items = JSON.stringify(modList.out_items).replace(/{|}|"/g,''),
  4766. nextNum = getXpath('//div[contains(@class, "pagenav")][1]//a[contains(@class, "page-selected")]/parent::li/following-sibling::li/a'),
  4767. categories = modList.out_items.categories, categoriesUrl = '';
  4768. var url = '';
  4769. if (nextNum && nextNum.innerText) {
  4770. nextNum = nextNum.innerText;
  4771. if (out_items.indexOf('page:') > -1) {
  4772. out_items = out_items.replace(/page:\d+/, `page:${nextNum}`)
  4773. } else {
  4774. out_items += `,page:${nextNum}`;
  4775. }
  4776. if (categories && categories != []) {
  4777. for (let i = 0; i < categories.length; i++) {
  4778. categoriesUrl += `,categories[]:${categories[i]}`
  4779. }
  4780. categoriesUrl = categoriesUrl.replace(/,/,'');
  4781. if (out_items.indexOf('categories:') > -1) {
  4782. out_items = out_items.replace(/categories:\[.*\]/, categoriesUrl)
  4783. }
  4784. }
  4785. url = `https://www.nexusmods.com${modList.uri}?RH_${modList.id}=${out_items}`
  4786. //console.log(nextNum, url, curSite.pageUrl, out_items)
  4787. if (url === curSite.pageUrl) return
  4788. curSite.pageUrl = url;
  4789. //console.log(nextNum, curSite.pageUrl, out_items)
  4790. getPageElems(curSite.pageUrl)
  4791. }
  4792. }
  4793. // [NexusMods] 插入数据
  4794. function nexusmods_insertE(newBody, type) {
  4795. if (!newBody) return
  4796. let pageElems = getAll(curSite.pager.pageE, newBody, newBody), // 主体元素
  4797. toElement = getAll(curSite.pager.insertP[0])[0], // 插入位置的元素
  4798. addTo = getAddTo(curSite.pager.insertP[1]); // 插入位置
  4799. // 添加下载数据
  4800. pageElems.forEach(function (one) {
  4801. let now = one.querySelector('.mod-tile-left');
  4802. if (now) {
  4803. let downloadCount = now.querySelector('.downloadcount > span.flex-label');
  4804. if (downloadCount) {
  4805. //console.log(now.dataset.gameId, now.dataset.modId)
  4806. if (GlobalModStats[now.dataset.gameId] && GlobalModStats[now.dataset.gameId][now.dataset.modId]) {
  4807. downloadCount.textContent = shortFormat(parseInt(GlobalModStats[now.dataset.gameId][now.dataset.modId].total));
  4808. }
  4809. }
  4810. }
  4811. });
  4812. // 插入网页
  4813. pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo, one);});
  4814. // 当前页码 + 1
  4815. pageNum.now = pageNum._now + 1
  4816. // 替换元素
  4817. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  4818. repE = getAll(curSite.pager.replaceE, newBody, newBody);
  4819. if (oriE.length === repE.length) {
  4820. for (let i = 0; i < oriE.length; i++) {
  4821. oriE[i].outerHTML = repE[i].outerHTML;
  4822. }
  4823. }
  4824. }
  4825.  
  4826.  
  4827. // [cs_rin_ru] 各版块帖子列表的插入前函数(过滤置顶帖子)
  4828. function cs_rin_ru_bF(pageElems) {
  4829. for (let i = 0; i < pageElems.length; i++) {
  4830. if (pageElems[i].textContent.replace(/\n| /g,'') === 'Topics') {
  4831. pageElems.splice(0,i+1);
  4832. break;
  4833. }
  4834. }
  4835. return pageElems
  4836. }
  4837.  
  4838.  
  4839. // [bilibili_search] 获取下一页地址
  4840. function bilibili_search_nextL() {
  4841. if (!location.search) return
  4842. let pageActive = 1, pageLast = parseInt(document.querySelector('li.page-item.last').innerText);
  4843. if (/page=\d+/.test(location.search)) {
  4844. pageActive = parseInt(/page=\d+/.exec(location.search)[0].replace('page=',''))
  4845. }
  4846. if (pageActive <= pageLast) {
  4847. if (/page=\d+/.test(location.search)) {
  4848. return (location.origin + location.pathname + location.search.replace(/page=\d+/,`page=${pageActive+1}`))
  4849. } else {
  4850. return (location.origin + location.pathname + location.search + `&page=${pageActive+1}`)
  4851. }
  4852. }
  4853. }
  4854. // [bilibili_search] 插入后函数(加载图片)
  4855. function bilibili_search_aF() {
  4856. let result = __INITIAL_STATE__.flow[__INITIAL_STATE__.flow.fields[0]].result;
  4857. if (result.length > 0) {
  4858. let imgArr = document.querySelectorAll('.img > .lazy-img > img[src=""]');
  4859. if (imgArr.length > 0) {
  4860. for (let i = 0; i < imgArr.length; i++) {
  4861. imgArr[i].src = result[i].pic;
  4862. }
  4863. }
  4864. }
  4865. }
  4866.  
  4867.  
  4868. // [Anime1] 获取下一页内容(叠加)
  4869. function anime1_nextL() {
  4870. let next = getCSS('#tablepress-1_next');
  4871. if (next && next.className.indexOf('disabled') === -1) {
  4872. let oldList = getCSS('tbody.row-hover').innerHTML;
  4873. if (oldList) {
  4874. // 点击下一页
  4875. next.click();
  4876. // 当前页码 + 1
  4877. pageNum.now = pageNum._now + 1
  4878. // 插入到列表头部
  4879. getCSS('tbody.row-hover').insertAdjacentHTML('afterbegin', oldList);
  4880. }
  4881. }
  4882. }
  4883.  
  4884.  
  4885. // [SkrBT] 获取下一页地址
  4886. function skrbt_nextL() {
  4887. let page = document.querySelector('a[onclick][aria-label="Next"]');
  4888. if (page) {page = /(?<=\()\d+(?=\))/.exec(page.onclick)[0];} else {return '';} // 获取下一页页码
  4889. if (page) {
  4890. let action = document.getElementById('search-form').action, value = ''; // 获取提交表单 URL
  4891. document.querySelectorAll('#search-form input[name]').forEach(function(input) {value += input.name + '=' + input.value + '&';}) // 生成表单参数
  4892. value = encodeURI(value.replace(/&$/,'').replace(/p=\d+/,'p=' + page)); // 清理最后一个 & 符号,并替换页码
  4893. if (action && value) return (action + '?' + value)
  4894. }
  4895. return '';
  4896. }
  4897.  
  4898.  
  4899. // [BTHaha] 的插入前函数(隐藏底部元素)
  4900. function bthaha_bF(pageElems) {
  4901. pageElems.forEach(function (one) {
  4902. let now = one.querySelector('[id^="list_top"], [id^="list_bottom"]')
  4903. if (now) {one.hidden = true;}
  4904. });
  4905. return pageElems
  4906. }
  4907.  
  4908.  
  4909. // [射手网] 获取下一页地址
  4910. function assrt_nextL() {
  4911. let nextXPAHT = '//a[@id="pl-nav"][contains(text(), ">")]'
  4912. let url = getXpath(nextXPAHT);
  4913. if (url) {
  4914. url = /(?<=\()\d+(?=,)/.exec(url.href)[0]
  4915. if (url) {
  4916. return (location.origin + location.pathname + location.search.replace(/(&)?page=\d+$/,'') + '&page=' + url);
  4917. }
  4918. }
  4919. return '';
  4920. }
  4921.  
  4922.  
  4923. // [LRepacks] 的插入前函数(调整 class)
  4924. function lrepacks_bF(pageElems) {
  4925. pageElems.forEach(function (one) {
  4926. let now = one.querySelector('.slideUp, .elementFade')
  4927. if (now) {
  4928. now.className = now.className.replace('slideUp','slideUpRun').replace('elementFade','elementFadeRun');
  4929. }
  4930. });
  4931. return pageElems
  4932. }
  4933.  
  4934.  
  4935. // [漫画狂] 获取下一页地址
  4936. function cartoonmad_nextL() {
  4937. let nextXPAHT = '//a[@class="pages"][contains(text(),"下一頁")]',
  4938. nextPXPATH = '//a[@class="pages"][contains(string(),"下一話")]'
  4939. let url = getXpath(nextXPAHT);
  4940. if (url) {
  4941. if (url.getAttribute('href') === 'thend.asp') {
  4942. url = getXpath(nextPXPATH)
  4943. if (url) return url.href;
  4944. pausePage = false;
  4945. GM_notification({text: `注意:该网站早期漫画(如海贼王、柯南)因为网站自身问题而无法翻至下一话(仅限于显示为 [第 X 卷]/[下一卷] 的)。\n因此需要手动去 [目录页] 进入下一卷!`, timeout: 10000});
  4946. } else {
  4947. return url.href;
  4948. }
  4949. }
  4950. return '';
  4951. }
  4952.  
  4953.  
  4954. // [漫画猫] 初始化(显示本话所以图片)
  4955. function manhuacat_init() {
  4956. let _img = '';
  4957. for (let now of img_data_arr) {
  4958. _img += `<img src="${asset_domain}${img_pre}${now}">`;
  4959. }
  4960. document.querySelector('.img-content > img').remove();
  4961. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  4962.  
  4963. }
  4964. // [漫画猫] 获取下一页地址
  4965. function manhuacat_nextL(pageElems, type) {
  4966. if (type === 'url') {
  4967. if(pageElems.code == '0000') {
  4968. if (pageElems.url === curSite.pageUrl) return
  4969. curSite.pageUrl = pageElems.url;
  4970. getPageElems(curSite.pageUrl); // 真正的下一页链接
  4971. }
  4972. } else {
  4973. let vg_r_data = document.querySelector('.vg-r-data');
  4974. if (vg_r_data) {
  4975. 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');
  4976. }
  4977. }
  4978. }
  4979. // [漫画猫] 插入数据
  4980. function manhuacat_insertE(pageElems, type) {
  4981. if (!pageElems) return
  4982. if (type === 'url') { // 获取下一页链接
  4983. manhuacat_nextL(pageElems, type); return
  4984. }
  4985.  
  4986. // 添加历史记录
  4987. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  4988.  
  4989. // 替换元素
  4990. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  4991. repE = getAll(curSite.pager.replaceE, pageElems, pageElems);
  4992. if (oriE.length === repE.length) {
  4993. for (let i = 0; i < oriE.length; i++) {
  4994. oriE[i].outerHTML = repE[i].outerHTML;
  4995. }
  4996. }
  4997.  
  4998. // 插入图片
  4999. let _img = '', _img_arr = LZString.decompressFromBase64(getXpath('//body/script[not(@src)][contains(text(), "img_data")]').textContent.split('"')[1]).split(','), vg_r_data = document.querySelector('.vg-r-data');;
  5000. for (let now of _img_arr) {
  5001. _img += `<img src="${vg_r_data.dataset.chapterDomain}${img_pre}${now}">`;
  5002. }
  5003. if (_img) {
  5004. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5005. // 当前页码 + 1
  5006. pageNum.now = pageNum._now + 1
  5007. }
  5008. }
  5009.  
  5010.  
  5011. // [漫画DB] 初始化(将本话其余图片插入网页中)
  5012. function manhuadb_init() {
  5013. let _img = '',
  5014. data = document.querySelector('.vg-r-data'), imgDate;
  5015. if (!data) return
  5016. document.querySelectorAll(curSite.pager.pageE.replace('css;', '')).forEach(function (one) {
  5017. if (one.tagName === 'SCRIPT' && one.textContent.indexOf('var img_data =') > -1) {
  5018. let json = JSON.parse(window.atob(one.textContent.split("'")[1]));
  5019. if (json) {
  5020. let _img = '';
  5021. for (let i = 0; i < json.length; i++) { // 遍历图片文件名数组,组合为 img 标签
  5022. let src = data.dataset.host + data.dataset.img_pre + json[i].img;
  5023. _img += `<img class="img-fluid show-pic" src="${src}">`
  5024. }
  5025. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5026. }
  5027. }
  5028. })
  5029. }
  5030. // [漫画DB] 获取下一页地址
  5031. function manhuadb_nextL() {
  5032. let nextArr = document.querySelectorAll('a.fixed-a-es'), next;
  5033. var url = '';
  5034. if (nextArr.length == 0) return
  5035. for (let i = 0; i < nextArr.length; i++) {
  5036. if (nextArr[i].className.indexOf('active') > -1) {
  5037. if (nextArr[i+1]) url = nextArr[i+1].href;
  5038. break;
  5039. }
  5040. }
  5041. if (url === curSite.pageUrl) return
  5042. curSite.pageUrl = url
  5043. getPageElems(curSite.pageUrl);
  5044. }
  5045. // [漫画DB] 插入数据
  5046. function manhuadb_insertE(pageElems, type) {
  5047. if (!pageElems) return
  5048. let oriE = document.querySelectorAll(curSite.pager.pageE.replace('css;', '')),
  5049. repE = getAll(curSite.pager.pageE, pageElems, pageElems);
  5050. if (oriE.length === repE.length) {
  5051. for (let i = 0; i < oriE.length; i++) {
  5052. oriE[i].outerHTML = repE[i].outerHTML;
  5053. }
  5054. // 当前页码 + 1
  5055. pageNum.now = pageNum._now + 1
  5056. manhuadb_init(); // 将刚刚替换的图片插入网页中
  5057. }
  5058. }
  5059.  
  5060.  
  5061. // [HiComic(嗨漫画)] 初始化(将本话其余图片插入网页中)
  5062. function hicomic_init() {
  5063. let _img = '';
  5064. document.querySelectorAll('.chapter > section:not(:first-child) > section[val]').forEach(function (one) {
  5065. let src = one.getAttribute('val');
  5066. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h'
  5067. _img += `<img src="${src}">`
  5068. })
  5069. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5070. window.document.title = window.document.title.replace(/(\(第.+\))? - HiComic/, `(${document.querySelector('.chapter_name').textContent}) - HiComic`); // 修改网页标题(加上 第 X 话)
  5071. }
  5072. // [HiComic(嗨漫画)] 获取下一页地址
  5073. function hicomic_nextL() {
  5074. let nextId;
  5075. nextId = document.querySelector('.next_chapter:not(.end)')
  5076. if (nextId && nextId.id && nextId.id != 'None') {
  5077. curSite.pageUrl = location.href;
  5078. getPageElems(`https://www.hicomic.net/api/web/chapter/${nextId.id}/contents`, 'json');
  5079. }
  5080. }
  5081. // [HiComic(嗨漫画)] 插入数据
  5082. function hicomic_insertE(pageElems, type) {
  5083. if (!pageElems || pageElems.code != 200) return
  5084. if (pageElems.results.chapter.next) { // 写入下一页的 UUID
  5085. document.querySelector('.next_chapter').id = pageElems.results.chapter.next;
  5086. } else {
  5087. document.querySelector('.next_chapter').id = 'None';
  5088. document.querySelector('.next_chapter').classList.add('end');
  5089. }
  5090. document.querySelector('.chapter_name').textContent = pageElems.results.chapter.name; // 修改漫画标题
  5091. let title = window.document.title.replace(/(\(第.+\))? - HiComic/, `(${pageElems.results.chapter.name}) - HiComic`)
  5092. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, title, curSite.pageUrl); // 添加历史记录
  5093. window.document.title = title; // 修改当前网页标题为下一话的标题
  5094. let _img = '';
  5095. for (let i = 0; i < pageElems.results.chapter.contents.length; i++) { // 遍历图片文件名数组,组合为 img 标签
  5096. let src = pageElems.results.chapter.contents[i].url;
  5097. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h';
  5098. _img += `<img src="${src}">`
  5099. }
  5100. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5101. // 当前页码 + 1
  5102. pageNum.now = pageNum._now + 1
  5103. }
  5104.  
  5105.  
  5106. // [动漫之家] 初始化(调整本话其余图片)
  5107. function dmzj_init() {
  5108. let _img = '';
  5109. document.querySelectorAll('.comic_wraCon > a > img').forEach(function (one) {
  5110. _img += `<img src="${one.dataset.original}">`;
  5111. one.parentElement.remove();
  5112. })
  5113. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5114.  
  5115. }
  5116. // [动漫之家] 获取下一页地址
  5117. function dmzj_nextL() {
  5118. let next;
  5119. next = document.querySelector('span.next > a')
  5120. if (next) {
  5121. if (next.href === curSite.pageUrl) return
  5122. curSite.pageUrl = next.href;
  5123. getPageElems(curSite.pageUrl);
  5124. }
  5125. }
  5126. // [动漫之家] 插入数据
  5127. function dmzj_insertE(pageElems, type) {
  5128. if (!pageElems) return
  5129. // 插入并运行 <script>
  5130. insScriptAll('css;head > script[type]:not([src])', document.body, pageElems);
  5131.  
  5132. // 插入图片
  5133. let _img = '', _img_arr;
  5134. if (pages.indexOf('|') === -1) {
  5135. _img_arr = JSON.parse(pages.replace(/\r\n/g,'|')).page_url.split('|');
  5136. } else {
  5137. _img_arr = JSON.parse(pages).page_url.split('|');
  5138. }
  5139. for (let now of _img_arr) {
  5140. _img += `<img src="${img_prefix}${now}">`;
  5141. }
  5142. if (_img) {
  5143. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5144.  
  5145. // 添加历史记录
  5146. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  5147.  
  5148. // 替换元素
  5149. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  5150. repE = getAll(curSite.pager.replaceE, pageElems, pageElems);
  5151. if (oriE.length === repE.length) {
  5152. for (let i = 0; i < oriE.length; i++) {
  5153. oriE[i].outerHTML = repE[i].outerHTML;
  5154. }
  5155. // 当前页码 + 1
  5156. pageNum.now = pageNum._now + 1
  5157. }
  5158. }
  5159. }
  5160.  
  5161.  
  5162. // [动漫之家-漫画] 初始化(调整本话其余图片)
  5163. function dmzj_manhua_init() {
  5164. let _img = '';
  5165. document.querySelectorAll('#center_box > .inner_img img[src]').forEach(function (one) {
  5166. _img += `<img src="${one.dataset.original}">`;
  5167. one.parentElement.parentElement.remove();
  5168. })
  5169. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5170.  
  5171. }
  5172. // [动漫之家-漫画] 获取下一页地址
  5173. function dmzj_manhua_nextL() {
  5174. let next;
  5175. next = document.getElementById('next_chapter')
  5176. if (next) {
  5177. if (next.href === curSite.pageUrl) return
  5178. curSite.pageUrl = next.href;
  5179. getPageElems(curSite.pageUrl);
  5180. }
  5181. }
  5182. // [动漫之家-漫画] 插入数据
  5183. function dmzj_manhua_insertE(pageElems, type) {
  5184. if (!pageElems) return
  5185. // 插入并运行 <script>
  5186. insScriptAll('css;head > script[type]:not([src])', document.body, pageElems);
  5187.  
  5188. // 插入图片
  5189. let _img = '';
  5190. for (let now of arr_pages) {
  5191. _img += `<img src="${img_prefix}${now}">`;
  5192. }
  5193. if (_img) {
  5194. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5195.  
  5196. // 添加历史记录
  5197. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  5198.  
  5199. // 替换元素
  5200. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  5201. repE = getAll(curSite.pager.replaceE, pageElems, pageElems);
  5202. if (oriE.length === repE.length) {
  5203. for (let i = 0; i < oriE.length; i++) {
  5204. oriE[i].outerHTML = repE[i].outerHTML;
  5205. }
  5206. // 当前页码 + 1
  5207. pageNum.now = pageNum._now + 1
  5208. }
  5209. }
  5210. }
  5211.  
  5212.  
  5213. // [百度贴吧 - 帖子内] 加载下一页
  5214. function baidu_tieba_post_nextL() {
  5215. let next;
  5216. next = getXpath('//li[contains(@class,"pb_list_pager")]/a[contains(text(),"下一页")]')
  5217. if (next) {
  5218. if (next.href === curSite.pageUrl) return
  5219. curSite.pageUrl = next.href;
  5220. insStyle('topic_list_box, ul.tbui_aside_float_bar, .core_title_wrap_bright.tbui_follow_fixed.core_title_absolute_bright {display: none !important;}');
  5221. insIframe(curSite.pageUrl);
  5222. }
  5223. }
  5224.  
  5225.  
  5226. // [拷贝漫画] 加载下一页
  5227. function copymanga_nextL() {
  5228. let next;
  5229. next = document.querySelector('.comicContent-next > a')
  5230. if (next) {
  5231. if (next.href === curSite.pageUrl) return
  5232. curSite.pageUrl = next.href;
  5233. insStyle('h4.header, h4.header +div[style*="fixed"] {display: none !important;}');
  5234. insIframe(curSite.pageUrl);
  5235. /*setTimeout(function(){
  5236. let oldImg = document.querySelector(curSite.pager.pageE.replace('css;', '')).innerHTML;
  5237. iframe.contentWindow.document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), oldImg); // 将 img 标签插入到网页中
  5238. document.querySelector(curSite.pager.pageE.replace('css;', '')).innerHTML = ''
  5239. }, 500);*/
  5240. }
  5241. }
  5242.  
  5243.  
  5244. // 插入 iframe 加载下一页
  5245. function insIframe(src) {
  5246. // 停用当前页面翻页
  5247. curSite.SiteTypeID = 0;
  5248. // 隐藏当前页面的滚动条 + 页码
  5249. insStyle('body::-webkit-scrollbar {width: 0 !important;height: 0 !important;} #Autopage_number {display: none !important;}');
  5250. // 创建 iframe
  5251. let iframe = document.createElement('iframe');
  5252. document.lastElementChild.appendChild(iframe);
  5253. iframe.style = 'position: absolute; width: 100%; height: 100%; border: none;';
  5254. iframe.src = src;
  5255. }
  5256.  
  5257.  
  5258. // [漫画星球] 获取下一页地址
  5259. function mhxqiu_nextL() {
  5260. let next = document.querySelector('#mainControlNext');
  5261. if (next) {
  5262. if (next.href === curSite.pageUrl) return
  5263. curSite.pageUrl = next.href;
  5264. //console.log(curSite.pageUrl)
  5265. getPageElems(curSite.pageUrl);
  5266. }
  5267. }
  5268. // [漫画星球] 插入数据
  5269. function mhxqiu_insertE(pageElems, type) {
  5270. if (!pageElems) return
  5271. // 插入并运行 <script>
  5272. insScriptAll('//script[contains(text(), "eval") and contains(text(), "newImgs")]', document.body, pageElems);
  5273.  
  5274. // 插入图片
  5275. let _img = '';
  5276. for (let now of newImgs) {
  5277. _img += `<li><div style="display: inline-block;zoom: 1;"><img src="${now}" class="loaded lazy" style="opacity: 1;box-shadow:none;"></div></li>`;
  5278. }
  5279. if (_img) {
  5280. // 将 img 标签插入到网页中
  5281. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  5282.  
  5283. // 添加历史记录
  5284. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  5285.  
  5286. // 当前页码 + 1
  5287. pageNum.now = pageNum._now + 1
  5288.  
  5289. // 替换元素
  5290. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  5291. repE = getAll(curSite.pager.replaceE, pageElems, pageElems);
  5292. if (oriE.length === repE.length) {
  5293. for (let i = 0; i < oriE.length; i++) {
  5294. oriE[i].outerHTML = repE[i].outerHTML;
  5295. }
  5296. }
  5297. }
  5298. }
  5299.  
  5300.  
  5301. // [风之动漫] 获取下一页地址
  5302. function fffdm_nextL() {
  5303. let next = getXpath('//a[contains(text(), "下一页") or contains(text(), "下一话")]');
  5304. if (next) {
  5305. if (next.href === curSite.pageUrl) return
  5306. curSite.pageUrl = next.href;
  5307. getPageElems(curSite.pageUrl);
  5308. }
  5309. }
  5310. // [风之动漫] 插入数据
  5311. function fffdm_insertE(pageElems, type) {
  5312. if (!pageElems) return
  5313. // 插入并运行 <script>
  5314. let scriptElems = getXpath('id("main")/script[contains(text(), "mhpicurl")][1]', pageElems, pageElems);
  5315. if (scriptElems) {
  5316. document.body.appendChild(document.createElement('script')).textContent = scriptElems.textContent.replace(/document\.write.+/, '');
  5317. //insScriptAll('id("main")/script[contains(text(), "mhpicurl")][1]', document.body, pageElems);
  5318.  
  5319. // 插入图片
  5320. setTimeout(function() {
  5321. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).appendChild(document.createElement('img')).src = mhpicurl;
  5322.  
  5323. // 添加历史记录
  5324. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  5325.  
  5326. // 当前页码 + 1
  5327. pageNum.now = pageNum._now + 1
  5328.  
  5329. // 替换元素
  5330. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  5331. repE = getAll(curSite.pager.replaceE, pageElems, pageElems);
  5332. if (oriE.length === repE.length) {
  5333. for (let i = 0; i < oriE.length; i++) {
  5334. oriE[i].outerHTML = repE[i].outerHTML;
  5335. }
  5336. }
  5337. }, 100)
  5338. }
  5339. }
  5340.  
  5341.  
  5342. // [古风漫画网] 获取下一页地址
  5343. function gufengmh_nextL() {
  5344. let pageElems = document.querySelector(curSite.pager.pageE.replace('css;', '')); // 寻找数据所在元素
  5345. if (pageElems) {
  5346. let comicUrl, nextId;
  5347. var url = '';
  5348. pageElems.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  5349. //console.log(one)
  5350. if (one.indexOf('comicUrl') > -1) { // 下一页 URL 前半部分
  5351. comicUrl = one.split('"')[1];
  5352. } else if (one.indexOf('nextChapterData') > -1) { // 下一页 URL 的后半部分 ID
  5353. nextId = one.split('"id":')[1].split(',')[0];
  5354. }
  5355. })
  5356. if (comicUrl && nextId && nextId != 'null') { // 组合到一起就是下一页 URL
  5357. url = comicUrl + nextId + '.html'
  5358. if (url === curSite.pageUrl) return
  5359. curSite.pageUrl = url
  5360. getPageElems(curSite.pageUrl); // 访问下一页 URL 获取
  5361. }
  5362. }
  5363. }
  5364. // [古风漫画网] 插入数据
  5365. function gufengmh_insertE(pageElems, type) {
  5366. if (pageElems) {
  5367. let url = curSite.pageUrl;
  5368. pageElems = getOne(curSite.pager.pageE, pageElems, pageElems);
  5369. let chapterImages, chapterPath;
  5370. document.querySelector(curSite.pager.pageE.replace('css;', '')).innerText = pageElems.textContent; // 将当前网页内的数据所在元素内容改为刚刚获取的下一页数据内容,以便循环获取下一页 URL
  5371. pageElems.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  5372. //console.log(one)
  5373. if (one.indexOf('chapterImages') > -1) { // 图片文件名数组
  5374. chapterImages = one.replace(/^.+\[/, '').replace(']', '').replaceAll('"', '').split(',')
  5375. } else if (one.indexOf('chapterPath') > -1) { // 图片文件路径
  5376. chapterPath = one.split('"')[1];
  5377. } else if (one.indexOf('pageTitle') > -1) { // 网页标题
  5378. let title = one.split('"')[1];
  5379. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, title, url); // 添加历史记录
  5380. window.document.title = title; // 修改当前网页标题为下一页的标题
  5381. }
  5382. })
  5383. if (chapterImages && chapterPath) {
  5384. let _img = '';
  5385. chapterImages.forEach(function (one2){ // 遍历图片文件名数组,组合为 img 标签
  5386. _img += '<img src="https://res.xiaoqinre.com/' + chapterPath + one2 + '" data-index="0" style="display: inline-block;">'
  5387. })
  5388. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5389. // 当前页码 + 1
  5390. pageNum.now = pageNum._now + 1
  5391. }
  5392. }
  5393. }
  5394.  
  5395.  
  5396. // [砂之船动漫家] 的插入前函数(加载图片)
  5397. function szcdmj_bF(pageElems) {
  5398. pageElems.forEach(function (one) {
  5399. let now = one.querySelector('img[data-original]')
  5400. if (now) {
  5401. now.src = now.dataset.original;
  5402. now.style.display = 'inline';
  5403. }
  5404. });
  5405. return pageElems
  5406. }
  5407.  
  5408.  
  5409. // [Mangabz 漫画] 初始化(调整本话图片)
  5410. function mangabz_init() {
  5411. let showimage = document.getElementById('showimage'),
  5412. cp_img = document.getElementById('cp_img'),
  5413. cp_image = document.getElementById('cp_image');
  5414. if (showimage) {showimage.removeAttribute('oncontextmenu');}
  5415. if (cp_img) {cp_img.removeAttribute('oncontextmenu');}
  5416. if (cp_image) {
  5417. cp_image.removeAttribute('oncontextmenu');
  5418. cp_image.removeAttribute('id');
  5419. cp_image.removeAttribute('style');
  5420. }
  5421. }
  5422. // [Mangabz 漫画] 获取下一页地址
  5423. function mangabz_nextL() {
  5424. var url = '';
  5425. if (MANGABZ_PAGE === MANGABZ_IMAGE_COUNT) { // 下一话
  5426. url = getXpath('//a[./img[contains(@src, "icon_xiayizhang")]]')
  5427. if (url === curSite.pageUrl) return
  5428. curSite.pageUrl = url
  5429. //console.log(curSite.pageUrl)
  5430. getPageElems(curSite.pageUrl); // 访问下一话 URL 获取
  5431. } else { // 下一页
  5432. if (!mkey) var mkey = '';
  5433. 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}`
  5434. if (url === curSite.pageUrl) return
  5435. curSite.pageUrl = url
  5436. //console.log(curSite.pageUrl)
  5437. getPageElems(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
  5438. }
  5439. }
  5440. // [Mangabz 漫画] 插入数据
  5441. function mangabz_insertE(pageElems, type) {
  5442. if (pageElems) {
  5443. if (type === 'Next') {
  5444. let imgArr = eval(pageElems),
  5445. _img = '';
  5446. for (let now of imgArr) {
  5447. _img += `<img src="${now}">`;
  5448. }
  5449. if (_img) {
  5450. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5451.  
  5452. // 添加历史记录
  5453. MANGABZ_PAGE += imgArr.length;
  5454. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, document.title, location.origin + MANGABZ_CURL.substring(0, MANGABZ_CURL.length - 1) + '-p' + MANGABZ_PAGE + '/');
  5455. }
  5456. } else {
  5457. // 插入 <script> 标签
  5458. insScriptAll('css;html:not([dir]) > head > script:not([src])', document.body, pageElems);
  5459.  
  5460. // 添加历史记录
  5461. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  5462.  
  5463. // 当前页码 + 1
  5464. pageNum.now = pageNum._now + 1
  5465.  
  5466. // 替换待替换元素
  5467. let oriE = getAll(curSite.pager.replaceE),
  5468. repE = getAll(curSite.pager.replaceE, pageElems, pageElems);
  5469. if (oriE.length === repE.length) {
  5470. for (let i = 0; i < oriE.length; i++) {
  5471. oriE[i].outerHTML = repE[i].outerHTML;
  5472. }
  5473. }
  5474. MANGABZ_PAGE = 0;
  5475. mangabz_nextL();
  5476. }
  5477. }
  5478. }
  5479.  
  5480.  
  5481. // [Xmanhua 漫画] 获取下一页地址
  5482. function xmanhua_nextL() {
  5483. var url = '';
  5484. if (XMANHUA_PAGE === XMANHUA_IMAGE_COUNT) { // 下一话
  5485. url = getXpath('//a[./img[contains(@src, "reader-bottom-right-2.png")]]')
  5486. if (url === curSite.pageUrl) return
  5487. curSite.pageUrl = url
  5488. //console.log(curSite.pageUrl)
  5489. getPageElems(curSite.pageUrl); // 访问下一话 URL 获取
  5490. } else { // 下一页
  5491. if (!mkey) var mkey = '';
  5492. url = location.origin + location.pathname + 'chapterimage.ashx' + `?cid=${XMANHUA_CID}&page=${XMANHUA_PAGE + 1}&key=${(mkey)}&_cid=${XMANHUA_CID}&_mid=${XMANHUA_MID}&_dt=${XMANHUA_VIEWSIGN_DT}&_sign=${XMANHUA_VIEWSIGN}`
  5493. if (url === curSite.pageUrl) return
  5494. curSite.pageUrl = url
  5495. //console.log(curSite.pageUrl)
  5496. getPageElems(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
  5497. }
  5498. }
  5499. // [Xmanhua 漫画] 插入数据
  5500. function xmanhua_insertE(pageElems, type) {
  5501. if (pageElems) {
  5502. if (type === 'Next') {
  5503. let imgArr = eval(pageElems),
  5504. _img = '';
  5505. for (let now of imgArr) {
  5506. _img += `<img src="${now}">`;
  5507. }
  5508. if (_img) {
  5509. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5510.  
  5511. // 添加历史记录
  5512. XMANHUA_PAGE += imgArr.length;
  5513. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, document.title, location.origin + XMANHUA_CURL.substring(0, XMANHUA_CURL.length - 1) + '-p' + XMANHUA_PAGE + '/');
  5514. }
  5515. } else {
  5516. // 插入 <script> 标签
  5517. insScriptAll('css;html:not([dir]) > head > script:not([src])', document.body, pageElems);
  5518.  
  5519. // 添加历史记录
  5520. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  5521.  
  5522. // 当前页码 + 1
  5523. pageNum.now = pageNum._now + 1
  5524.  
  5525. // 替换待替换元素
  5526. let oriE = getAll(curSite.pager.replaceE),
  5527. repE = getAll(curSite.pager.replaceE, pageElems, pageElems);
  5528. if (oriE.length === repE.length) {
  5529. for (let i = 0; i < oriE.length; i++) {
  5530. oriE[i].outerHTML = repE[i].outerHTML;
  5531. }
  5532. }
  5533. XMANHUA_PAGE = 0;
  5534. xmanhua_nextL();
  5535. }
  5536. }
  5537. }
  5538.  
  5539.  
  5540. // [COCOMANGA 漫画] 初始化(调整本话图片)
  5541. function cocomanga_init() {
  5542. let last = document.querySelector('.mh_comicpic:last-of-type');
  5543. if (last && last.getAttribute('p')) {
  5544. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).innerHTML = ''; // 删除旧图片元素
  5545. cocomanga_img(parseInt(last.getAttribute('p'))) // 插入新图片元素
  5546. }
  5547. }
  5548. // [COCOMANGA 漫画] 生成图片元素并插入网页
  5549. function cocomanga_img(totalImageCount) {
  5550. if (totalImageCount < 1) return
  5551. let _img = '';
  5552. for (let i=1; i<=totalImageCount; i++) {
  5553. _img += `<div class="mh_comicpic" p="${i}"><img src="${__cr.getPicUrl(i)}"></div>`;
  5554. }
  5555. document.querySelector(curSite.pager.insertP[0].replace('css;', '')).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5556. }
  5557. // [COCOMANGA 漫画] 获取下一页地址
  5558. function cocomanga_nextL() {
  5559. var url = '';
  5560. url = getXpath('//a[contains(@class, "read_page_link") and contains(string(), "下一章")][not(contains(@href, "javascript"))]')
  5561. if (url === curSite.pageUrl) return
  5562. curSite.pageUrl = url
  5563. getPageElems(curSite.pageUrl); // 访问下一话 URL 获取
  5564. }
  5565. // [COCOMANGA 漫画] 插入数据
  5566. function cocomanga_insertE(pageElems, type) {
  5567. if (pageElems) {
  5568. // 插入 <script> 标签
  5569. insScriptAll('css;head > script:not([src]), script[src*="custom.js"], script[src*="dynamicjs.js"]', document.body, pageElems);
  5570.  
  5571. // 插入新图片元素
  5572. setTimeout(function() {
  5573. let totalImageCount = __cdecrypt('fw122587mkertyui', CryptoJS.enc.Base64.parse(mh_info.enc_code1).toString(CryptoJS.enc.Utf8));
  5574. if (!totalImageCount) totalImageCount = __cdecrypt('fw12558899ertyui', CryptoJS.enc.Base64.parse(mh_info.enc_code1).toString(CryptoJS.enc.Utf8));
  5575. cocomanga_img(parseInt(totalImageCount));
  5576. }, 100)
  5577.  
  5578. // 添加历史记录
  5579. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, pageElems.querySelector('title').textContent, curSite.pageUrl);
  5580.  
  5581. // 当前页码 + 1
  5582. pageNum.now = pageNum._now + 1
  5583.  
  5584. // 替换元素
  5585. let oriE = document.querySelectorAll(curSite.pager.replaceE.replace('css;', '')),
  5586. repE = getAll(curSite.pager.replaceE, pageElems, pageElems);
  5587. if (oriE.length === repE.length) {
  5588. for (let i = 0; i < oriE.length; i++) {
  5589. oriE[i].outerHTML = repE[i].outerHTML;
  5590. }
  5591. }
  5592. }
  5593. }
  5594. // [COCOMANGA 漫画 - 列表页] 获取下一页地址
  5595. function cocomanga_list_nextL() {
  5596. let pageActive = parseInt(document.querySelector('.fed-page-info a.fed-btns-green').innerText);
  5597. if (/page=\d+/.test(location.search)) {
  5598. return (location.origin + location.pathname + location.search.replace(/page=\d+/,`page=${pageActive+1}`))
  5599. } else {
  5600. if (!location.search) return (location.origin + location.pathname + `?page=${pageActive+1}`)
  5601. return (location.origin + location.pathname + location.search + `&page=${pageActive+1}`)
  5602. }
  5603. }
  5604.  
  5605.  
  5606. // 自动无缝翻页
  5607. function pageLoading() {
  5608. if (curSite.SiteTypeID > 0) {
  5609. windowScroll(function (direction, e) {
  5610. if (direction === 'down' && pausePage === true && curSite.SiteTypeID > 0) { // 下滑 且 未暂停翻页 且 SiteTypeID > 0 时,才准备翻页
  5611. let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop,
  5612. scrollHeight = window.innerHeight || document.documentElement.clientHeight,
  5613. scrollD = curSite.pager.scrollD;
  5614. if (curSite.pager.type === 3) { // <<<<< 翻页类型 3(依靠元素距离可视区域底部的距离来触发翻页)>>>>>
  5615. let scrollE = getOne(curSite.pager.scrollE);
  5616. //console.log(scrollE.offsetTop - (scrollTop + scrollHeight), scrollD, curSite.SiteTypeID)
  5617. if (scrollE.offsetTop - (scrollTop + scrollHeight) <= scrollD) {
  5618. ShowPager.loadMorePage();
  5619. }
  5620.  
  5621. } else {
  5622. if (document.documentElement.scrollHeight <= scrollHeight + scrollTop + scrollD) {
  5623.  
  5624. if (curSite.pager.type === 1) { // <<<<< 翻页类型 1(由脚本实现自动无缝翻页)>>>>>
  5625. ShowPager.loadMorePage();
  5626.  
  5627. } else if (curSite.pager.type === 2) { // <<<<< 翻页类型 2(网站自带了自动无缝翻页功能,只需要点击下一页按钮即可)>>>>>
  5628. let autopbn = getOne(curSite.pager.nextL);
  5629. if (autopbn) { // 寻找下一页链接
  5630. if (!(curSite.pager.isHidden) || (curSite.pager.isHidden && !isHidden(autopbn))) { // 如果 isHidden = true,那么需要判断元素是否隐藏
  5631. if (curSite.pager.nextText) {
  5632. // 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页
  5633. if (autopbn.innerText === curSite.pager.nextText) {
  5634. autopbn.click();
  5635. pageNum.now = pageNum._now + 1; // 当前页码 + 1
  5636. }
  5637. } else if (curSite.pager.nextTextOf) {
  5638. // 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页
  5639. if (autopbn.innerText.indexOf(curSite.pager.nextTextOf) > -1) {
  5640. autopbn.click();
  5641. pageNum.now = pageNum._now + 1; // 当前页码 + 1
  5642. }
  5643. } else if (curSite.pager.nextHTML) {
  5644. // 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页
  5645. if (autopbn.innerHTML === curSite.pager.nextHTML) {
  5646. autopbn.click();
  5647. pageNum.now = pageNum._now + 1; // 当前页码 + 1
  5648. }
  5649. } else {
  5650. // 如果没有指定按钮文字就直接点击
  5651. autopbn.click();
  5652. pageNum.now = pageNum._now + 1; // 当前页码 + 1
  5653. // 对于没有按钮文字变化的按钮,可以指定间隔时间(默认 300ms)
  5654. if (!curSite.pager.interval) curSite.pager.interval = 300;
  5655. let _SiteTypeID = curSite.SiteTypeID; curSite.SiteTypeID = 0;
  5656. setTimeout(function(){curSite.SiteTypeID = _SiteTypeID;}, curSite.pager.interval)
  5657. }
  5658. }
  5659. }
  5660.  
  5661. } else if (curSite.pager.type === 4) { // <<<<< 翻页类型 4(部分简单的动态加载类网站)>>>>>
  5662. // 为百度贴吧的发帖考虑,预留底部一小部分...
  5663. if (!(document.documentElement.scrollHeight <= scrollHeight + scrollTop + 200 && curSite.SiteTypeID === SiteType.BAIDU_TIEBA)) {
  5664. curSite.pager.nextL();
  5665. }
  5666. if (curSite.pager.interval) {
  5667. let _SiteTypeID = curSite.SiteTypeID;
  5668. curSite.SiteTypeID = 0;
  5669. setTimeout(function(){curSite.SiteTypeID = _SiteTypeID;}, curSite.pager.interval)
  5670. }
  5671. }
  5672. }
  5673. }
  5674. }
  5675. });
  5676. }
  5677. }
  5678. // 判断是支持
  5679. function doesItSupport() {
  5680. setDBSite(); // 配置 DBSite 变量对象
  5681.  
  5682. // 遍历判断是否是某个已支持的网站,顺便直接赋值
  5683. let support = false;
  5684. for (let now in DBSite) { // 遍历对象
  5685. if (!DBSite[now].host) continue; // 如果不存在则继续下一个循环
  5686. if (Array.isArray(DBSite[now].host)) { // 如果是数组
  5687. for (let i of DBSite[now].host) { // 遍历数组
  5688. if (i === location.host) {
  5689. if (DBSite[now].functionStart) {
  5690. DBSite[now].functionStart();
  5691. } else {
  5692. curSite = DBSite[now];
  5693. }
  5694. support = true; break; // 如果找到了就退出循环
  5695. }
  5696. }
  5697. } else if (DBSite[now].host instanceof RegExp) {
  5698. if (DBSite[now].host.test(location.host)) {
  5699. if (self != top) {if (!DBSite[now].iframe) break;} // 如果当前位于 iframe 框架下,就需要判断是否需要执行
  5700. if (DBSite[now].functionStart) {
  5701. DBSite[now].functionStart();
  5702. } else {
  5703. curSite = DBSite[now];
  5704. }
  5705. support = true; break; // 如果找到了就退出循环
  5706. }
  5707. } else if (DBSite[now].host === location.host) {
  5708. if (self != top) {if (!DBSite[now].iframe) break;} // 如果当前位于 iframe 框架下,就需要判断是否需要执行
  5709. if (DBSite[now].functionStart) {
  5710. DBSite[now].functionStart();
  5711. } else {
  5712. curSite = DBSite[now];
  5713. }
  5714. support = true; break; // 如果找到了就退出循环
  5715. }
  5716. }
  5717.  
  5718. if (support) {
  5719. console.info('[自动无缝翻页] - 独立规则 网站'); return 1;
  5720. } else if (document.querySelector('meta[name="author" i][content*="Discuz!" i], meta[name="generator" i][content*="Discuz!" i], body[id="nv_forum" i][class^="pg_" i][onkeydown*="27"], body[id="nv_search" i][onkeydown*="27"]') || (document.querySelector('a[href*="www.discuz.net" i]') && document.querySelector('a[href*="www.discuz.net" i]').textContent.indexOf('Discuz!') > -1) || (document.getElementById('ft') && document.getElementById('ft').textContent.indexOf('Discuz!') > -1)) {
  5721. console.info('[自动无缝翻页] - <Discuz!> 论坛'); return 2;
  5722. } else if (document.getElementById('flarum-loading')) {
  5723. console.info('[自动无缝翻页] - <Flarum> 论坛'); return 3;
  5724. } else if (document.querySelector('body#phpbb')) {
  5725. console.info('[自动无缝翻页] - <phpBB> 论坛'); return 4;
  5726. } else if (getXpath('//footer//a[contains(string(), "Xiuno")] | //link[contains(@href, "xiuno")] | //script[contains(@src, "xiuno")]')) {
  5727. console.info('[自动无缝翻页] - <Xiuno> 论坛'); return 5;
  5728. } else if (typeof XF != 'undefined') {
  5729. console.info('[自动无缝翻页] - <XenForo> 论坛'); return 6;
  5730. } else if (document.querySelector('link[href*="themes/dux" i], script[src*="themes/dux" i]')) {
  5731. console.info('[自动无缝翻页] - 使用 WordPress <DUX> 主题的网站'); return 100;
  5732. } else if (document.querySelector('link[href*="themes/xiu" i], script[src*="themes/xiu" i]')) {
  5733. console.info('[自动无缝翻页] - 使用 WordPress <XIU> 主题的网站'); return 101;
  5734. } else if (document.querySelector('link[href*="themes/d8" i], script[src*="themes/d8" i]')) {
  5735. console.info('[自动无缝翻页] - 使用 WordPress <D8> 主题的网站'); return 102;
  5736. } else if (document.querySelector('link[href*="themes/begin" i], script[src*="themes/begin" i], img[src*="themes/begin" i]')) {
  5737. console.info('[自动无缝翻页] - 使用 WordPress <Begin> 主题的网站'); return 103;
  5738. } else if (document.querySelector('meta[name="description"][content*="小说"], meta[name="description"][content*="章节"], meta[name="description"][content*="阅读"]') && document.getElementById('content') && getXpath('//a[contains(text(), "下一章") or contains(text(), "下一页")]')) {
  5739. console.info('[自动无缝翻页] - <笔趣阁> 模板的小说网站'); return 200;
  5740. } else if (self != top) {
  5741. return -1;
  5742. }
  5743. return 0;
  5744. }
  5745. // 翻页类型 4 专用
  5746. function getPageElems(url, type = '', method = 'GET', data = '', type2) {
  5747. let mimeType;
  5748. switch (type) {
  5749. case 'json':
  5750. mimeType = 'application/json; charset=' + document.charset; break;
  5751. case 'text':
  5752. mimeType = 'text/plain; charset=' + document.charset; break;
  5753. default:
  5754. mimeType = 'text/html; charset=' + document.charset;
  5755. }
  5756.  
  5757. GM_xmlhttpRequest({
  5758. url: url,
  5759. method: method,
  5760. data: data,
  5761. responseType: type,
  5762. overrideMimeType: mimeType,
  5763. headers: {
  5764. 'Referer': location.href,
  5765. 'Content-Type': (method === 'POST') ? 'application/x-www-form-urlencoded':''
  5766. },
  5767. timeout: 10000,
  5768. onload: function (response) {
  5769. try {
  5770. //console.log('最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  5771. switch (type) {
  5772. case 'json':
  5773. curSite.pager.insertE(response.response, type2);
  5774. break;
  5775. case 'text':
  5776. curSite.pager.insertE(response.responseText, type2)
  5777. break;
  5778. default:
  5779. curSite.pager.insertE(ShowPager.createDocumentByString(response.responseText), type2)
  5780. }
  5781. } catch (e) {
  5782. console.log(e);
  5783. }
  5784. }
  5785. });
  5786. }
  5787.  
  5788. // 修改自 https://greasyfork.org/scripts/14178 , https://github.com/machsix/Super-preloader
  5789. var ShowPager = {
  5790. getFullHref: function (e) {
  5791. if (e != null && e.nodeType === 1 && e.href && e.href.slice(0,4) === 'http') return e.href;
  5792. return '';
  5793. },
  5794. createDocumentByString: function (e) {
  5795. if (e) {
  5796. if ('HTML' !== document.documentElement.nodeName) return (new DOMParser).parseFromString(e, 'application/xhtml+xml');
  5797. var t;
  5798. try { t = (new DOMParser).parseFromString(e, 'text/html');} catch (e) {}
  5799. if (t) return t;
  5800. if (document.implementation.createHTMLDocument) {
  5801. t = document.implementation.createHTMLDocument('ADocument');
  5802. } else {
  5803. 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) {}
  5804. }
  5805. if (t) {
  5806. var r = document.createRange(),
  5807. n = r.createContextualFragment(e);
  5808. r.selectNodeContents(document.body);
  5809. t.body.appendChild(n);
  5810. 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);
  5811. return t;
  5812. }
  5813. } else console.error('没有找到要转成 DOM 的字符串');
  5814. },
  5815. loadMorePage: function () {
  5816. if (curSite.pager) {
  5817. var url;
  5818. if (typeof curSite.pager.nextL == 'function') {
  5819. url = curSite.pager.nextL();
  5820. } else {
  5821. if (curSite.pager.nextL.slice(0,4) === 'css;') {
  5822. url = this.getFullHref(getCSS(curSite.pager.nextL.slice(4)));
  5823. } else {
  5824. url = this.getFullHref(getXpath(curSite.pager.nextL));
  5825. }
  5826. }
  5827. //console.log(url, curSite.pageUrl);
  5828. if (url === '') return;
  5829. if (curSite.pager.forceHTTPS && location.protocol === 'https:') {url = url.replace(/^http:/,'https:');}
  5830. if (curSite.pageUrl === url) return;// 避免重复加载相同的页面
  5831. curSite.pageUrl = url;
  5832. // 读取下一页的数据
  5833. GM_xmlhttpRequest({
  5834. url: url,
  5835. method: 'GET',
  5836. overrideMimeType: 'text/html; charset=' + document.charset,
  5837. headers: {
  5838. 'Referer': location.href
  5839. },
  5840. timeout: 10000,
  5841. onload: function (response) {
  5842. try {
  5843. //console.log('最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  5844. processResult(ShowPager.createDocumentByString(response.responseText));
  5845. } catch (e) {
  5846. console.log(e);
  5847. }
  5848. }
  5849. });
  5850. }
  5851. },
  5852. };
  5853. // XHR 后处理结果
  5854. function processResult(response) {
  5855. var newBody = response;
  5856. let pageElems = getAll(curSite.pager.pageE, newBody, newBody),
  5857. toElement = getAll(curSite.pager.insertP[0])[0];
  5858. //console.log(curSite.pager.pageE, pageElems, curSite.pager.insertP, toElement)
  5859.  
  5860. if (pageElems.length > 0) {
  5861. // 如果有插入前函数就执行函数
  5862. if (curSite.function && curSite.function.bF) {
  5863. if (curSite.function.pF) { // 如果指定了参数
  5864. pageElems = curSite.function.bF(pageElems, curSite.function.pF);
  5865. } else {
  5866. pageElems = curSite.function.bF(pageElems);
  5867. }
  5868. }
  5869.  
  5870. // 插入位置
  5871. let addTo = getAddTo(curSite.pager.insertP[1]);
  5872.  
  5873. // 插入新页面元素
  5874. if (curSite.pager.insertP[1] === 2 || curSite.pager.insertP[1] === 4) { // 插入到元素内头部、目标本身后面,需要合并后一起插入,否则会顺序相反
  5875. let afterend = '';
  5876. pageElems.forEach(function (one) {afterend += one.outerHTML;});
  5877. toElement.insertAdjacentHTML(addTo, afterend);
  5878. } else if (curSite.pager.insertP[1] === 5) { // 插入到目标内部末尾(针对文本)
  5879. let afterend = '';
  5880. pageElems.forEach(function (one) {afterend += one.innerHTML;});
  5881. toElement.insertAdjacentHTML(addTo, afterend);
  5882. } else {
  5883. pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo, one);});
  5884. }
  5885.  
  5886. // 当前页码 + 1
  5887. pageNum.now = pageNum._now + 1
  5888.  
  5889. // 插入 <script> 标签
  5890. if (curSite.pager.scriptT) {
  5891. let scriptText = '';
  5892. if (curSite.pager.scriptT === 1) { // 下一页的所有 <script> 标签
  5893. insScriptAll('//script', toElement, newBody);
  5894. } else if (curSite.pager.scriptT === 2) { // 下一页主体元素同级 <script> 标签
  5895. pageElems.forEach(function (one) {if (one.tagName === 'SCRIPT') {scriptText += ';' + one.textContent;}});
  5896. if (scriptText) toElement.appendChild(document.createElement('script')).textContent = scriptText;
  5897. } else if (curSite.pager.scriptT === 3) { // 下一页主体元素同级 <script> 标签(远程文件)
  5898. pageElems.forEach(function (one) {if (one.tagName === 'SCRIPT' && one.src) {toElement.appendChild(document.createElement('script')).src = one.src;}});
  5899. } else if (curSite.pager.scriptT === 4) { // 下一页主体元素子元素 <script> 标签
  5900. pageElems.forEach(function (one) {
  5901. const scriptElems = one.querySelectorAll('script');
  5902. scriptElems.forEach(function (script) {scriptText += ';' + script.textContent;});
  5903. });
  5904. if (scriptText) toElement.appendChild(document.createElement('script')).textContent = scriptText;
  5905. }
  5906. }
  5907.  
  5908. // 添加历史记录
  5909. if (curSite.pager.history) {
  5910. let title_ = newBody.querySelector('title');
  5911. if (title_) {title_ = title_.textContent;} else {title_ = document.title;};
  5912. window.history.pushState(`{title: ${document.title}, url: ${location.href}}`, title_, curSite.pageUrl);
  5913. }
  5914.  
  5915. // 替换待替换元素
  5916. if (curSite.pager.replaceE) {
  5917. try {
  5918. let oriE = getAll(curSite.pager.replaceE),
  5919. repE = getAll(curSite.pager.replaceE, newBody, newBody);
  5920. //console.log(oriE, repE);
  5921. if (oriE.length === repE.length) {
  5922. for (let i = 0; i < oriE.length; i++) {
  5923. oriE[i].outerHTML = repE[i].outerHTML;
  5924. }
  5925. }
  5926. } catch (e) {
  5927. console.log(e);
  5928. }
  5929. }
  5930.  
  5931. // 如果有插入后函数就执行函数
  5932. if (curSite.function && curSite.function.aF) {
  5933. if (curSite.function.pF) { // 如果指定了参数
  5934. curSite.function.aF(curSite.function.pF);
  5935. } else {
  5936. curSite.function.aF();
  5937. }
  5938. }
  5939. } else { // 获取主体元素失败后,尝试重新获取
  5940. if (curSite.SiteTypeID === SiteType.BILIBILI_SEARCH) {curSite.pageUrl = '';}
  5941. }
  5942. }
  5943. // 插入所有 Script
  5944. function insScriptAll(selector = '//script', toElement = document.body, contextNode = document) {
  5945. let scriptElems = getAll(selector, contextNode, contextNode), scriptText = '';
  5946. scriptElems.forEach(function (one) {
  5947. if (one.src) {
  5948. toElement.appendChild(document.createElement('script')).src = one.src;
  5949. } else {
  5950. scriptText += one.textContent + ';';
  5951. }
  5952. });
  5953. if (scriptText) toElement.appendChild(document.createElement('script')).textContent = scriptText;
  5954. }
  5955. // 获取元素(CSS/Xpath)
  5956. function getCSS(css, contextNode = document) {
  5957. return contextNode.querySelector(css);
  5958. }
  5959. function getAllCSS(css, contextNode = document) {
  5960. return [].slice.call(contextNode.querySelectorAll(css));
  5961. }
  5962. function getXpath(xpath, contextNode, doc = document) {
  5963. contextNode = contextNode || doc;
  5964. try {
  5965. const result = doc.evaluate(xpath, contextNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  5966. // 应该总是返回一个元素节点
  5967. return result.singleNodeValue && result.singleNodeValue.nodeType === 1 && result.singleNodeValue;
  5968. } catch (err) {
  5969. throw new Error(`无效 Xpath: ${xpath}`);
  5970. }
  5971. }
  5972. function getAllXpath(xpath, contextNode, doc = document) {
  5973. contextNode = contextNode || doc;
  5974. const result = [];
  5975. try {
  5976. const query = doc.evaluate(xpath, contextNode, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  5977. for (let i = 0; i < query.snapshotLength; i++) {
  5978. const node = query.snapshotItem(i);
  5979. // 如果是 Element 节点
  5980. if (node.nodeType === 1) result.push(node);
  5981. }
  5982. } catch (err) {
  5983. throw new Error(`无效 Xpath: ${xpath}`);
  5984. }
  5985. return result;
  5986. }
  5987. function getOne(selector, contextNode = undefined, doc = document) {
  5988. if (!selector) return;
  5989. contextNode = contextNode || doc;
  5990. if (selector.search(/^css;/i) === 0) {
  5991. return getCSS(selector.slice(4), contextNode);
  5992. } else {
  5993. return getXpath(selector, contextNode, doc);
  5994. }
  5995. }
  5996. function getAll(selector, contextNode = undefined, doc = document) {
  5997. if (!selector) return [];
  5998. contextNode = contextNode || doc;
  5999. if (selector.search(/^css;/i) === 0) {
  6000. return getAllCSS(selector.slice(4), contextNode);
  6001. } else {
  6002. return getAllXpath(selector, contextNode, doc);
  6003. }
  6004. }
  6005.  
  6006. // 启用/禁用 (当前网站)
  6007. function menu_disable(type) {
  6008. switch(type) {
  6009. case 'check':
  6010. if(check()) {return true;} else {return false;}; break;
  6011. case 'add':
  6012. add(); break;
  6013. case 'del':
  6014. del(); break;
  6015. }
  6016.  
  6017. function check() { // 存在返回真,不存在返回假
  6018. let list = GM_getValue('menu_disable'); // 读取网站列表
  6019. if (list.indexOf(location.host) === -1) return false // 不存在返回假
  6020. return true
  6021. }
  6022.  
  6023. function add() {
  6024. if (check()) return
  6025. let list = GM_getValue('menu_disable'); // 读取网站列表
  6026. list.push(location.host); // 追加网站域名
  6027. GM_setValue('menu_disable', list); // 写入配置
  6028. location.reload(); // 刷新网页
  6029. }
  6030.  
  6031. function del() {
  6032. if (!check()) return
  6033. let list = GM_getValue('menu_disable'), // 读取网站列表
  6034. index = list.indexOf(location.host);
  6035. list.splice(index, 1); // 删除网站域名
  6036. GM_setValue('menu_disable', list); // 写入配置
  6037. location.reload(); // 刷新网页
  6038. }
  6039. }
  6040. // 左键双击网页空白处暂停翻页
  6041. function pausePageEvent() {
  6042. if (!GM_getValue('menu_pause_page')) return
  6043. if (curSite.SiteTypeID === 0) return
  6044. document.body.addEventListener('dblclick', function () {
  6045. if (pausePage) {
  6046. pausePage = false;
  6047. GM_notification({text: `❌ 已暂停本页 [自动无缝翻页]\n (再次双击可恢复)`, timeout: 2000});
  6048. } else {
  6049. pausePage = true;
  6050. GM_notification({text: `✅ 已恢复本页 [自动无缝翻页]\n (再次双击可暂停)`, timeout: 2000});
  6051. }
  6052. });
  6053. }
  6054. // 显示页码
  6055. function pageNumber(type) {
  6056. if (curSite.SiteTypeID === 0 || curSite.hiddenPN) {let status = document.getElementById('Autopage_number');if (status) {status.style.display = 'none';}; return}
  6057. let status = document.getElementById('Autopage_number');
  6058. switch (type) {
  6059. case 'add':
  6060. add(); break;
  6061. case 'del':
  6062. del(); break;
  6063. case 'set':
  6064. set(); break;
  6065. }
  6066.  
  6067. function add(){
  6068. if (status) {
  6069. if (status.style.display === 'none') {status.style.display = 'flex';}
  6070. return
  6071. }
  6072. // 插入网页
  6073. 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>
  6074. <div id="Autopage_number" title="1. 此处数字为 [当前页码] (可在脚本菜单中关闭)&#10;&#10;2. 鼠标左键点击此处 [临时暂停本页自动无缝翻页](再次点击可恢复)">${pageNum._now}</div>`
  6075. document.body.insertAdjacentHTML('beforeend', _html);
  6076. // 点击事件(临时暂停翻页)
  6077. document.getElementById('Autopage_number').onclick = function () {
  6078. if (pausePage) {
  6079. pausePage = false; this.style = 'color: #FF5722 !important; font-style: italic !important;';
  6080. } else {
  6081. pausePage = true; this.style = '';
  6082. }
  6083. };
  6084. status = document.getElementById('Autopage_number');
  6085. set();
  6086. }
  6087. // 监听储存当前页码的对象值的变化
  6088. function set(){
  6089. Object.defineProperty(pageNum, 'now', {
  6090. set: function(value) {
  6091. this._now = value;
  6092. if (status) status.textContent = value;
  6093. }
  6094. });
  6095. }
  6096. function del(){
  6097. if (!status) return
  6098. status.style.display = 'none';
  6099. }
  6100. }
  6101. // 菜单开关
  6102. function menu_switch(menu_status, Name, Tips) {
  6103. if (menu_status === true){
  6104. GM_setValue(Name, false);
  6105. } else {
  6106. GM_setValue(Name, true);
  6107. }
  6108. if (Name === 'menu_page_number') {
  6109. if (menu_status === true){pageNumber('del');} else {pageNumber('add');}
  6110. registerMenuCommand(); // 重新注册脚本菜单
  6111. } else {
  6112. location.reload();}
  6113. };
  6114. // 生成 SiteTypeID
  6115. function setSiteTypeID() {
  6116. let num = 0
  6117. for (let val in DBSite) {
  6118. DBSite[val].SiteTypeID = num = num + 1;
  6119. }
  6120. }
  6121. // 获取 Cookie
  6122. function getCookie(name) {
  6123. if (!name) return ''
  6124. let arr = document.cookie.split(';');
  6125. name += '='
  6126. for (let i=0; i<arr.length; i++) {
  6127. let now = arr[i].trim();
  6128. if (now.indexOf(name) == 0) return now.substring(name.length, now.length);
  6129. }
  6130. return '';
  6131. }
  6132. // 插入位置
  6133. function getAddTo(num) {
  6134. switch (num) {
  6135. case 1:
  6136. return 'beforebegin'; break;
  6137. case 2:
  6138. return 'afterbegin'; break;
  6139. case 3:
  6140. return 'beforeend'; break;
  6141. case 4:
  6142. return 'afterend'; break;
  6143. case 5:
  6144. return 'beforeend'; break;
  6145. }
  6146. }
  6147. // 滚动条事件
  6148. function windowScroll(fn1) {
  6149. var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  6150. fn = fn1 || function () {};
  6151. setTimeout(function () { // 延时 1 秒执行,避免刚载入到页面就触发翻页事件
  6152. window.addEventListener('scroll', function (e) {
  6153. var afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  6154. delta = afterScrollTop - beforeScrollTop;
  6155. if (delta == 0) return false;
  6156. fn(delta > 0 ? 'down' : 'up', e);
  6157. beforeScrollTop = afterScrollTop;
  6158. }, false);
  6159. }, 1000)
  6160. }
  6161. // 自定义 locationChange 事件(用来监听 URL 变化)
  6162. function addLocationchange() {
  6163. history.pushState = ( f => function pushState(){
  6164. var ret = f.apply(this, arguments);
  6165. window.dispatchEvent(new Event('pushstate'));
  6166. window.dispatchEvent(new Event('locationChange'));
  6167. return ret;
  6168. })(history.pushState);
  6169.  
  6170. history.replaceState = ( f => function replaceState(){
  6171. var ret = f.apply(this, arguments);
  6172. window.dispatchEvent(new Event('replacestate'));
  6173. window.dispatchEvent(new Event('locationChange'));
  6174. return ret;
  6175. })(history.replaceState);
  6176.  
  6177. window.addEventListener('popstate',()=>{
  6178. window.dispatchEvent(new Event('locationChange'))
  6179. });
  6180. }
  6181. // 判断元素是否隐藏(隐藏返回 true)
  6182. function isHidden(el){
  6183. return (el.offsetParent === null);
  6184. }
  6185. /*// 监听 XMLHttpRequest URL
  6186. var _send = window.XMLHttpRequest.prototype.send
  6187. function sendReplacement(data) {
  6188. console.log(data)
  6189. return _send.apply(this, arguments);
  6190. }
  6191. window.XMLHttpRequest.prototype.send = sendReplacement;
  6192. // 监听 XMLHttpRequest 模式(GET/POST)和数据
  6193. var _open = window.XMLHttpRequest.prototype.open
  6194. function openReplacement(data) {
  6195. console.log(data, arguments)
  6196. return _open.apply(this, arguments);
  6197. }
  6198. window.XMLHttpRequest.prototype.open = openReplacement;*/
  6199. })();