自动无缝翻页

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

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

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