自动无缝翻页

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

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

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