自动无缝翻页

无缝拼接下一页内容(瀑布流),目前支持:[所有使用「Discuz!、Flarum、DUX(WordPress)」的网站]、百度、谷歌、必应、搜狗、头条搜索、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-10 提交的版本,查看 最新版本

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