自动无缝翻页

无缝拼接下一页内容(瀑布流),目前支持:[所有「Discuz!、Flarum、phpBB、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、HiComic、动漫之家、古风漫画网、PubMed、wikiHow、GreasyFork、Github、StackOverflow(以上仅一部分,更多的写不下了...

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

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