自动无缝翻页

无缝拼接下一页内容(瀑布流),目前支持:【所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、NexusPHP」论坛】【百度、谷歌、必应、搜狗、微信、360、Yahoo、Yandex 等搜索引擎】、贴吧、豆瓣、知乎、微博、NGA、V2EX、B 站(Bilibili)、煎蛋网、糗事百科、龙的天空、起点中文、IT之家、千图网、Pixabay、Pixiv、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、小众软件、【动漫狂、漫画猫、漫画屋、漫画 DB、动漫之家、拷贝漫画、包子漫画、Mangabz、Xmanhua 等漫画网站】、PubMed、Z-Library、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了...

当前为 2022-02-28 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name 自动无缝翻页
  3. // @name:zh-CN 自动无缝翻页
  4. // @name:zh-TW 自動無縫翻頁
  5. // @name:en AutoPager
  6. // @version 5.0.3
  7. // @author X.I.U
  8. // @description 无缝拼接下一页内容(瀑布流),目前支持:【所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、NexusPHP」论坛】【百度、谷歌、必应、搜狗、微信、360、Yahoo、Yandex 等搜索引擎】、贴吧、豆瓣、知乎、微博、NGA、V2EX、B 站(Bilibili)、煎蛋网、糗事百科、龙的天空、起点中文、IT之家、千图网、Pixabay、Pixiv、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、小众软件、【动漫狂、漫画猫、漫画屋、漫画 DB、动漫之家、拷贝漫画、包子漫画、Mangabz、Xmanhua 等漫画网站】、PubMed、Z-Library、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了...
  9. // @description:zh-TW 無縫拼接下一頁內容(瀑布流),支持各論壇、社交、遊戲、漫畫、小說、學術、搜索引擎等網站~
  10. // @description:en Seamlessly stitch next page content (waterfall)~
  11. // @match *://*/*
  12. // @connect userscript.xiu2.xyz
  13. // @connect www.ykmh.com
  14. // @connect www.xuexiniu.com
  15. // @connect bbs.xuexiniu.com
  16. // @connect weili.ooopic.com
  17. // @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
  18. // @grant GM_xmlhttpRequest
  19. // @grant GM_registerMenuCommand
  20. // @grant GM_unregisterMenuCommand
  21. // @grant GM_openInTab
  22. // @grant GM_getValue
  23. // @grant GM_setValue
  24. // @grant GM_notification
  25. // @grant window.onurlchange
  26. // @grant unsafeWindow
  27. // @license GPL-3.0 License
  28. // @run-at document-end
  29. // @namespace https://github.com/XIU2/UserScript
  30. // @supportURL https://github.com/XIU2/UserScript
  31. // @homepageURL https://github.com/XIU2/UserScript
  32. // ==/UserScript==
  33.  
  34. (function() {
  35. 'use strict';
  36. var menuAll = [
  37. ['menu_disable', '✅ 已启用 (点击对当前网站禁用)', '❌ 已禁用 (点击对当前网站启用)', []],
  38. ['menu_thread', '帖子内自动翻页 (社区类网站)', '帖子内自动翻页 (社区类网站)', true],
  39. ['menu_page_number', '显示当前页码及点击暂停翻页', '显示当前页码及点击暂停翻页', true],
  40. ['menu_pause_page', '左键双击网页空白处暂停翻页', '左键双击网页空白处暂停翻页', false],
  41. ['menu_rules', '更新外置翻页规则 (每天自动)', '更新外置翻页规则 (每天自动)', {}],
  42. ['menu_customRules', '自定义翻页规则', '自定义翻页规则', {}]
  43. ], menuId = [], webType = 0, curSite = {SiteTypeID: 0}, DBSite, SiteType, pausePage = true, pageNum = {now: 1, _now: 1}, locationC = false, nowLocation = '', lp = location.pathname;
  44. window.autoPage = {src_bF: src_bF, xs_bF: xs_bF}
  45.  
  46. for (let i=0;i<menuAll.length;i++){ // 如果读取到的值为 null 就写入默认值
  47. if (GM_getValue(menuAll[i][0]) == null){GM_setValue(menuAll[i][0], menuAll[i][3])};
  48. }
  49. getRulesUrl();
  50. registerMenuCommand();
  51. if (menuId.length < 4) {return}
  52. // 注册脚本菜单
  53. function registerMenuCommand() {
  54. if (menuId.length != []){
  55. for (let i=0;i<menuId.length;i++){
  56. GM_unregisterMenuCommand(menuId[i]);
  57. }
  58. }
  59. for (let i=0;i<menuAll.length;i++) { // 循环注册脚本菜单
  60. menuAll[i][3] = GM_getValue(menuAll[i][0]);
  61.  
  62. if (menuAll[i][0] === 'menu_disable') { // 启用/禁用
  63.  
  64. if (menu_disable('check')) { // 当前网站在禁用列表中
  65. menuId[i] = GM_registerMenuCommand(`${menuAll[i][2]}`, function(){menu_disable('del')});
  66. return
  67. } else { // 不在禁用列表中
  68. webType = doesItSupport(); // 判断网站类型(即是否支持),顺便直接赋值
  69. if (webType === 0) {
  70. menuId[0] = 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});});
  71. menuId[1] = GM_registerMenuCommand('🔄 更新外置翻页规则', function(){getRulesUrl(true)});
  72. menuId[2] = GM_registerMenuCommand('#️⃣ 自定义翻页规则', function(){customRules()});
  73. console.info('[自动无缝翻页] - 暂不支持当前网页 [ ' + location.href + ' ],欢迎申请支持: https://github.com/XIU2/UserScript / https://greasyfork.org/zh-CN/scripts/96880/feedback');
  74. return
  75. } else if (webType === -1) {
  76. return
  77. }
  78. menuId[i] = GM_registerMenuCommand(`${menuAll[i][1]}`, function(){menu_disable('add')});
  79. }
  80.  
  81. } else if (menuAll[i][0] === 'menu_rules') {
  82. menuId[i] = GM_registerMenuCommand(`🔄 ${menuAll[i][1]}`, function(){reGetRulesUrl()});
  83.  
  84. } else if (menuAll[i][0] === 'menu_customRules') {
  85. menuId[i] = GM_registerMenuCommand(`#️⃣ ${menuAll[i][1]}`, function(){customRules()});
  86.  
  87. } else {
  88. menuId[i] = GM_registerMenuCommand(`${menuAll[i][3]?'✅':'❌'} ${menuAll[i][1]}`, function(){menu_switch(menuAll[i][3], menuAll[i][0], menuAll[i][2])});
  89. }
  90. }
  91. 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});});
  92. }
  93.  
  94.  
  95. // --------------------------------------------------------
  96.  
  97.  
  98. // 判断是支持
  99. function doesItSupport() {
  100. setDBSite(); // 配置 DBSite 变量对象
  101.  
  102. // 遍历判断是否是某个已支持的网站,顺便直接赋值
  103. let support = false;
  104. end:
  105. for (let now in DBSite) { // 遍历 对象
  106. if (!DBSite[now].host) continue; // 如果不存在则继续下一个循环
  107. //console.log(DBSite[now].host)
  108. // 如果是 数组
  109. if (Array.isArray(DBSite[now].host)) {
  110.  
  111. for (let i of DBSite[now].host) { // 遍历 数组
  112. // 针对自定义翻页规则中的正则
  113. if (typeof i === 'string' && i.slice(0,1) === '/') i = new RegExp(i.slice(1,i.length-1), 'i')
  114. if ((i instanceof RegExp && i.test(location.hostname)) || (typeof i === 'string' && i === location.hostname)) {
  115.  
  116. if (self != top) {if (!DBSite[now].iframe) break end;} // 如果当前位于 iframe 框架下,就需要判断是否需要继续执行
  117. if (DBSite[now].url) {
  118. if (typeof DBSite[now].url == 'function') {
  119. DBSite[now].url();
  120. } else { // 自定义翻页规则时,因为同域名不同页面 url 分开写,所以如果没找到就需要跳出当前数组循环,继续规则循环
  121. if (DBSite[now].url.slice(0,1) === '/') { // 如果是正则,则对 URL 路径进行匹配
  122. if (new RegExp(DBSite[now].url.slice(1,DBSite[now].url.length-1), 'i').test(location.pathname + location.search) === true) {curSite = DBSite[now];} else {break;}
  123. } else { // 如果是函数,那就执行代码
  124. if (new Function (DBSite[now].url)() === true) {curSite = DBSite[now];} else {break;}
  125. }
  126. }
  127. } else {
  128. curSite = DBSite[now];
  129. }
  130. support = true; break end; // 如果找到了就退出所有循环
  131. }
  132. }
  133.  
  134. // 如果是 正则/字符串
  135. } else {
  136. // 针对自定义翻页规则中的正则
  137. if (typeof DBSite[now].host === 'string' && DBSite[now].host.slice(0,1) === '/') DBSite[now].host = new RegExp(DBSite[now].host.slice(1,DBSite[now].host.length-1), 'i')
  138. if ((DBSite[now].host instanceof RegExp && DBSite[now].host.test(location.hostname)) || (typeof DBSite[now].host === 'string' && DBSite[now].host === location.hostname)) {
  139.  
  140. if (self != top) {if (!DBSite[now].iframe) break;} // 如果当前位于 iframe 框架下,就需要判断是否需要继续执行
  141. if (DBSite[now].url) {
  142. if (typeof DBSite[now].url == 'function') {
  143. DBSite[now].url();
  144. } else { // 自定义翻页规则时,因为同域名不同页面 url 分开写,所以如果没找到就需要继续规则循环
  145. if (DBSite[now].url.slice(0,1) === '/') { // 如果是正则,则对 URL 路径进行匹配
  146. if (new RegExp(DBSite[now].url.slice(1,DBSite[now].url.length-1), 'i').test(location.pathname + location.search) === true) {curSite = DBSite[now];} else {continue;}
  147. } else { // 如果是函数,那就执行代码
  148. if (new Function (DBSite[now].url)() === true) {curSite = DBSite[now];} else {continue;}
  149. }
  150. }
  151. } else {
  152. curSite = DBSite[now];
  153. }
  154. support = true; break; // 如果找到了就退出循环
  155. }
  156. }
  157. }
  158.  
  159. if (support) {
  160. console.info('[自动无缝翻页] - 独立规则 网站'); return 1;
  161. } else if (self != top) {
  162. return -1;
  163. } else if (typeof discuz_uid != 'undefined' || getCSS('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"]') || (getCSS('a[href*="www.discuz.net" i]') && getCSS('a[href*="www.discuz.net" i]').textContent.indexOf('Discuz!') > -1) || (getCSS('#ft') && getCSS('#ft').textContent.indexOf('Discuz!') > -1)) {
  164. console.info('[自动无缝翻页] - <Discuz!> 论坛'); return 2;
  165. } else if (getCSS('#flarum-loading')) {
  166. console.info('[自动无缝翻页] - <Flarum> 论坛'); return 3;
  167. } else if (getCSS('body#phpbb')) {
  168. console.info('[自动无缝翻页] - <phpBB> 论坛'); return 4;
  169. } else if (getXpath('//footer//a[contains(string(), "Xiuno")] | //link[contains(@href, "xiuno")] | //script[contains(@src, "xiuno")]')) {
  170. console.info('[自动无缝翻页] - <Xiuno> 论坛'); return 5;
  171. } else if (typeof XF != 'undefined') {
  172. console.info('[自动无缝翻页] - <XenForo> 论坛'); return 6;
  173. } else if (getCSS('head meta[name="generator" i][content="nexusphp" i]') || getXpath('id("footer")[contains(string(), "NexusPHP")]')) {
  174. console.info('[自动无缝翻页] - <NexusPHP> 论坛'); return 7;
  175. } else if (getCSS('link[href*="themes/dux" i], script[src*="themes/dux" i]')) {
  176. console.info('[自动无缝翻页] - 使用 WordPress <DUX> 主题的网站'); return 100;
  177. } else if (getCSS('link[href*="themes/xiu" i], script[src*="themes/xiu" i]')) {
  178. console.info('[自动无缝翻页] - 使用 WordPress <XIU> 主题的网站'); return 101;
  179. } else if (getCSS('link[href*="themes/d8" i], script[src*="themes/d8" i]')) {
  180. console.info('[自动无缝翻页] - 使用 WordPress <D8> 主题的网站'); return 102;
  181. } else if (getCSS('link[href*="themes/begin" i], script[src*="themes/begin" i], img[src*="themes/begin" i]')) {
  182. console.info('[自动无缝翻页] - 使用 WordPress <Begin> 主题的网站'); return 103;
  183. } else if (getCSS('link[href*="/wp-content/" i], script[src*="/wp-content/" i]')) {
  184. if (getCSS('article.post') && getCSS('nav.navigation')) {
  185. if (getCSS('.nav-previous a')) {
  186. console.info('[自动无缝翻页] - 使用 WordPress <nav-previous 旧文章式> 主题的网站'); return 104;
  187. } else if (getXpath('//nav[contains(@class, "navigation")]//a[contains(text(), "下一页") or contains(text(), ">")]')) {
  188. console.info('[自动无缝翻页] - 使用 WordPress <nav-navigation> 下一页式> 主题的网站'); return 105;
  189. }
  190. }
  191. } else if ((getCSS('meta[name="description" i][content*="小说"], meta[name="description" i][content*="章节"], meta[name="description" i][content*="阅读"]') || location.hostname.indexOf('biqu') > -1 || document.title.indexOf('笔趣阁') > -1) && getCSS('#content, .content, #chaptercontent, .chaptercontent, #BookText') && getXpath('//a[contains(text(), "下一章") or contains(text(), "下一页")]')) {
  192. console.info('[自动无缝翻页] - <笔趣阁> 模板的小说网站'); return 200;
  193. }
  194. return 0;
  195. }
  196. // 判断网站类型
  197. function webTypeIf() {
  198. if (webType != 1) {
  199. switch (webType) {
  200. case 2: // < 所有 Discuz!论坛 >
  201. discuz_(); break;
  202. case 3: // < 所有 Flarum 论坛 >
  203. DBSite.flarum.url(); break;
  204. case 4: // < 所有 phpBB 论坛 >
  205. DBSite.phpbb.url(); break;
  206. case 5: // < 所有 Xiuno 论坛 >
  207. DBSite.xiuno.url(); break;
  208. case 6: // < 所有 XenForo 论坛 >
  209. DBSite.xenforo.url(); break;
  210. case 7: // < 所有 NexusPHP 论坛 >
  211. DBSite.nexusphp.url(); break;
  212. case 100: // < 所有使用 WordPress DUX 主题的网站 >
  213. DBSite.dux.url(); if (location.hostname === 'apphot.cc') {curSite.pager.scrollD = 2500;}; break;
  214. case 101: // < 所有使用 WordPress XIU 主题的网站 >
  215. DBSite.dux.url(); curSite.function = {bF: src_bF, bFp: [0, 'img.thumb[data-original]', 'data-original']}; break;
  216. case 102: // < 所有使用 WordPress D8 主题的网站 >
  217. DBSite.dux.url(); delete curSite.function; break;
  218. case 103: // < 所有使用 WordPress Begin 主题的网站 >
  219. DBSite.begin.url(); break;
  220. case 104: // < 所有使用 WordPress nav-previous 旧文章式 主题的网站 >
  221. DBSite.wp_nav_navigation.url(); break;
  222. case 105: // < 所有使用 WordPress nav-navigation 下一页式 主题的网站 >
  223. DBSite.wp_nav_navigation.url('//nav[contains(@class, "navigation")]//a[contains(text(), "下一页") or contains(text(), ">")]'); break;
  224. case 200: // < 所有使用 笔趣阁 模板的小说网站 >
  225. DBSite.biquge.url(); break;
  226. }
  227. }
  228. }
  229. // 网站规则
  230. function setDBSite() {
  231. /*
  232. url: 匹配到该域名后要执行的函数/正则(一般用于根据 URL 分配相应翻页规则)
  233. locationC: 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则(需要放在 url: 中)
  234.  
  235. hiddenPN: 不显示脚本左下角的页码
  236. history: 添加历史记录 并 修改当前 URL(默认开启,对于不支持的网站要设置为 false)
  237. thread: 对于社区类网站,要在 帖子内 的规则中加入这个,用于脚本的 [帖子内自动翻页] 功能(即用户可以选择开启/关闭所有社区类网站帖子内的自动翻页)
  238. style: 要插入网页的 CSS Style 样式
  239. retry: 允许获取失败后重试
  240.  
  241. pager: {
  242. type: 翻页模式
  243. 1 = 由脚本实现自动无缝翻页,可省略(适用于:静态加载内容网站,常规模式)
  244.  
  245. 2 = 只需要点击下一页按钮(适用于:网站自带了 自动无缝翻页 功能)
  246. nextText: 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页,下同)
  247. nextTextOf: 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页
  248. nextHTML: 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页
  249. interval: 点击间隔时间,对于没有按钮文字变化的按钮,可以手动指定间隔时间(单位 ms,默认 300,当指定上面三个时,会忽略 interval)
  250. isHidden: 只有下一页按钮可见时(没有被隐藏),才会点击
  251.  
  252. 3 = 依靠 [基准元素] 与 [浏览器可视区域底部] 之间的距离缩小来触发翻页(适用于:主体元素下方内容太多 且 高度不固定时)
  253. scrollE: 作为基准线的元素(一般为底部页码元素),和 replaceE 一样的话可以省略
  254. scrollD: 基准元素 - 可视区域底部
  255.  
  256. 4 = 动态加载类网站(适用于:简单的动态加载内容网站)
  257. insertE: 用来插入元素的函数
  258.  
  259. 5 = 插入 iframe 方式来加载下一页,无限套娃(适用于:部分动态加载内容的网站,需要允许 iframe 且支持通过 GET/POST 直接打开下一页)
  260. style: 加载 iframe 前要插入的 CSS Style 样式(比如为了悬浮的样式与下一页的重叠,隐藏网页底部间距提高阅读连续性)
  261. iframe: 这个必须加到 pager{} 外面(这样才会在该域名的 iframe 框架下运行脚本)
  262. forceTarget: 强制新标签页打开链接(适用于一些使用 pjax 技术的链接)
  263.  
  264. 6 = 通过 iframe 获取下一页动态加载内容插入本页,只有一个娃(适用于:部分动态加载内容的网站,与上面不同的是,该模式适合简单的网页,没有复杂事件什么的)
  265. loadTime: 预留的网页加载时间,确保网页内容加载完成
  266. forceTarget: 强制新标签页打开链接
  267.  
  268. nextL: 下一页链接所在元素
  269. pageE: 要从下一页获取的元素
  270. insertP: 下一页元素插入本页的位置(数组第一个是基准元素,第二个是基准元素的前后具体位置)
  271. 1 = 插入基准元素自身的前面
  272. 2 = 插入基准元素内,第一个子元素前面
  273. 3 = 插入基准元素内,最后一个子元素后面
  274. 4 = 插入基准元素自身的后面
  275. 5 = 插入 pageE 列表最后一个元素的后面(该 insertP 可以直接省略不写,等同于 ['pageE', 5] )
  276. 6 = 插入该元素自身内部末尾(针对小说网站等文本类的),附带参数 insertP6Br: true, 用来中间插入换行
  277. // 小技巧:当基准元素是下一页主体元素的父元素时(或者说要将下一页元素插入到本页同元素最后一个后面时)是可以省略不写 insertP
  278. 例如:当 pageE: 'ul>li' 且 insertP: ['ul', 3] 时,实际等同于 ['ul>li', 5]
  279. 当 pageE: '.item' 且 insertP: ['.item', 4] 时,实际等同于 ['.item', 5]
  280. 当 pageE: '.item' 且 insertP: ['.page', 1] 时,实际等同于 ['.item', 5]
  281. 注意:如 pageE 中选择了多类元素,则不能省略 insertP(比如包含 `,` 与 `|` 符号)
  282.  
  283. replaceE: 要替换为下一页内容的元素(比如页码)
  284. scrollD: 翻页动作触发点([滚动条] 与 [网页底部] 之间的距离),数值越大,越早开始翻页,一般是访问网页速度越慢,该值就需要越大,省略后默认 1500
  285.  
  286. scriptT: 单独插入 <script> 标签
  287. 0 = 下一页的所有 <script> 标签
  288. 1 = 下一页的所有 <script> 标签(不包括 src 链接)
  289. 2 = 下一页主体元素 (pageE) 的同级 <script> 标签
  290. 3 = 下一页主体元素 (pageE) 的子元素 <script> 标签
  291.  
  292. interval: 翻页后间隔时间(单位 ms)
  293. forceHTTPS: 下一页链接强制 HTTPS
  294. },
  295. function: {
  296. bF = 插入前执行函数
  297. bFp = 参数
  298. aF = 插入后执行函数
  299. aFp = 参数
  300. }
  301. */ //<<< 规则简单说明 >>>
  302. DBSite = {
  303. discuz_forum: {
  304. pager: {
  305. type: 2,
  306. nextL: '#autopbn',
  307. nextTextOf: '下一页',
  308. scrollD: 1500
  309. }
  310. }, // Discuz! 论坛 - 帖子列表(自带无缝加载下一页按钮的)
  311. discuz_guide: {
  312. pager: {
  313. nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
  314. pageE: 'id("threadlist")//table[./tbody[contains(@id, "normalthread_")]]/tbody[not(@id="separatorline")]',
  315. replaceE: '.pg, .pages',
  316. scrollD: 1500
  317. }
  318. }, // Discuz! 论坛 - 导读页 及 帖子列表(不带无缝加载下一页按钮的)
  319. discuz_waterfall: {
  320. pager: {
  321. nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
  322. pageE: '#waterfall > li',
  323. replaceE: '.pg, .pages',
  324. scrollD: 1500
  325. }
  326. }, // Discuz! 论坛 - 图片模式的帖子列表(不带无缝加载下一页按钮的)
  327. discuz_thread: {
  328. thread: true,
  329. style: '.pgbtn {display: none;}',
  330. pager: {
  331. nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
  332. pageE: '#postlist > div[id^="post_"]',
  333. replaceE: '//div[contains(@class,"pg") or contains(@class,"pages")][./a[contains(@class,"nxt") or contains(@class,"next") or contains(@class,"prev")][not(contains(@href,"javascript") or contains(@href,"commentmore"))]]',
  334. scrollD: 1500
  335. },
  336. function: {
  337. bF: src_bF,
  338. bFp: [0, 'img[file]', 'file']
  339. }
  340. }, // Discuz! 论坛 - 帖子内
  341. discuz_search: {
  342. pager: {
  343. nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
  344. pageE: '#threadlist > ul',
  345. replaceE: '.pg, .pages',
  346. scrollD: 1500
  347. }
  348. }, // Discuz! 论坛 - 搜索页
  349. discuz_youspace: {
  350. pager: {
  351. nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
  352. pageE: 'form:not([action^="search.php?"]) tbody > tr:not(.th)',
  353. replaceE: '.pg, .pages',
  354. scrollD: 1500
  355. }
  356. }, // Discuz! 论坛 - 回复页、主题页(别人的)
  357. discuz_collection: {
  358. pager: {
  359. nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
  360. pageE: '#ct .bm_c table > tbody',
  361. replaceE: '.pg, .pages',
  362. scrollD: 1500
  363. }
  364. }, // Discuz! 论坛 - 淘帖页
  365. discuz_m: {
  366. thread: true,
  367. pager: {
  368. nextL: '//a[@class="nxt" or @class="next"] | //div[@class="page"]/a[text()="下一页" or contains(text(), ">")]',
  369. replaceE: '.pg, .page',
  370. scrollD: 1000
  371. }
  372. }, // Discuz! 论坛 - 触屏手机版 - 帖子内
  373. discuz_m_forum: {
  374. pager: {
  375. type: 2,
  376. nextL: 'a.loadmore',
  377. interval: 500,
  378. scrollD: 1000
  379. }
  380. }, // Discuz! 论坛 - 触屏手机版 - 帖子列表(自带无缝加载下一页按钮的)
  381. flarum: {
  382. url: ()=> {locationC = true;if (!indexOF('/d/')) {curSite = DBSite.flarum;}},
  383. pager: {
  384. type: 2,
  385. nextL: '.DiscussionList-loadMore > button',
  386. isHidden: true,
  387. scrollD: 1500
  388. }
  389. }, // Flarum 论坛
  390. phpbb: {
  391. url: ()=> {if (indexOF('/viewforum.php')) {
  392. curSite = DBSite.phpbb;
  393. } else if (indexOF('/viewtopic.php')) {
  394. curSite = DBSite.phpbb_post;
  395. } else if (indexOF('/search.php')) {
  396. curSite = DBSite.phpbb_search;
  397. }},
  398. pager: {
  399. nextL: '.pagination li.next a[rel="next"], .topic-actions .pagination strong~a',
  400. pageE: '.forumbg:not(.announcement) ul.topiclist.topics > li',
  401. replaceE: '.action-bar .pagination, .topic-actions .pagination',
  402. scrollD: 2000
  403. }
  404. }, // phpBB 论坛 - 帖子列表
  405. phpbb_post: {
  406. thread: true,
  407. pager: {
  408. nextL: '.pagination li.next a[rel="next"], .topic-actions .pagination strong~a',
  409. pageE: 'div.post[id], div.post[id]+hr',
  410. replaceE: '.action-bar .pagination, .topic-actions .pagination',
  411. scrollD: 2000
  412. }
  413. }, // phpBB 论坛 - 帖子内
  414. phpbb_search: {
  415. pager: {
  416. nextL: '.pagination li.next a[rel="next"], .topic-actions .pagination strong~a',
  417. pageE: 'div.search.post',
  418. replaceE: '.action-bar .pagination, .pagination',
  419. scrollD: 2000
  420. }
  421. }, // phpBB 论坛 - 搜索页
  422. xenforo: {
  423. url: ()=> {if (indexOF(/\/(forums|f)\//)) {
  424. curSite = DBSite.xenforo;
  425. } else if (indexOF(/\/(threads|t)\//)) {
  426. curSite = DBSite.xenforo_post;
  427. } else if (indexOF('/search/')) {
  428. curSite = DBSite.xenforo_search;
  429. }},
  430. pager: {
  431. nextL: 'a.pageNav-jump--next',
  432. pageE: '.structItemContainer-group.js-threadList > div',
  433. replaceE: 'nav.pageNavWrapper',
  434. scrollD: 2500
  435. }
  436. }, // XenForo 论坛 - 帖子列表
  437. xenforo_post: {
  438. thread: true,
  439. pager: {
  440. nextL: 'a.pageNav-jump--next',
  441. pageE: '.block-body.js-replyNewMessageContainer > article',
  442. replaceE: 'nav.pageNavWrapper',
  443. scrollD: 2500
  444. }
  445. }, // XenForo 论坛 - 帖子内
  446. xenforo_search: {
  447. pager: {
  448. nextL: 'a.pageNav-jump--next',
  449. pageE: 'ol.block-body > li',
  450. replaceE: 'nav.pageNavWrapper',
  451. scrollD: 2500
  452. }
  453. }, // XenForo 论坛 - 搜索页
  454. xiuno: {
  455. url: ()=> {if (lp == '/' || indexOF(/\/(index|forum)/)) {curSite = DBSite.xiuno;} else if (indexOF('/thread')) {curSite = DBSite.xiuno_post;}},
  456. pager: {
  457. nextL: '//li[@class="page-item"]/a[text()="▶"]',
  458. pageE: 'ul.threadlist > li',
  459. replaceE: 'ul.pagination',
  460. scrollD: 1500
  461. }
  462. }, // Xiuno 论坛 - 帖子列表
  463. xiuno_post: {
  464. thread: true,
  465. pager: {
  466. nextL: '//li[@class="page-item"]/a[text()="▶"]',
  467. pageE: 'li.post[data-pid]:not(.newpost)',
  468. replaceE: 'ul.pagination',
  469. scrollD: 1500
  470. }
  471. }, // Xiuno 论坛 - 帖子内
  472. nexusphp: {
  473. url: ()=> {
  474. if (lp == '/torrents.php' || getCSS('table.torrents')) {
  475. curSite = DBSite.nexusphp;
  476. } else if (lp == '/subtitles.php') {
  477. curSite = DBSite.nexusphp;
  478. curSite.pager.pageE = '#outer > table.main~table > tbody > tr:not(:first-of-type)'
  479. } else if (lp == '/forums.php' && indexOF('action=viewforum', 's')) {
  480. curSite = DBSite.nexusphp;
  481. curSite.pager.pageE = '#outer > table.main+table > tbody > tr:not(:first-of-type):not(:last-of-type)'
  482. } else if (lp == '/forums.php' && indexOF('action=viewtopic', 's')) {
  483. curSite = DBSite.nexusphp;
  484. curSite.thread = true;
  485. curSite.pager.pageE = 'td.text > div, td.text > div+table.main';
  486. }},
  487. pager: {
  488. nextL: '//a[./b[contains(text(), "下一页") or contains(text(), ">>")]]',
  489. pageE: 'table.torrents > tbody > tr:not(:first-of-type)',
  490. replaceE: '//p[@align][./font[@class="gray"]]',
  491. scrollD: 1500
  492. }
  493. }, // NexusPHP 论坛
  494. dux: {
  495. host: 'www.puresys.net',
  496. url: ()=> {if (!indexOF('.html')) curSite = DBSite.dux;},
  497. pager: {
  498. nextL: 'li.next-page > a',
  499. pageE: '.content > article',
  500. replaceE: '.content > .pagination',
  501. scrollD: 1500
  502. },
  503. function: {
  504. bF: src_bF,
  505. bFp: [0, 'img.thumb[data-src]', 'data-src']
  506. }
  507. }, // WordPress 的 DUX、XIU、D8 主题
  508. begin: {
  509. url: ()=> {if (location.search.slice(0,3) === '?s=') {curSite = DBSite.begin_search;} else if (!indexOF('.html')) {curSite = DBSite.begin;}},
  510. pager: {
  511. type: 2,
  512. nextL: 'div[id^="ias_trigger_"]',
  513. interval: 500,
  514. scrollD: 1500
  515. }
  516. }, // WordPress 的 Begin 主题
  517. begin_search: {
  518. pager: {
  519. nextL: 'a.next',
  520. pageE: '#main > ul > li',
  521. replaceE: 'nav.pagination',
  522. scrollD: 1500
  523. }
  524. }, // WordPress 的 Begin 主题 - 搜索页
  525. wp_nav_navigation: {
  526. url: function(nextL = '.nav-previous a') {if (!indexOF('/post/') && !getCSS('#comments, .comments-area, #disqus_thread')) {curSite = DBSite.wp_nav_navigation; curSite.pager.nextL = nextL;}},
  527. pager: {
  528. nextL: '.nav-previous a',
  529. pageE: 'article.post',
  530. replaceE: 'nav.navigation',
  531. scrollD: 1500
  532. }
  533. }, // Wordpress 的 nav.navigation 规则
  534. biquge: {
  535. url: ()=> {if (indexOF(/\d+\/\d+\.html/)) {curSite = DBSite.biquge;}},
  536. style: 'img, .posterror {display: none !important;}',
  537. pager: {
  538. nextL: '//a[contains(text(), "下一章") or contains(text(), "下一页")]',
  539. pageE: '#content, .content, #chaptercontent, .chaptercontent, #BookText',
  540. insertP: ['#content, .content, #chaptercontent, .chaptercontent, #BookText', 6],
  541. insertP6Br: true,
  542. replaceE: '//*[./a[contains(text(), "下一章") or contains(text(), "下一页")]]',
  543. scrollD: 1500
  544. }
  545. }, // 笔趣阁 模板的小说网站
  546. baidu: {
  547. host: 'www.baidu.com',
  548. url: ()=> {locationC = true; if (lp == '/s') {curSite = DBSite.baidu;} else if (location.pathname.slice(location.pathname.length - 2,location.pathname.length) == '/s' || isMobile()) {location.hostname = 'm.baidu.com';}},
  549. style: '.new-pmd .c-img-border {position: initial !important;} .op-bk-polysemy-video__wrap.c-gap-bottom {display: none !important;}',
  550. pager: {
  551. nextL: 'id("page")//a[contains(text(),"下一页")]',
  552. pageE: '#content_left > *',
  553. replaceE: '#page',
  554. scrollD: 2000
  555. }
  556. }, // 百度 搜索
  557. baidu_m: {
  558. host: 'm.baidu.com',
  559. url: ()=> {if (location.pathname.slice(location.pathname.length - 2,location.pathname.length) == '/s') curSite = DBSite.baidu_m;},
  560. style: 'div.result[tpl="recommend_list"], #page-copyright {display: none !important;}',
  561. pager: {
  562. nextL: 'a[class^="new-nextpage"]',
  563. pageE: '#results > *',
  564. replaceE: '#page-controller',
  565. scrollD: 2000
  566. }
  567. }, // 百度 搜索 - 手机版
  568. google: {
  569. host: /^www\.google\./,
  570. url: ()=> {if (lp == '/search' && !indexOF('tbm=isch', 's')) {
  571. if (indexOF('sclient=mobile', 's') || isMobile()) {
  572. curSite = DBSite.google_m;
  573. } else {
  574. curSite = DBSite.google;
  575. }
  576. } else if (lp == '/scholar') {
  577. curSite = DBSite.google_scholar;
  578. }},
  579. pager: {
  580. nextL: '#pnnext',
  581. pageE: 'id("search")/* | //style[not(contains(text(), "table,div,span,p{display:none}"))]',
  582. insertP: ['#search', 3],
  583. replaceE: 'id("navcnt") | id("rcnt")//div[@role="navigation"]',
  584. scriptT: 0,
  585. scrollD: 3000
  586. },
  587. function: {
  588. bF: google_bF
  589. }
  590. }, // 谷歌 搜索
  591. google_m: {
  592. pager: {
  593. type: 2,
  594. nextL: 'a[aria-label="查看更多"], a[aria-label="See more" i]',
  595. isHidden: true,
  596. scrollD: 1000
  597. }
  598. }, // 谷歌 搜索 - 手机版
  599. bing: {
  600. host: ['www.bing.com','cn.bing.com'],
  601. url: ()=> {if (lp == '/search') {
  602. curSite = DBSite.bing;
  603. curSite.function = {bF: bing_bF}
  604. } else if (lp == '/academic/search') {
  605. curSite = DBSite.bing_academic;
  606. }},
  607. style: '.b_imagePair.square_mp > .inner {display: none !important;}',
  608. pager: {
  609. nextL: 'a.sb_pagN, a.sb_halfnext, a.sb_fullnpl',
  610. pageE: '#b_results > li:not(.b_msg):not([class="b_ans"]):not(.b_pag):not(#mfa_root)',
  611. replaceE: '#b_results > .b_pag',
  612. scrollD: 2000
  613. }
  614. }, // 必应 搜索 + 手机版
  615. sogou: {
  616. host: 'www.sogou.com',
  617. url: '/^\\/.+/',
  618. pager: {
  619. nextL: '#sogou_next',
  620. pageE: '.results > *',
  621. replaceE: '#pagebar_container',
  622. scriptT: 3,
  623. scrollD: 2000
  624. }
  625. }, // 搜狗 搜索
  626. sogou_m: {
  627. host: ['m.sogou.com', 'wap.sogou.com'],
  628. url: '/^\\/.+/',
  629. pager: {
  630. type: 2,
  631. nextL: '#ajax_next_page',
  632. isHidden: true,
  633. scrollD: 1000
  634. }
  635. }, // 搜狗 搜索 - 手机版
  636. sogou_weixin: {
  637. host: 'weixin.sogou.com',
  638. url: ()=> {if (lp == '/') {
  639. curSite = DBSite.sogou_weixin;
  640. } else if (lp == '/weixin') {
  641. curSite = DBSite.sogou_weixin_search;
  642. }},
  643. pager: {
  644. type: 2,
  645. nextL: '#look-more',
  646. interval: 1000,
  647. scrollD: 1000
  648. }
  649. }, // 搜狗微信 - 首页
  650. sogou_weixin_search: {
  651. pager: {
  652. nextL: '#sogou_next',
  653. pageE: 'ul[class*="news-list"] > li',
  654. replaceE: '#pagebar_container',
  655. scrollD: 1200
  656. }
  657. }, // 搜狗微信 - 搜索
  658. toutiao: {
  659. host: ['www.toutiao.com', 'so.toutiao.com'],
  660. url: ()=> {if (location.hostname != 'www.toutiao.com') {
  661. if (lp == '/search/' || isMobile()) {
  662. curSite = DBSite.toutiao_m;
  663. } else if (lp == '/search') {
  664. curSite = DBSite.toutiao;
  665. }
  666. }},
  667. pager: {
  668. nextL: '//div[contains(@class, "-pagination")]/a[string()="下一页"]',
  669. pageE: 'div[class*="-result-list"] > .result-content[data-i]',
  670. replaceE: 'div[class*="-pagination"]',
  671. scrollD: 2000
  672. },
  673. function: {
  674. bF: pageElems => { // 插入前函数(过滤相关搜索)
  675. if (getXpath('//div[contains(@class,"-header") and string()="相关搜索"]', pageElems[pageElems.length - 1])) pageElems[pageElems.length - 1].style.display = 'none';
  676. return pageElems
  677. }
  678. }
  679. }, // 头条 搜索
  680. toutiao_m: {
  681. pager: {
  682. nextL: '#page-bottom a[class*="containerRight_"], #page-bottom a[class*="container_"]',
  683. pageE: '#results > div',
  684. replaceE: '#page-bottom',
  685. scrollD: 2000
  686. }
  687. }, // 头条 搜索 - 手机版
  688. so: {
  689. host: 'www.so.com',
  690. url: '/^\\/.+/',
  691. style: 'img {opacity: 1 !important;}',
  692. pager: {
  693. nextL: 'a#snext',
  694. pageE: 'ul.result > li, style:not(src)',
  695. insertP: ['ul.result', 3],
  696. replaceE: '#page',
  697. scrollD: 2000
  698. },
  699. function: {
  700. bF: src_bF,
  701. bFp: [0, 'img[data-isrc]', 'data-isrc']
  702. }
  703. }, // 360 搜索
  704. so_m: {
  705. host: 'm.so.com',
  706. url: '/^\\/.+/',
  707. pager: {
  708. type: 2,
  709. nextL: '#load-more',
  710. isHidden: true,
  711. scrollD: 1000
  712. }
  713. }, // 360 搜索 - 手机版
  714. duckduckgo: {
  715. host: 'duckduckgo.com',
  716. url: ()=> {
  717. if (getCookie('av') != '1') {
  718. document.cookie='av=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 强制开启自带的无缝翻页功能
  719. location.reload(); // 刷新网页
  720. }
  721. },
  722. history: false
  723. }, // DuckDuckGo 搜索
  724. startpage: {
  725. host: ['startpage.com', 'www.startpage.com'],
  726. url: ()=> {if (indexOF('/search')) {curSite = DBSite.startpage;}},
  727. pager: {
  728. nextL: ()=> getNextF('//div[contains(@class, "pagination ")]/form[./button[@class="pagination__next-prev-button next"]]'),
  729. pageE: 'section.w-gl--desktop > div',
  730. replaceE: '.pagination',
  731. scrollD: 2000
  732. }
  733. }, // Startpage 搜索
  734. yandex: {
  735. host: ['yandex.com', 'yandex.ru', 'yandex.ua', 'yandex.by', 'yandex.kz', 'yandex.uz', 'yandex.com.tr'],
  736. url: ()=> {if (lp == '/search/') {curSite = DBSite.yandex;} else if (lp == '/video/search') {curSite = DBSite.yandex_video;}},
  737. pager: {
  738. nextL: 'a.pager__item_kind_next',
  739. pageE: '#search-result > *, style',
  740. insertP: ['#search-result', 3],
  741. replaceE: '.pager',
  742. scrollD: 1500
  743. }
  744. }, // Yandex 搜索
  745. yandex_video: {
  746. hiddenPN: true,
  747. pager: {
  748. type: 2,
  749. nextL: 'button.more__button',
  750. interval: 1000,
  751. scrollD: 1000
  752. }
  753. }, // Yandex 搜索 - 视频
  754. yahoo: {
  755. host: 'search.yahoo.com',
  756. url: ()=> {if (indexOF('/search')) {curSite = DBSite.yahoo;}},
  757. pager: {
  758. nextL: '.pagination a.next',
  759. pageE: '#web ol > li',
  760. replaceE: '.pagination',
  761. scrollD: 2000
  762. }
  763. }, // Yahoo 搜索
  764. yahoo_jp: {
  765. host: 'search.yahoo.co.jp',
  766. url: ()=> {if (indexOF('/search')) {curSite = DBSite.yahoo_jp;}},
  767. pager: {
  768. nextL: '.Pagenation__next > a',
  769. pageE: '.Contents__innerGroupBody > div',
  770. replaceE: '.Pagenation',
  771. scrollD: 2000
  772. }
  773. }, // Yahoo 搜索 (JP)
  774. qwant: {
  775. host: 'www.qwant.com',
  776. url: ()=> {locationC = true; if (indexOF('q=', 's') && indexOF('t=web', 's')) {curSite = DBSite.qwant;}},
  777. pager: {
  778. type: 2,
  779. nextL: 'button[data-testid="buttonShowMore"]',
  780. interval: 500,
  781. scrollD: 2000
  782. }
  783. }, // Qwant 搜索
  784. ecosia: {
  785. host: 'www.ecosia.org',
  786. url: ()=> {if (lp == '/search') {curSite = DBSite.ecosia;}},
  787. pager: {
  788. nextL: 'nav.pagination a[aria-label="Next page"]',
  789. pageE: 'section.mainline > div:not(.related-queries)',
  790. replaceE: 'nav.pagination',
  791. scrollD: 1500
  792. }
  793. }, // Ecosia 搜索
  794. magi: {
  795. host: 'magi.com',
  796. url: ()=> {if (lp == '/search') {curSite = DBSite.magi;}},
  797. pager: {
  798. type: 2,
  799. nextL: '.card[data-type="next"]',
  800. nextText: '加载更多',
  801. scrollD: 1500
  802. }
  803. }, // Magi 搜索
  804. ask: {
  805. host: ['ask.com', 'www.ask.com'],
  806. url: ()=> {if (lp == '/web') {curSite = DBSite.ask;}},
  807. style: '.PartialSearchResults-heading {display: none !important;}',
  808. pager: {
  809. nextL: 'li.PartialWebPagination-next > a',
  810. pageE: '.PartialSearchResults.mid',
  811. replaceE: '.PartialWebPagination',
  812. scrollD: 2000
  813. }
  814. }, // ASK 搜索
  815. fsou: {
  816. host: 'fsou.cc',
  817. url: ()=> {
  818. if (lp == '/search') {
  819. if (window.screen.width < 780) {
  820. curSite = DBSite.fsou_m;
  821. } else {
  822. curSite = DBSite.fsou;
  823. }
  824. }
  825. },
  826. retry: 1000,
  827. pager: {
  828. type: 6,
  829. nextL: ()=> getNextEP('.turn-page-num-wrap.selected', 'pageIndex=', /pageIndex=\d+/),
  830. pageE: '.organic-results > div',
  831. replaceE: '.bottom-pagination',
  832. loadTime: 1000,
  833. scrollD: 3000
  834. }
  835. }, // F 搜
  836. fsou_m: {
  837. pager: {
  838. type: 2,
  839. nextL: '.next-page-container',
  840. scrollD: 1500
  841. }
  842. }, // F 搜 - 手机版
  843. baidu_tieba: {
  844. host: ['tieba.baidu.com', 'jump2.bdimg.com'],
  845. url: ()=> {if (location.hostname == 'jump2.bdimg.com') location.hostname = 'tieba.baidu.com';
  846. if (lp == '/f') {
  847. baidu_tieba_1(); // 右侧悬浮发帖按钮点击事件(解决自动翻页导致无法发帖的问题)
  848. curSite = DBSite.baidu_tieba;
  849. } else if (indexOF('/p/')) {
  850. curSite = DBSite.baidu_tieba_post;
  851. } else if (lp == '/f/search/res') {
  852. curSite = DBSite.baidu_tieba_search;
  853. }},
  854. style: 'img.j_retract {margin-top: 0 !important;margin-bottom: 0 !important;}', // 修复帖子列表中预览图片,在切换下一个/上一个图片时,多出来的图片上下边距
  855. history: false,
  856. iframe: true,
  857. pager: {
  858. type: 4,
  859. nextL: ()=> {if (getNextE('a.next.pagination-item')) getPageElems_(curSite.pageUrl + '&pagelets=frs-list%2Fpagelet%2Fthread&pagelets_stamp=' + new Date().getTime());},
  860. pageE: '#thread_list > li',
  861. insertP: ['#thread_list', 3],
  862. insertE: baidu_tieba_insertE,
  863. replaceE: '#frs_list_pager',
  864. interval: 2000,
  865. scrollD: 2500
  866. },
  867. function: {
  868. bF: src_bF,
  869. bFp: [0, 'img[data-original]', 'data-original']
  870. }
  871. }, // 百度贴吧 - 帖子列表
  872. baidu_tieba_post: {
  873. forceTarget: true,
  874. thread: true,
  875. style: '.d_sign_split, img.j_user_sign, .d_author .d_pb_icons, .save_face_bg, .save_face_bg_2, li.d_name a.icon_tbworld, .lzl_cnt a.icon_tbworld, .topic_list_box.topic-fixed {display: none !important;} a.p_author_face.j_frame_guide {background: none repeat scroll 0 0 #FFF !important;border: 1px solid #CCC !important;padding: inherit !important;} .red_text, .red-text, .vip_red, .vip-red, .vip_red:hover, .vip-red:hover, .vip_red:visited, .vip-red:visited {color: #2d64b3 !important;}', // 签名、印记、头像边框、VIP 元素
  876. pager: {
  877. type: 5,
  878. nextL: '//li[contains(@class,"pb_list_pager")]/a[text()="下一页"]',
  879. style: 'ul.tbui_aside_float_bar, .core_title_wrap_bright.tbui_follow_fixed.core_title_absolute_bright {display: none !important;}',
  880. scrollD: 1500
  881. }
  882. }, // 百度贴吧 - 帖子内
  883. baidu_tieba_search: {
  884. pager: {
  885. nextL: 'a.next',
  886. pageE: '.s_post_list > div',
  887. replaceE: '.pager',
  888. scrollD: 1000
  889. }
  890. }, // 百度贴吧 - 搜索页
  891. douban_subject_comments: {
  892. host: 'movie.douban.com',
  893. url: ()=> {if (indexOF('/subject/') && indexOF('/comments')) {
  894. curSite = DBSite.douban_subject_comments;
  895. } else if (indexOF('/subject/') && indexOF('/reviews')) {
  896. curSite = DBSite.douban_subject_reviews;
  897. } else if(indexOF('/subject/') && indexOF('/episode') || indexOF('/subject/') && indexOF('/tv_discuss')) {
  898. curSite = DBSite.douban_subject_episode;
  899. } else if(indexOF('/people/') && indexOF('/collect')) {
  900. curSite = DBSite.douban_people_collect;
  901. } else if(indexOF('/celebrity/') && indexOF('/movies')) {
  902. curSite = DBSite.douban_celebrity_movies;
  903. }},
  904. pager: {
  905. nextL: 'a.next',
  906. pageE: '#comments > .comment-item',
  907. replaceE: '#paginator',
  908. scrollD: 1500
  909. }
  910. }, // 豆瓣 - 短评
  911. douban_subject_reviews: {
  912. pager: {
  913. nextL: 'link[rel="next"]',
  914. pageE: '.review-list > div',
  915. replaceE: '.paginator',
  916. scrollD: 1500
  917. }
  918. }, // 豆瓣 - 影评
  919. douban_subject_episode: {
  920. pager: {
  921. nextL: 'link[rel="next"]',
  922. pageE: '#comments > div',
  923. replaceE: '.paginator',
  924. scrollD: 1500
  925. }
  926. }, // 豆瓣 - 剧评
  927. douban_people_collect: {
  928. pager: {
  929. nextL: 'link[rel="next"]',
  930. pageE: '.grid-view > div',
  931. replaceE: '.paginator',
  932. scrollD: 1500
  933. }
  934. }, // 豆瓣 - 看过的电影
  935. douban_celebrity_movies: {
  936. pager: {
  937. nextL: 'link[rel="next"]',
  938. pageE: '.grid_view > ul > li',
  939. replaceE: '.paginator',
  940. scrollD: 1500
  941. }
  942. }, // 豆瓣 - 作品
  943. douban_group: {
  944. host: 'www.douban.com',
  945. url: ()=> {if (indexOF('/group/topic/')) {
  946. curSite = DBSite.douban_group_topic;
  947. } else if (indexOF('/group/explore')) {
  948. curSite = DBSite.douban_group_explore;
  949. } else if (indexOF('/group/') && indexOF('/discussion')) {
  950. curSite = DBSite.douban_group;
  951. }},
  952. pager: {
  953. nextL: 'span.next > a',
  954. pageE: 'table.olt > tbody > tr:not(.th)',
  955. replaceE: '.paginator',
  956. scrollD: 1500
  957. }
  958. }, // 豆瓣 - 小组
  959. douban_group_explore: {
  960. pager: {
  961. nextL: 'span.next > a',
  962. pageE: '#content .article > div > .channel-item',
  963. replaceE: '.paginator',
  964. scrollD: 1500
  965. }
  966. }, // 豆瓣 - 小组讨论精选
  967. douban_group_topic: {
  968. thread: true,
  969. pager: {
  970. nextL: 'span.next > a',
  971. pageE: '#comments > li',
  972. replaceE: '.paginator',
  973. scrollD: 1500
  974. }
  975. }, // 豆瓣 - 小组帖子内
  976. zhihu: {
  977. host: 'www.zhihu.com',
  978. url: ()=> {locationC = true; if (indexOF(/\/people\/.+\/.+/) || indexOF('/collection/')) {curSite = DBSite.zhihu; if (self != top) insStyle('#ProfileHeader {display: none !important;}')}},
  979. forceTarget: true,
  980. iframe: true,
  981. pager: {
  982. type: 5,
  983. nextL: ()=> {
  984. let next = getCSS('.Pagination .PaginationButton--current+button:not(.PaginationButton-next)');
  985. if (next) return (location.origin + location.pathname + '?page=' + next.textContent)
  986. },
  987. scrollD: 2000
  988. }
  989. }, // 知乎 - 用户主页、收藏夹
  990. weibo_comment: {
  991. host: 'weibo.com',
  992. pager: {
  993. type: 2,
  994. nextL: 'a[action-type="click_more_comment"]',
  995. nextText: '查看更多c',
  996. scrollD: 1000
  997. }
  998. }, // 微博评论
  999. tianya: {
  1000. host: 'bbs.tianya.cn',
  1001. url: ()=> {if (indexOF('/list')) {
  1002. curSite = DBSite.tianya;
  1003. } else if (indexOF('/post')) {
  1004. curSite = DBSite.tianya_post;
  1005. }},
  1006. pager: {
  1007. nextL: '//div[contains(@class, "pages")]/div[@class="links"]/a[text()="下一页"]',
  1008. pageE: '.tab-bbs-list > tbody:not(:first-of-type)',
  1009. replaceE: '//div[contains(@class, "pages")]',
  1010. scrollD: 1500
  1011. }
  1012. }, // 天涯社区
  1013. tianya_post: {
  1014. thread: true,
  1015. pager: {
  1016. nextL: 'a.js-keyboard-next',
  1017. pageE: '.atl-main > div[class="atl-item"]',
  1018. replaceE: '.atl-pages > form',
  1019. scrollD: 2000
  1020. }
  1021. }, // 天涯社区 - 帖子内
  1022. hupu: {
  1023. host: 'bbs.hupu.com',
  1024. url: ()=> {if (indexOF('.html')) {
  1025. curSite = DBSite.hupu_post;
  1026. } else if (lp != '/' && !indexOF('/all-')) {
  1027. curSite = DBSite.hupu;
  1028. }},
  1029. pager: {
  1030. nextL: ()=> {let next = getCSS('li.hupu-rc-pagination-item-active+li.hupu-rc-pagination-item > a');if (next) {return (location.origin + location.pathname.replace(/-\d+/,'') + '-' + next.textContent)} else {return ''}},
  1031. pageE: 'li.bbs-sl-web-post-body',
  1032. replaceE: 'ul.hupu-rc-pagination',
  1033. scrollD: 1500
  1034. }
  1035. }, // 虎扑社区
  1036. hupu_post: {
  1037. thread: true,
  1038. pager: {
  1039. nextL: 'li.hupu-rc-pagination-next > a',
  1040. pageE: '.post-reply-list ',
  1041. replaceE: 'ul.hupu-rc-pagination',
  1042. scrollD: 2000
  1043. }
  1044. }, // 虎扑社区 - 帖子内
  1045. nga_thread: {
  1046. host: ['bbs.nga.cn', 'ngabbs.com', 'nga.178.com', 'g.nga.cn'],
  1047. iframe: true,
  1048. url: ()=> {locationC = true;
  1049. if (lp == '/thread.php') {
  1050. curSite = DBSite.nga_thread;
  1051. } else if (lp == '/read.php') {
  1052. curSite = DBSite.nga_read;
  1053. }},
  1054. pager: {
  1055. nextL: '#pagebbtm a[title="下一页"]',
  1056. pageE: '#topicrows > tbody, #topicrows > script',
  1057. insertP: ['#topicrows', 3],
  1058. replaceE: 'div[name="pageball"]',
  1059. scriptT: 2,
  1060. scrollD: 1000
  1061. },
  1062. function: {
  1063. aF: ()=> {document.body.appendChild(document.createElement('script')).textContent = 'commonui.topicArg.loadAll();';}
  1064. }
  1065. }, // NGA - 各版块帖子列表
  1066. nga_read: {
  1067. history: false,
  1068. thread: true,
  1069. retry: 1000,
  1070. pager: {
  1071. nextL: '#pagebbtm a[title*="下一页"]',
  1072. pageE: 'id("m_posts_c")/table | id("m_posts_c")/script | //script[contains(text(), "commonui.userInfo.setAll")]',
  1073. insertP: ['#m_posts_c', 3],
  1074. replaceE: 'div[name="pageball"]',
  1075. scriptT: 2,
  1076. scrollD: 1000
  1077. }
  1078. }, // NGA - 帖子内
  1079. v2ex_recent: {
  1080. host: ['v2ex.com', 'www.v2ex.com'],
  1081. url: ()=> {if (lp == '/') {
  1082. v2ex_aF('#Main a.topic-link:not([target])');
  1083. } else if (lp == '/recent') {
  1084. curSite = DBSite.v2ex_recent;
  1085. v2ex_aF('#Main a.topic-link:not([target])');
  1086. } else if (lp == '/notifications') {
  1087. curSite = DBSite.v2ex_notifications;
  1088. v2ex_aF('#Main a[href^="/t/"]:not([target])');
  1089. } else if (lp == '/balance') {
  1090. curSite = DBSite.v2ex_balance;
  1091. } else if (indexOF('/go/')) {
  1092. curSite = DBSite.v2ex_go;
  1093. v2ex_aF('#Main a.topic-link:not([target])');
  1094. } else if (indexOF('/replies')) {
  1095. curSite = DBSite.v2ex_replies;
  1096. v2ex_aF('#Main a[href^="/t/"]:not([target])');
  1097. }},
  1098. pager: {
  1099. nextL: 'a.page_current+a.page_normal',
  1100. pageE: '.cell.item',
  1101. replaceE: '#Main > .box > .cell[style]:not(.item) > table',
  1102. scrollD: 1500
  1103. },
  1104. function: {
  1105. aF: v2ex_aF,
  1106. aFp: '#Main a.topic-link:not([target])'
  1107. }
  1108. }, // V2EX - 最近主题页
  1109. v2ex_notifications: {
  1110. pager: {
  1111. nextL: 'a.page_current+a.page_normal',
  1112. pageE: '#notifications > div',
  1113. replaceE: '#Main > .box > .cell[style] > table',
  1114. scrollD: 1500
  1115. },
  1116. function: {
  1117. aF: v2ex_aF,
  1118. aFp: '#Main a[href^="/t/"]:not([target])'
  1119. }
  1120. }, // V2EX - 提醒消息页
  1121. v2ex_replies: {
  1122. pager: {
  1123. nextL: 'a.page_current+a.page_normal',
  1124. pageE: '//div[@id="Main"]//div[@class="box"]//div[@class="dock_area"] | //*[@id="Main"]//div[@class="box"]//div[@class="inner"] | //*[@id="Main"]//div[@class="box"]//div[@class="dock_area"][last()]/following-sibling::div[@class="cell"][1]',
  1125. insertP: ['//div[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1],
  1126. replaceE: '#Main > .box > .cell[style] > table',
  1127. scrollD: 1500
  1128. },
  1129. function: {
  1130. aF: v2ex_aF,
  1131. aFp: '#Main a[href^="/t/"]:not([target])'
  1132. }
  1133. }, // V2EX - 用户回复页
  1134. v2ex_go: {
  1135. pager: {
  1136. nextL: 'a.page_current+a.page_normal',
  1137. pageE: '#TopicsNode > div',
  1138. replaceE: '#Main > .box > .cell[style] > table',
  1139. scrollD: 1500
  1140. },
  1141. function: {
  1142. aF: v2ex_aF,
  1143. aFp: '#Main a.topic-link:not([target])'
  1144. }
  1145. }, // V2EX - 分类主题页
  1146. v2ex_balance: {
  1147. pager: {
  1148. nextL: 'a.page_current+a.page_normal',
  1149. pageE: '#Main .box > div:not(.cell) > table > tbody > tr:not(:first-child)',
  1150. replaceE: '#Main > .box > .cell[style] > table',
  1151. scrollD: 1000
  1152. }
  1153. }, // V2EX - 账户余额页
  1154. jandan: {
  1155. host: 'jandan.net',
  1156. url: ()=> {if (lp == '/' || indexOF('/page/')) {
  1157. curSite = DBSite.jandan;
  1158. } else if (lp == '/dzh') {
  1159. curSite = DBSite.jandan_dzh;
  1160. } else {
  1161. curSite = DBSite.jandan_comment;
  1162. }},
  1163. style: '#nav_prev, #nav_next, .post.f:not(.list-post) {display: none !important;}',
  1164. history: false,
  1165. pager: {
  1166. nextL: '//div[@class="wp-pagenavi"]/a[contains(text(), "下一页") or contains(text(), "更多文章")]',
  1167. pageE: '#content > .list-post',
  1168. replaceE: '.wp-pagenavi',
  1169. scrollD: 1500
  1170. },
  1171. function: {
  1172. bF: src_bF,
  1173. bFp: [0, 'img[data-original]', 'data-original']
  1174. }
  1175. }, // 煎蛋网
  1176. jandan_comment: {
  1177. style: '#nav_prev, #nav_next, #tucao-gg {display: none !important;} .jandan-vote a.tucao-btn23:link {color: #c8c7cc !important;} .jandan-tucao {background-color: #fafaf9 !important;}',
  1178. pager: {
  1179. nextL: 'a.previous-comment-page',
  1180. pageE: 'ol.commentlist > li[id^="comment-"], script[src^="//cdn.jandan.net/static/min/"]',
  1181. insertP: ['ol.commentlist', 3],
  1182. replaceE: '.cp-pagenavi',
  1183. scriptT: 2,
  1184. scrollD: 1500
  1185. },
  1186. function: {
  1187. bF: pageElems => { // 插入前函数(修改当前网页中的 吐槽 等按钮,避免重复添加点击事件)
  1188. getAllCSS('a.tucao-btn').forEach(function (now) {now.className = now.className.replace('tucao-btn', 'tucao-btn23');});
  1189. getAllCSS('a.comment-like.like').forEach(function (now) {now.className = now.className.replace('comment-like', 'comment-like23');});
  1190. getAllCSS('a.comment-unlike.unlike').forEach(function (now) {now.className = now.className.replace('comment-unlike', 'comment-unlike23');});
  1191. return pageElems
  1192. }
  1193. }
  1194. }, // 煎蛋网
  1195. jandan_dzh: {
  1196. history: false,
  1197. pager: {
  1198. type: 2,
  1199. nextL: '.show_more',
  1200. interval: 1500,
  1201. scrollD: 1500
  1202. }
  1203. }, // 煎蛋网 - 大杂烩
  1204. qiushibaike: {
  1205. host: 'www.qiushibaike.com',
  1206. url: ()=> {insStyle('.qrcode-wrap, .qrcode-wrap-img, .index-side-left-AD1 {display: none !important;}');
  1207. if (lp == '/') {
  1208. curSite = DBSite.qiushibaike;
  1209. } else if (!indexOF('/article/')) {
  1210. curSite = DBSite.qiushibaike_;
  1211. }},
  1212. pager: {
  1213. nextL: '//ul[@class="pagination"]//a[./span[@class="next"]]',
  1214. pageE: '.recommend-article > ul > li',
  1215. replaceE: 'ul.pagination',
  1216. scrollD: 1500
  1217. }
  1218. }, // 糗事百科
  1219. qiushibaike_: {
  1220. pager: {
  1221. nextL: '//ul[@class="pagination"]//a[./span[@class="next"]]',
  1222. pageE: '[id^="qiushi_tag_"]',
  1223. replaceE: 'ul.pagination',
  1224. scrollD: 1500
  1225. }
  1226. }, // 糗事百科 - 分类页
  1227. lkong: {
  1228. host: 'www.lkong.com',
  1229. url: ()=> {locationC = true; if (indexOF('/forum/')) {
  1230. curSite = DBSite.lkong;
  1231. } else if (indexOF('/thread/')) {
  1232. curSite = DBSite.lkong;
  1233. curSite.thread = true;
  1234. curSite.pager.pageE = '//div[@class="main-content"]/parent::div | //head/style[@data-emotion-css]';
  1235. curSite.pager.insertP = ['//div[@class="main-content"][1]/parent::div/parent::div', 3];
  1236. }},
  1237. history: false,
  1238. pager: {
  1239. nextL: ()=> { // 获取下一页地址
  1240. let next = getCSS('li.ant-pagination-next'), page;
  1241. if (next && next.getAttribute('aria-disabled') === 'false') {
  1242. page = getCSS('li.ant-pagination-item-active[title]');
  1243. if (page && page.title) {return (location.origin + location.pathname + '?page=' + ++page.title);}
  1244. }
  1245. return '';
  1246. },
  1247. pageE: '//div[@class="main-title"]/parent::div/parent::div | //head/style[@data-emotion-css]',
  1248. insertP: ['//div[@class="main-title"][1]/parent::div/parent::div/parent::div', 3],
  1249. replaceE: 'ul.ant-pagination',
  1250. interval: 500,
  1251. scrollD: 1200
  1252. }
  1253. }, // 龙的天空
  1254. pediy_forum: {
  1255. host: 'bbs.pediy.com',
  1256. url: ()=> {if (indexOF('/forum-')) {
  1257. curSite = DBSite.pediy_forum;
  1258. } else if (indexOF('/thread-')) {
  1259. curSite = DBSite.pediy_thread;
  1260. }},
  1261. pager: {
  1262. nextL: '//a[@class="page-link" and text()="▶"]',
  1263. pageE: 'table.threadlist > tbody > tr',
  1264. replaceE: 'ul.pagination',
  1265. scrollD: 1500
  1266. }
  1267. }, // 看雪论坛 - 各版块帖子列表
  1268. pediy_thread: {
  1269. thread: true,
  1270. pager: {
  1271. nextL: '//a[@class="page-link" and text()="▶"]',
  1272. pageE: 'table.postlist > tbody > tr[data-pid]',
  1273. replaceE: 'ul.pagination',
  1274. scrollD: 1500
  1275. }
  1276. }, // 看雪论坛 - 帖子内
  1277. bangumitv: {
  1278. host: 'bangumi.tv',
  1279. url: ()=> {
  1280. if (indexOF('/browser') || indexOF('/subject_search')) {
  1281. curSite = DBSite.bangumitv;
  1282. } else if (indexOF('/forum')) {
  1283. curSite = DBSite.bangumitv_forum;
  1284. }},
  1285. pager: {
  1286. nextL: '//div[@class="page_inner"]/a[text()="››"]',
  1287. pageE: 'ul#browserItemList > li',
  1288. replaceE: '.page_inner',
  1289. scrollD: 1500
  1290. }
  1291. }, // 番组计划
  1292. bangumitv_forum: {
  1293. pager: {
  1294. nextL: '//div[@class="page_inner"]/a[text()="››"]',
  1295. pageE: '.topic_list > tbody:last-of-type > tr.topic',
  1296. replaceE: '.page_inner',
  1297. scrollD: 1500
  1298. }
  1299. }, // 番组计划 - 小组帖子列表
  1300. dongchedi: {
  1301. host: 'www.dongchedi.com',
  1302. url: ()=> {locationC = true;
  1303. if (indexOF('/community/')) {
  1304. curSite = DBSite.dongchedi;
  1305. }},
  1306. pager: {
  1307. nextL: 'li.pagination-item.is-active+li > a',
  1308. pageE: '.data-wrapper > section.community-card, style',
  1309. insertP: ['.data-wrapper', 3],
  1310. replaceE: '//ul[./li[contains(@class, "pagination-item")]]',
  1311. scrollD: 2000
  1312. },
  1313. function: {
  1314. bF: pageElems => {
  1315. pageElems.forEach(function (one) {
  1316. one.querySelectorAll('.g-load-img-wrap, .tw-absolute.tw-cursor-pointer, .avatar').forEach(function (now) {
  1317. getCSS('noscript+img', now).src = getCSS('noscript > img', now).src;
  1318. });
  1319. });
  1320. return pageElems
  1321. }
  1322. }
  1323. }, // 懂车帝论坛
  1324. kdslife: {
  1325. host: 'club.kdslife.com',
  1326. url: ()=> {
  1327. if (indexOF('/f_')) {
  1328. curSite = DBSite.kdslife;
  1329. } else if (indexOF('/t_')) {
  1330. curSite = DBSite.kdslife_t;
  1331. }},
  1332. pager: {
  1333. nextL: '//div[@class="fr i3_r"]/a[text()="后一页"]',
  1334. pageE: 'ul.main_List > li.i2:not(.h_bg)',
  1335. replaceE: 'ul.main_List > li.i3',
  1336. scrollD: 1000
  1337. }
  1338. }, // 宽带山论坛
  1339. kdslife_t: {
  1340. pager: {
  1341. nextL: '//div[@class="pages"]/a[text()=">>"]',
  1342. pageE: '#reply_list_panel > *, script[src*="ui/js/kds.js"]',
  1343. insertP: ['#reply_list_panel', 3],
  1344. replaceE: '.pages',
  1345. scriptT: 2,
  1346. scrollD: 1000
  1347. }
  1348. }, // 宽带山论坛 - 帖子内
  1349. libaclub: {
  1350. host: 'www.libaclub.com',
  1351. url: ()=> {
  1352. if (lp == '/' || indexOF('/date_')) {
  1353. curSite = DBSite.libaclub;
  1354. } else if (indexOF('/f_')) {
  1355. curSite = DBSite.libaclub_f;
  1356. } else if (indexOF('/t_') || indexOF('/reply_')) {
  1357. curSite = DBSite.libaclub_t;
  1358. } else if (indexOF('/prt_')) {
  1359. curSite = DBSite.libaclub_prt;
  1360. } else if (lp == '/facade.php') {
  1361. curSite = DBSite.libaclub_search;
  1362. }},
  1363. style: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1364. pager: {
  1365. nextL: '//div[@class="ui-crumbs-more"]/a[@class="fn-link"][1]',
  1366. pageE: 'ul.ui-list > li:not(.ui-list-item-head):not(.ui-list-merchant-ad)',
  1367. replaceE: 'div.ui-crumbs-more',
  1368. scrollD: 1200
  1369. }
  1370. }, // 篱笆网论坛
  1371. libaclub_f: {
  1372. style: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1373. pager: {
  1374. nextL: 'a.ui-paging-next',
  1375. pageE: 'ul.ui-list > li:not(.ui-list-item-head):not(.ui-list-merchant-ad)',
  1376. replaceE: 'div.ui-paging',
  1377. scrollD: 1200
  1378. }
  1379. }, // 篱笆网论坛 - 各版块帖子列表
  1380. libaclub_t: {
  1381. style: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1382. pager: {
  1383. nextL: 'a.ui-paging-next',
  1384. pageE: '.ui-box-content > div.ui-topic, .ui-box-content > a[name]',
  1385. insertP: ['.ui-box-content', 3],
  1386. replaceE: 'div.ui-paging',
  1387. scrollD: 1500
  1388. }
  1389. }, // 篱笆网论坛 - 帖子内
  1390. libaclub_prt: {
  1391. style: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1392. pager: {
  1393. nextL: 'a.ui-paging-next',
  1394. pageE: 'ul.ui-list > li',
  1395. replaceE: 'div.ui-paging',
  1396. scrollD: 2000
  1397. }
  1398. }, // 篱笆网论坛 - 帖子内 - 打印版
  1399. libaclub_search: {
  1400. style: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1401. pager: {
  1402. nextL: '//div[@class="ui-page"]/a[contains(text(), "下一页")]',
  1403. pageE: '.ui-box-main > ul.ui-list > li',
  1404. replaceE: 'div.ui-page',
  1405. scrollD: 1200
  1406. }
  1407. }, // 篱笆网论坛 - 搜索页
  1408. taoguba: {
  1409. host: 'www.taoguba.com.cn',
  1410. url: ()=> {insStyle('#joinTGB {display: none !important;}')
  1411. if (indexOF('/Article/')) {
  1412. curSite = DBSite.taoguba_t;
  1413. } else if (indexOF('/shenghuoba/')) {
  1414. curSite = DBSite.taoguba_;
  1415. } else if (indexOF(/\/bbs|zongban|dianzan|jinghua\//)) {
  1416. curSite = DBSite.taoguba;
  1417. }},
  1418. history: false,
  1419. pager: {
  1420. nextL: ()=> {
  1421. let next = getXpath('//div[contains(@class, "t_page01")]/a[contains(text(), "下一页")]'), next_ = '/';
  1422. if (next) {
  1423. next = next.getAttribute('onclick').replace('gotoPage(','').replace(')','').split(',');
  1424. if (indexOF(/\/dianzan|jinghua\//)) next_ = '-';
  1425. if (parseInt(next[0]) <= parseInt(next[2])) {return (`${location.origin}/${location.pathname.split('/')[1]}/${next[0]}${next_}${next[1]}`)}
  1426. }
  1427. return '';
  1428. },
  1429. pageE: '.p_list > .p_list01[class*="user_"]',
  1430. replaceE: '.t_page',
  1431. scrollD: 1000
  1432. }
  1433. }, // 淘股吧论坛
  1434. taoguba_: {
  1435. history: false,
  1436. pager: {
  1437. nextL: ()=> {
  1438. let next = getCSS('#N_go_pageBtn'), next_ = location.pathname.split('/')[2].split('-')[0];
  1439. if (next && (parseInt(next.dataset.now) + 1 <= parseInt(next.dataset.total))) {
  1440. if (!next_) next_ = 'H';
  1441. return (`${location.origin}/shenghuoba/${next_}-${parseInt(next.dataset.now) + 1}`)
  1442. }
  1443. return '';
  1444. },
  1445. pageE: '.lifeContent-topicList-item',
  1446. replaceE: '.N_sortPage ',
  1447. scrollD: 1000
  1448. }
  1449. }, // 淘股吧论坛 - 生活圈
  1450. taoguba_t: {
  1451. history: false,
  1452. thread: true,
  1453. pager: {
  1454. nextL: ()=> {
  1455. let next = getXpath('//div[contains(@class, "t_page01")]/a[contains(text(), "下一页")]');
  1456. if (next) {
  1457. next = next.getAttribute('onclick').replace('gotoPageTopic(','').replace(')','').split(',');
  1458. if (parseInt(next[0]) <= parseInt(next[1])) {return (`${location.origin}/Article/${getCSS("#looktopicID").value}/${next[0]}`)}
  1459. }
  1460. return '';
  1461. },
  1462. pageE: 'div[id^="reply_"]',
  1463. replaceE: '.t_page',
  1464. scrollD: 1000
  1465. },
  1466. function: {
  1467. bF: src_bF,
  1468. bFp: [0, 'img[data-original]', 'data-original']
  1469. }
  1470. }, // 淘股吧论坛 - 帖子内
  1471. lowendtalk: {
  1472. host: 'lowendtalk.com',
  1473. pager: {
  1474. nextL: 'a.Next',
  1475. pageE: 'ul.DataList > li',
  1476. replaceE: '.Pager',
  1477. scrollD: 1500
  1478. }
  1479. }, // LowEndTalk
  1480. lieyou: {
  1481. host: 'bbs.lieyou888.com',
  1482. url: ()=> {if (indexOF('/forum')) {curSite = DBSite.lieyou;}},
  1483. pager: {
  1484. nextL: '//div[contains(@class, "_pageNav")]/a[text()="下一页"]',
  1485. pageE: 'ul.gb-bbs-list > li',
  1486. replaceE: '._pageNav',
  1487. scrollD: 1000
  1488. },
  1489. function: {
  1490. bF: src_bF,
  1491. bFp: [0, 'img[original]', 'original']
  1492. }
  1493. }, // 芥子空间论坛
  1494. xcar_forumdisplay: {
  1495. host: 'www.xcar.com.cn',
  1496. url: ()=> {if (lp == '/bbs/forumdisplay.php') {curSite = DBSite.xcar_forumdisplay}},
  1497. pager: {
  1498. nextL: 'a.page_down',
  1499. pageE: '.table-section > dl:not(.table_head)',
  1500. replaceE: '.forumList_page',
  1501. scrollD: 2000
  1502. }
  1503. }, // 爱卡汽车网论坛 - 各版块帖子列表
  1504. flyert_forumdisplay: {
  1505. host: 'www.flyert.com',
  1506. url: ()=> {if (indexOF('/forum-') || indexOF('mod=forumdisplay', 's')) {
  1507. curSite = DBSite.flyert_forumdisplay;
  1508. } else if (indexOF('/forum') || indexOF('mod=viewthread', 's')) {
  1509. curSite = DBSite.flyert_viewthread;
  1510. }},
  1511. pager: {
  1512. nextL: 'a.nxt:not([href*="javascript"])',
  1513. pageE: '#threadlist table > tbody[id^="normalthread_"]',
  1514. replaceE: '.pg',
  1515. scrollD: 2500
  1516. }
  1517. }, // 飞客网论坛 - 各版块帖子列表
  1518. flyert_viewthread: {
  1519. thread: true,
  1520. pager: {
  1521. nextL: 'a.nxt:not([href*="javascript"])',
  1522. pageE: '#postlist > .comiis_viewbox',
  1523. replaceE: '.comiis_pgs > .pg',
  1524. scrollD: 3000
  1525. }
  1526. }, // 飞客网论坛 - 帖子内
  1527. cnprint: {
  1528. host: 'www.cnprint.org',
  1529. url: ()=> {if (indexOF('/forum/')) {curSite = DBSite.cnprint;} else if (indexOF('/thread/')) {curSite = DBSite.cnprint_thread;}},
  1530. pager: {
  1531. nextL: 'a[rel="next"]',
  1532. pageE: 'tbody[id*="threadbits_forum"] > tr',
  1533. replaceE: '.pagenav',
  1534. scrollD: 2500
  1535. }
  1536. }, // CPC 中文印刷社区
  1537. cnprint_thread: {
  1538. thread: true,
  1539. pager: {
  1540. nextL: 'a[rel="next"]',
  1541. pageE: '#posts > div:not([id])',
  1542. replaceE: '.pagenav',
  1543. scrollD: 2000
  1544. }
  1545. }, // CPC 中文印刷社区 - 帖子内
  1546. discusshk: {
  1547. host: /.+\.discuss\.com\.hk/,
  1548. url: ()=> {if (lp == '/forumdisplay.php') {curSite = DBSite.discusshk;} else if (lp == '/viewthread.php') {curSite = DBSite.discusshk_thread;}},
  1549. pager: {
  1550. nextL: '.pagination a.next',
  1551. pageE: 'tbody[id^="normalthread_"]',
  1552. replaceE: '.pagination',
  1553. scrollD: 2000
  1554. }
  1555. }, // 中国香港社区
  1556. discusshk_thread: {
  1557. thread: true,
  1558. style: '.viewthread.mt-0:not(:first-of-type) .viewthread__head {display: none !important;}',
  1559. pager: {
  1560. nextL: '.pagination a.next',
  1561. pageE: '.viewthread',
  1562. replaceE: '.pagination',
  1563. scrollD: 2000
  1564. }
  1565. }, // 中国香港论坛 - 帖子内
  1566. tgfcer: {
  1567. host: 'bbs.tgfcer.com',
  1568. url: ()=> {if (lp == '/forumdisplay.php' || indexOF('/forum')) {curSite = DBSite.tgfcer;} else if ((lp == '/viewthread.php' || indexOF('/thread'))) {curSite = DBSite.tgfcer_thread;}},
  1569. pager: {
  1570. nextL: '.pages a.next',
  1571. pageE: 'tbody[id^="normalthread_"]',
  1572. replaceE: '.pages',
  1573. scrollD: 2000
  1574. }
  1575. }, // TGFC Lifestyle
  1576. tgfcer_thread: {
  1577. thread: true,
  1578. style: '.viewthread:not(:first-of-type) h1 {display: none !important;}',
  1579. pager: {
  1580. nextL: '.pages a.next',
  1581. pageE: '.viewthread',
  1582. replaceE: '.pages',
  1583. scrollD: 2000
  1584. }
  1585. }, // TGFC Lifestyle - 帖子内
  1586. south: {
  1587. host: /((www|bbs)\.)?(soul|north|south|white|level|summer|spring|snow)-plus\.(net|org)/,
  1588. url: ()=> {
  1589. if (lp == '/thread.php' || lp == '/search.php') {
  1590. curSite = DBSite.south;
  1591. } else if (lp == '/thread_new.php') {
  1592. curSite = DBSite.south; curSite.pager.pageE = 'li.dcsns-li'; curSite.pager.scrollD = 2000; curSite.function = {bF: src_bF,bFp: [0, 'img[data-original]', 'data-original']}; curSite.style = 'img.lazy {display: inline !important;}';
  1593. } else if (lp == '/read.php') {
  1594. curSite = DBSite.south; curSite.thread = true; curSite.pager.pageE = 'form[name=delatc] > *:not(input)';
  1595. } else if (lp == '/u.php' && (indexOF('action-topic-', 's') || indexOF('action-post-', 's'))) {
  1596. curSite = DBSite.south; curSite.pager.pageE = '#u-contentmain table tr';
  1597. }},
  1598. pager: {
  1599. nextL: '//div[@class="pages"]/ul/li[./b]/following-sibling::li[1][not(@class)]/a[not(text()="»")]',
  1600. pageE: 'tr.tr3',
  1601. replaceE: '.pages',
  1602. scrollD: 1500
  1603. }
  1604. }, // South Plus (南+)
  1605. goddessfantasy: {
  1606. host: 'www.goddessfantasy.net',
  1607. url: ()=> {
  1608. if (indexOF('board=', 's')) {
  1609. curSite = DBSite.goddessfantasy;
  1610. } else if (indexOF('topic=', 's')) {
  1611. curSite = DBSite.goddessfantasy; curSite.pager.pageE = '#quickModForm > *'; curSite.thread = true;
  1612. }},
  1613. pager: {
  1614. nextL: '//div[contains(@class,"pagelinks")]/a[@class="navPages" and text()="»"]',
  1615. pageE: '.table_grid > tbody > tr',
  1616. replaceE: '.pagelinks',
  1617. scrollD: 1500
  1618. }
  1619. }, // 纯美苹果园
  1620. adnmb3: {
  1621. host: ['adnmb3.com', 'www.tnmb.org', 'nimingban.xyz', 'nimingban.org'],
  1622. url: ()=> {
  1623. if (indexOF('/m/f/')) {
  1624. curSite = DBSite.adnmb3_mf;
  1625. } else if (indexOF('/m/t/')) {
  1626. curSite = DBSite.adnmb3_mt;
  1627. } else if (indexOF(/\/(f|Forum)\//)) {
  1628. curSite = DBSite.adnmb3;
  1629. } else if (indexOF('/t/')) {
  1630. curSite = DBSite.adnmb3_t;
  1631. }},
  1632. pager: {
  1633. nextL: '//ul[contains(@class, "pagination")]//a[text()="下一页"]',
  1634. pageE: '.h-threads-list > *, script[src$="/h.desktop.js"]',
  1635. insertP: ['.h-threads-list', 3],
  1636. replaceE: '//ul[contains(@class, "pagination")]',
  1637. scriptT: 2,
  1638. scrollD: 2500
  1639. }
  1640. }, // A 岛
  1641. adnmb3_t: {
  1642. thread: true,
  1643. pager: {
  1644. nextL: '//ul[contains(@class, "pagination")]//a[text()="下一页"]',
  1645. pageE: '.h-threads-list > .h-threads-item > .h-threads-item-replys, script[src$="/h.desktop.js"]',
  1646. insertP: ['.h-threads-list > .h-threads-item', 3],
  1647. replaceE: '//ul[contains(@class, "pagination")]',
  1648. scriptT: 2,
  1649. scrollD: 2500
  1650. }
  1651. }, // A 岛 - 帖子内
  1652. adnmb3_mf: {
  1653. pager: {
  1654. nextL: '//li[contains(@class, "pagination-next")]//a[text()="下一页"]',
  1655. pageE: '.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"]',
  1656. insertP: ['#h-threads-pagination', 1],
  1657. replaceE: '#h-threads-pagination',
  1658. scriptT: 2,
  1659. scrollD: 2500
  1660. }
  1661. }, // A 岛 - 帖子列表(手机版)
  1662. adnmb3_mt: {
  1663. thread: true,
  1664. pager: {
  1665. nextL: '//li[contains(@class, "pagination-next")]//a[text()="下一页"]',
  1666. pageE: '.h-threads-replylist > div, script[src$="/h.mobile.js"]',
  1667. insertP: ['.h-threads-replylist', 3],
  1668. replaceE: '#h-threads-pagination',
  1669. scriptT: 2,
  1670. scrollD: 2500
  1671. }
  1672. }, // A 岛 - 帖子内(手机版)
  1673. pixiv: {
  1674. host: 'www.pixiv.net',
  1675. url: ()=> {locationC = true;
  1676. if (lp == '/') {
  1677. forceTarget();
  1678. } else if (indexOF('/tags/')/* && self == top*/) {
  1679. curSite = DBSite.pixiv;
  1680. } else if (indexOF('/users/') && indexOF(/\/(artworks|illustrations|manga)/)) {
  1681. curSite = DBSite.pixiv_user;
  1682. } else if (indexOF('/artworks/')) {
  1683. setTimeout(function(){getXpath('//button[contains(string(), "查看全部") or contains(string(), "See all") or contains(string(), "すべて見る") or contains(string(), "모두 보기")]').click();}, 1000)
  1684. }
  1685. },
  1686. forceTarget: true,
  1687. style: 'ul[class*="-1 "] > li {display: inline !important;} #root{margin-bottom: -175px;} ul > li > button[class^="sc-"], a[href^="/premium/lead/lp"] {display: none !important;}',
  1688. iframe: true,
  1689. pager: {
  1690. type: 5,
  1691. nextL: 'a[aria-disabled="false"][class*="filterProps-Styled-Component"][href]:last-child',
  1692. /*pageE: '//ul[contains(@class, "-1 ")]/li',
  1693. insertP: ['//ul[contains(@class, "-1 ")]', 3],
  1694. replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]',*/
  1695. scrollD: 2000
  1696. }
  1697. }, // Pixiv - 分类页
  1698. pixiv_user: {
  1699. forceTarget: true,
  1700. style: 'ul[class*="-1 "] > li {display: inline !important;} #root{margin-bottom: -125px;} ul > li > button[class^="sc-"][style="background-color: rgb(0, 0, 0);"], a[href^="/premium/lead/lp"] {display: none !important;}',
  1701. pager: {
  1702. type: 5,
  1703. nextL: 'a[aria-disabled="false"][class*="filterProps-Styled-Component"][href]:last-child',
  1704. /*pageE: '//ul[contains(@class, "-1 ")]/li',
  1705. insertP: ['//ul[contains(@class, "-1 ")]', 3],
  1706. replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]',*/
  1707. scrollD: 2000
  1708. }
  1709. }, // Pixiv - 用户作品页
  1710. vilipix: {
  1711. host: 'www.vilipix.com',
  1712. url: ()=> {locationC = true; if (lp == '/') {forceTarget();} else if (indexOF(/\/(tags|user|new|ranking)/)) {curSite = DBSite.vilipix;}},
  1713. forceTarget: true,
  1714. pager: {
  1715. type: 6,
  1716. nextL: ()=> {let next = getCSS('li.number.active+li.number'); if (next) return (location.origin + location.pathname + '?p=' + next.textContent)},
  1717. pageE: 'ul.illust-content > li',
  1718. replaceE: 'ul.el-pager',
  1719. loadTime: 800,
  1720. scrollD: 2000
  1721. }
  1722. }, // Vilipix
  1723. pixivision: {
  1724. host: 'www.pixivision.net',
  1725. url: ()=> {if (!indexOF('/a/')) curSite = DBSite.pixivision;},
  1726. pager: {
  1727. nextL: 'a.next',
  1728. pageE: 'li.article-card-container',
  1729. replaceE: '._pager',
  1730. scrollD: 2000
  1731. }
  1732. }, // Pixivision
  1733. _58pic: {
  1734. host: 'www.58pic.com',
  1735. url: ()=> {insStyle('.qt-model-t.login-model {display: none !important;}');
  1736. if (indexOF(/\/(tupian|piccate)\//)) {
  1737. curSite = DBSite._58pic;
  1738. if (indexOF('/piccate/') && getCSS('.card-grid-box .qt-card-box[style*="width:"]')) insStyle('.card-grid-box .qt-card-box {display: block;height: 300px;min-height: 250px;}')
  1739. } else if (indexOF('/c/')) {
  1740. curSite = DBSite._58pic_c;
  1741. }},
  1742. style: '.qtw-card.place-box, .card-lazy, .is-line .is-back {display: none !important;}',
  1743. pager: {
  1744. nextL: '//div[contains(@class,"page-box")]//a[text()="下一页"]',
  1745. pageE: '.card-grid-box:not(.favorites-box) > div',
  1746. replaceE: '.page-box',
  1747. scrollD: 2500
  1748. },
  1749. function: {
  1750. bF: "src_bF",
  1751. bFp: [0, 'img[data-original]', 'data-original']
  1752. }
  1753. }, // 千图网 - 分类/搜索页
  1754. _58pic_c: {
  1755. pager: {
  1756. nextL: '//div[contains(@class,"page-box")]//a[text()="下一页"]',
  1757. pageE: '.list-box > .qtw-card',
  1758. replaceE: '.page-box',
  1759. scrollD: 4000
  1760. },
  1761. function: {
  1762. bF: src_bF,
  1763. bFp: [0, 'img[data-original]', 'data-original']
  1764. }
  1765. }, // 千图网 - 专题/收藏夹
  1766. _588ku: {
  1767. host: '588ku.com',
  1768. style: '.listlogin-box.listloginBox, .CLdialogV1, .editIndexEntry, .globalRSideB {display: none !important;}',
  1769. pager: {
  1770. nextL: '//ul[contains(@class, "page-list")]//a[text()="下一页"]',
  1771. pageE: '.data-box .dataList, .data-box .data-list',
  1772. insertP: ['.data-box .dataList, .data-box .data-list', 3],
  1773. replaceE: 'ul.page-list',
  1774. scrollD: 2000
  1775. },
  1776. function: {
  1777. bF: src_bF,
  1778. bFp: [0, 'img[data-original]', 'data-original']
  1779. }
  1780. }, // 千库网
  1781. nipic: {
  1782. host: ['www.nipic.com', 'soso.nipic.com'],
  1783. style: 'li.search-works-item {display: none !important;}',
  1784. pager: {
  1785. nextL: '//a[@title="下一页" or text()="下一页"][not(contains(@class, "search-works-nextpage"))]',
  1786. pageE: 'ul#img-list-outer > li',
  1787. replaceE: '.common-page-box, .common-seo-page-box',
  1788. scrollD: 2000
  1789. },
  1790. function: {
  1791. bF: src_bF,
  1792. bFp: [0, 'img[data-original]', 'data-original']
  1793. }
  1794. }, // 昵图网
  1795. ztupic: {
  1796. host: 'www.ztupic.com',
  1797. url: ()=> {if (lp != '/' && !indexOF('/sucai/')) {curSite = DBSite.ztupic;}},
  1798. pager: {
  1799. nextL: 'a.page-link[rel="next"]',
  1800. pageE: '.floor_item',
  1801. replaceE: 'ul.pagination',
  1802. scrollD: 2000
  1803. },
  1804. function: {
  1805. bF: src_bF,
  1806. bFp: [0, 'img[data-src]', 'data-src']
  1807. }
  1808. }, // 众图网
  1809. ooopic: {
  1810. host: ['www.ooopic.com', 'so.ooopic.com', 'weili.ooopic.com'],
  1811. url: ()=> {if (lp != '/' && !indexOF('/weili_')) {curSite = DBSite.ooopic;}},
  1812. style: '.overWidth.clearfix.masonry {height: auto !important;} .pic-list, .video-list {position: relative !important;float: left !important;top: auto !important;left: auto !important;}',
  1813. pager: {
  1814. nextL: 'a.next_page, a.so-next',
  1815. pageE: '.overWidth.clearfix.masonry > div',
  1816. replaceE: '.page',
  1817. scrollD: 2000
  1818. },
  1819. function: {
  1820. bF: src_bF,
  1821. bFp: [0, 'img[data-original]', 'data-original']
  1822. }
  1823. }, // 我图网
  1824. ibaotu: {
  1825. host: 'ibaotu.com',
  1826. url: ()=> {if (lp != '/' && !indexOF('/sucai/')) {curSite = DBSite.ibaotu;if (indexOF('/yinxiao') || indexOF('/peiyue')) {curSite.pager.pageE = 'ul.media-list-ul > li[pr-data-title]'} else if (indexOF('/font/')) {curSite.pager.pageE = '.baotufonts-list > a'}}},
  1827. style: '.searchAdver {display: none !important;}',
  1828. pager: {
  1829. nextL: 'a.next',
  1830. pageE: '.pr-container[pr-data-title]:not(.searchAdver)',
  1831. replaceE: '.pagelist',
  1832. scrollD: 2000
  1833. },
  1834. function: {
  1835. bF: src_bF,
  1836. bFp: [0, 'img[data-url]', 'data-url']
  1837. }
  1838. }, // 包图网
  1839. pixabay: {
  1840. host: 'pixabay.com',
  1841. pager: {
  1842. nextL: '//a[text()="›"]',
  1843. pageE: '[class^="results"] > [class^="container"] > div',
  1844. replaceE: '//a[text()="›"]',
  1845. scrollD: 2000
  1846. },
  1847. function: {
  1848. bF: src_bF,
  1849. bFp: [0, 'img[data-lazy-src]', 'data-lazy-src']
  1850. }
  1851. }, // Pixabay
  1852. logosc: {
  1853. host: 'www.logosc.cn',
  1854. url: '/\\/so\\//',
  1855. pager: {
  1856. type: 2,
  1857. nextL: 'button.so-pablo-button',
  1858. interval: 1500,
  1859. scrollD: 1500
  1860. }
  1861. }, // 搜图神器 (免费无版权)
  1862. sccnn: {
  1863. host: 'www.sccnn.com',
  1864. pager: {
  1865. nextL: '//ul[@class="listpage"]//a[text()=">"]',
  1866. pageE: 'td[valign="TOP"]:not([width]) tr[valign="Middle"]',
  1867. replaceE: 'ul.listpage',
  1868. scrollD: 1000
  1869. }
  1870. }, // 素材中国
  1871. sccnn_so: {
  1872. host: 'so.sccnn.com',
  1873. pager: {
  1874. nextL: 'font[color="Red"]+a.F16',
  1875. pageE: '//tr[@valign="Top"][1]/preceding-sibling::tr',
  1876. replaceE: '//tr[@valign="Top"][last()]',
  1877. scrollD: 1000
  1878. }
  1879. }, // 素材中国 - 搜索页
  1880. pngss: {
  1881. host: 'pngss.com',
  1882. url: ()=> {if (lp == '/search') curSite = DBSite.pngss;},
  1883. pager: {
  1884. nextL: '.page a[rel="next"]',
  1885. pageE: 'ul.list-ul > li',
  1886. replaceE: '.page',
  1887. scrollD: 1200
  1888. },
  1889. function: {
  1890. bF: src_bF,
  1891. bFp: [0, 'img[data-original]', 'data-original']
  1892. }
  1893. }, // PNG 搜索网
  1894. iconfont: {
  1895. host: 'www.iconfont.cn',
  1896. url: ()=> {locationC = true; if (indexOF('/search/')) curSite = DBSite.iconfont;},
  1897. forceTarget: true,
  1898. style: '.footer, header .bind-tips, .block-pagination-wrap, #magix_vf_main .block-sub-banner, #J_block_sidebar {display: none !important;}',
  1899. iframe: true,
  1900. pager: {
  1901. type: 5,
  1902. nextL: ()=> getNextEP('li.active+li:not(.disabled) > a', 'page=', /page=\d+/),
  1903. scrollD: 1000
  1904. }
  1905. }, // iconfont
  1906. iconarchive: {
  1907. host: 'iconarchive.com',
  1908. url: '/\\/(tag|search|category)/',
  1909. pager: {
  1910. nextL: 'a.next',
  1911. pageE: '.icondetail',
  1912. replaceE: '.pagination',
  1913. scrollD: 2000
  1914. }
  1915. }, // IconArchive
  1916. puxiang: {
  1917. host: 'www.puxiang.com',
  1918. url: ()=> {if (lp == '/search/favorite') {
  1919. curSite = DBSite.puxiang_collect;
  1920. } else if (lp == '/search/puxiang' || lp == '/list' || lp == '/galleries' || lp == '/articles') {
  1921. curSite = DBSite.puxiang;
  1922. } else if (lp == '/') {
  1923. curSite = DBSite.puxiang; curSite.pager.scrollD = 4000;
  1924. }},
  1925. pager: {
  1926. nextL: 'li.next > a',
  1927. pageE: '.work-list > div',
  1928. replaceE: '.pagerbar',
  1929. scrollD: 1500
  1930. }
  1931. }, // 普象网 - 作品集/搜索页
  1932. puxiang_collect: {
  1933. pager: {
  1934. nextL: 'li.next > a',
  1935. pageE: '.collect-list > div',
  1936. replaceE: '.pagerbar',
  1937. scrollD: 1500
  1938. }
  1939. }, // 普象网 - 收藏夹
  1940. xuexiniu: {
  1941. host: ['www.xuexiniu.com', 'bbs.xuexiniu.com'],
  1942. url: ()=> {
  1943. if (getCSS('body#nv_forum.pg_forumdisplay')) {
  1944. if (getCSS('ul.waterfall')) {
  1945. curSite = DBSite.xuexiniu_forum;
  1946. } else {
  1947. curSite = DBSite.discuz_guide
  1948. }
  1949. } else if (getCSS('body#nv_forum.pg_viewthread')) {
  1950. curSite = DBSite.xuexiniu_thread;
  1951. } else if (indexOF('/search.php')) {
  1952. curSite = DBSite.xuexiniu_search;
  1953. } else {
  1954. curSite = DBSite.xuexiniu;
  1955. }
  1956. },
  1957. pager: {
  1958. nextL: '//a[@class="page-link" and contains(text(), "下一页")]',
  1959. pageE: '.row > .col-sm-6',
  1960. replaceE: 'ul.pagination',
  1961. scrollD: 1000
  1962. }
  1963. }, // 学犀牛 - 分类页
  1964. xuexiniu_forum: {
  1965. pager: {
  1966. nextL: 'a.nxt:not([href*="javascript"])',
  1967. pageE: '.waterfall > li',
  1968. replaceE: '.pg',
  1969. scrollD: 1500
  1970. }
  1971. }, // 学犀牛 - 各板块帖子列表
  1972. xuexiniu_thread: {
  1973. thread: true,
  1974. pager: {
  1975. nextL: 'a.nxt:not([href*="javascript"])',
  1976. pageE: '#zhanzhuai_primary > .box',
  1977. replaceE: '.pg',
  1978. scrollD: 1500
  1979. }
  1980. }, // 学犀牛 - 帖子内
  1981. xuexiniu_search: {
  1982. pager: {
  1983. nextL: 'a.nxt:not([href*="javascript"])',
  1984. pageE: '.yangshi.yangshi2',
  1985. insertP: ['.page', 1],
  1986. replaceE: '.page',
  1987. scrollD: 1500
  1988. }
  1989. }, // 学犀牛 - 搜索页
  1990. om: {
  1991. host: 'www.om.cn',
  1992. url: '/^\\/.+/',
  1993. pager: {
  1994. nextL: 'li.next > a',
  1995. pageE: '.main_content > ul > li',
  1996. replaceE: 'ul.pagination',
  1997. scrollD: 1500
  1998. }
  1999. }, // 欧模网
  2000. xiadele: {
  2001. host: ['www.xiadele.com', 'search.xiadele.com'],
  2002. url: '/^\\/.+/',
  2003. style: '.last-li-carousel-img {display: none !important;}',
  2004. pager: {
  2005. nextL: 'li.next_page a[rel="next"]',
  2006. pageE: 'ul.list-page-ul > li',
  2007. replaceE: 'ul.pagination',
  2008. scrollD: 2000
  2009. }
  2010. }, // 下得乐
  2011. Mixkit: {
  2012. host: 'mixkit.co',
  2013. url: '/^\\/.+/',
  2014. pager: {
  2015. nextL: 'a.pagination__link--next',
  2016. pageE: '.item-grid-item',
  2017. replaceE: '.pagination__wrapper',
  2018. scrollD: 2000
  2019. }
  2020. }, // Mixkit
  2021. _3dmgame: {
  2022. host: 'www.3dmgame.com',
  2023. url: ()=> {
  2024. if (getCSS('.Llist_b > div.lis')) {
  2025. curSite = DBSite._3dmgame_list;
  2026. } else if (getCSS('.newsleft > ul')) {
  2027. curSite = DBSite._3dmgame_list2;
  2028. } else if (indexOF('/resource')) {
  2029. curSite = DBSite._3dmgame_list3;
  2030. } else {
  2031. curSite = DBSite._3dmgame;
  2032. }},
  2033. pager: {
  2034. type: 3,
  2035. nextL: 'li.next > a',
  2036. pageE: 'script[src*="common.js"], .news_warp_center > *',
  2037. insertP: ['.news_warp_center', 3],
  2038. replaceE: '.pagewrap',
  2039. scrollE: '.pagewrap',
  2040. scriptT: 2,
  2041. interval: 500,
  2042. scrollD: 500
  2043. }
  2044. }, // 3DM
  2045. _3dmgame_list: {
  2046. pager: {
  2047. nextL: 'li.next > a',
  2048. pageE: '.Llist_b > div.lis',
  2049. replaceE: '.pagewrap',
  2050. scrollD: 1000
  2051. },
  2052. function: {
  2053. bF: src_bF,
  2054. bFp: [0, 'img[data-original]', 'data-original']
  2055. }
  2056. }, // 3DM - 分类页
  2057. _3dmgame_list2: {
  2058. pager: {
  2059. nextL: 'li.next > a',
  2060. pageE: '.newsleft > ul > li',
  2061. replaceE: '.pagewrap',
  2062. scrollD: 1000
  2063. },
  2064. function: {
  2065. bF: src_bF,
  2066. bFp: [0, 'img[data-original]', 'data-original']
  2067. }
  2068. }, // 3DM - 游戏专区 - 分类页
  2069. _3dmgame_list3: {
  2070. pager: {
  2071. nextL: 'li.next > a',
  2072. pageE: '.item > ul',
  2073. insertP: ['.item > ul:last-child', 1],
  2074. replaceE: '.pagewrap',
  2075. scrollD: 800
  2076. }
  2077. }, // 3DM - 游戏专区 - 资源页
  2078. _3dmgame_mod: {
  2079. host: 'mod.3dmgame.com',
  2080. pager: {
  2081. nextL: ()=> getNextEP('//li[@class="page-list active"]/following-sibling::li[contains(@class, "page-list")]/a', 'Page=', /Page=\d+/),
  2082. pageE: '//div[contains(@class, "game-mod-list") or contains(@class, "search-mod-list")] | //script[not(@src or @type)][contains(text(), ".game-mod-page") or contains(text(), ".search-mod-page")]',
  2083. insertP: ['//div[contains(@class, "game-mod-wrap") or contains(@class, "search-mod ")]', 3],
  2084. scriptT: 2,
  2085. scrollD: 1200
  2086. }
  2087. }, // 3DM MOD站
  2088. ali213_www: {
  2089. host: 'www.ali213.net',
  2090. pager: {
  2091. type: 3,
  2092. nextL: '#after_this_page',
  2093. pageE: '#Content >*:not(.news_ding):not(.page_fenye)',
  2094. insertP: ['.page_fenye', 1],
  2095. replaceE: '.page_fenye',
  2096. scrollE: '.page_fenye',
  2097. interval: 500,
  2098. scrollD: 100
  2099. }
  2100. }, // 游侠网
  2101. ali213_list: {
  2102. host: 'down.ali213.net',
  2103. url: ()=> {if (getCSS('.famous-ul > .famous-li')) {curSite = DBSite.ali213_list;}},
  2104. pager: {
  2105. nextL: 'a.page-next',
  2106. pageE: '.famous-ul > .famous-li',
  2107. replaceE: '.page-container',
  2108. scrollD: 1000
  2109. },
  2110. function: {
  2111. bF: src_bF,
  2112. bFp: [0, 'img[data-original]', 'data-original']
  2113. }
  2114. }, // 游侠网 - 分类页
  2115. ali213_gl: {
  2116. host: 'gl.ali213.net',
  2117. style: '.n_show_b, a.morezjjump {display: none !important;}',
  2118. pager: {
  2119. type: 3,
  2120. nextL: 'a.next',
  2121. pageE: '.c-detail > *',
  2122. insertP: ['.c-detail', 3],
  2123. replaceE: '.page_fenye',
  2124. scrollE: '.page_fenye',
  2125. interval: 500,
  2126. scrollD: 300
  2127. }
  2128. }, // 游侠网 - 攻略
  2129. ali213_pic: {
  2130. host: 'pic.ali213.net',
  2131. style: 'a.prev, a.next {display: none !important;}',
  2132. pager: {
  2133. nextL: 'a.next',
  2134. pageE: '#image-show > img',
  2135. replaceE: '#image-show > a',
  2136. scrollD: 1200
  2137. }
  2138. }, // 游侠网 - 图库
  2139. gamersky_ent: {
  2140. host: 'www.gamersky.com',
  2141. url: ()=> {if (indexOF('/ent/')) {
  2142. curSite = DBSite.gamersky_ent;
  2143. } else {
  2144. curSite = DBSite.gamersky_gl;
  2145. if (indexOF('/zl/') && indexOF('.shtml')) {curSite.pager.insertP = ['.pagecss', 1]; curSite.pager.scrollD = 400;}
  2146. }},
  2147. pager: {
  2148. type: 3,
  2149. nextL: '//div[@class="page_css"]/a[text()="下一页"]',
  2150. pageE: '.Mid2L_con > *:not(.gs_nc_editor):not(.pagecss):not(.page_css):not(.gs_ccs_solve):not(.post_ding)',
  2151. insertP: ['.page_css', 1],
  2152. replaceE: '.page_css',
  2153. scrollE: '.page_css',
  2154. interval: 500,
  2155. scrollD: 100
  2156. }
  2157. }, // 游民星空
  2158. gamersky_gl: {
  2159. pager: {
  2160. type: 3,
  2161. nextL: '//div[@class="page_css"]/a[text()="下一页"]',
  2162. pageE: '.Mid2L_con > *:not(.gs_nc_editor):not(.pagecss):not(.gs_ccs_solve):not(.post_ding)',
  2163. insertP: ['.gs_nc_editor', 1],
  2164. replaceE: '.page_css',
  2165. scrollE: '.page_css',
  2166. forceHTTPS: true,
  2167. interval: 500,
  2168. scrollD: 100
  2169. },
  2170. function: {
  2171. bF: pageElems => { // 插入前函数(移除下一页底部的 "更多相关内容请关注:xxx" 文字 + 加载图片)
  2172. pageElems.forEach(function (one) {if (one.tagName === 'P' && one.textContent.indexOf('更多相关内容请关注') > -1) {one.style.display = 'none';}});
  2173. return src_bF(pageElems, [0, 'img[data-src]', 'data-src'])
  2174. }
  2175. }
  2176. }, // 游民星空 - 攻略
  2177. nexusmods: {
  2178. host: 'www.nexusmods.com',
  2179. url: ()=> {locationC = true; if (!(lp == '/' || indexOF(/\/mods\/\d+/))) {curSite = DBSite.nexusmods;}},
  2180. history: false,
  2181. pager: {
  2182. nextL: nexusmods_nextL,
  2183. pageE: 'ul.tiles > li',
  2184. replaceE: '.pagination',
  2185. scrollD: 4000
  2186. },
  2187. function: {
  2188. bF: nexusmods_bF
  2189. }
  2190. }, // NexusMods
  2191. curseforge: {
  2192. host: 'www.curseforge.com',
  2193. pager: {
  2194. nextL: '.pagination-next > a',
  2195. pageE: 'div.my-2',
  2196. replaceE: '.pagination',
  2197. scrollD: 2500
  2198. }
  2199. }, // CurseForge
  2200. steamcommunity_workshop: {
  2201. host: 'steamcommunity.com',
  2202. url: ()=> {if (indexOF('/workshop/browse')) {curSite = DBSite.steamcommunity_workshop;} else if (indexOF(/eventcomments\/\d/)) {curSite = DBSite.steamcommunity_eventcomments;}},
  2203. pager: {
  2204. nextL: '//a[@class="pagebtn" and text()=">"]',
  2205. pageE: '.workshopBrowseItems > *',
  2206. replaceE: '.workshopBrowsePaging',
  2207. scriptT: 2,
  2208. scrollD: 1500
  2209. }
  2210. }, // Steam 创意工坊 - 项目列表
  2211. steamcommunity_eventcomments: {
  2212. style: '.forum_paging_controls {display: none !important;}',
  2213. pager: {
  2214. nextL: ()=> getNextUP('ctp=', /ctp=\d+/, location.pathname, '2', getCSS('span.commentthread_pagelinks > a:last-child').textContent),
  2215. pageE: '.commentthread_comments > .commentthread_comment',
  2216. replaceE: '.forum_paging .forum_paging_summary',
  2217. scriptT: 1,
  2218. scrollD: 1500
  2219. }
  2220. }, // Steam 社区 - 活动评论
  2221. yikm: {
  2222. host: 'www.yikm.net',
  2223. pager: {
  2224. nextL: '//ul[@class="pager"]//a[text()="下一页"]',
  2225. pageE: '//h2[contains(text(), "所有游戏") or contains(text(), "搜索结果")]/following-sibling::div[1]/div',
  2226. replaceE: 'ul.pager',
  2227. scrollD: 1500
  2228. }
  2229. }, // 小霸王其乐无穷
  2230. switch520: {
  2231. host: 'switch520.com',
  2232. url: ()=> {if (!indexOF('.html')) {curSite = DBSite.switch520;}},
  2233. pager: {
  2234. nextL: 'a.next',
  2235. pageE: '.row.posts-wrapper > div',
  2236. replaceE: 'ul.page-numbers',
  2237. scrollD: 1000
  2238. }
  2239. }, // Switch520
  2240. cs_rin_ru: {
  2241. host: 'cs.rin.ru',
  2242. url: ()=> {if (lp == '/forum/viewforum.php') {
  2243. curSite = DBSite.cs_rin_ru;
  2244. } else if (lp == '/forum/search.php') {
  2245. curSite = DBSite.cs_rin_ru_search;
  2246. if (indexOF('sr=posts', 's')) curSite.pager.pageE = '#wrapcentre > form > table.tablebg > tbody > tr[class^="row"]'
  2247. } else if (lp == '/forum/viewtopic.php') {
  2248. curSite = DBSite.cs_rin_ru_list;
  2249. }},
  2250. pager: {
  2251. nextL: '//td[@class="gensmall"][@align="right"]//a[text()="Next"]',
  2252. pageE: '#pagecontent > table.tablebg > tbody > tr:not([align])',
  2253. replaceE: '#pagecontent > table:first-child',
  2254. scrollD: 1500
  2255. },
  2256. function: {
  2257. bF: pageElems => { // 插入前函数(过滤置顶帖子)
  2258. for (let i = 0; i < pageElems.length; i++) {if (pageElems[i].textContent.replace(/\n| /g,'') === 'Topics') {pageElems.splice(0,i+1); break;}}
  2259. return pageElems
  2260. }
  2261. }
  2262. }, // cs.rin.ru - 各版块帖子列表
  2263. cs_rin_ru_list: {
  2264. thread: true,
  2265. pager: {
  2266. nextL: 'id("pageheader")/p[@class="gensmall"]//a[text()="Next"]',
  2267. pageE: '#pagecontent > table.tablebg:not(:nth-last-child(2)):not(:nth-child(2))',
  2268. replaceE: '#pagecontent >table:not(.tablebg), #pageheader p.gensmall',
  2269. scrollD: 2000
  2270. }
  2271. }, // cs.rin.ru - 帖子内
  2272. cs_rin_ru_search: {
  2273. pager: {
  2274. nextL: 'id("wrapcentre")/div[@class="nav"]//a[text()="Next"]',
  2275. pageE: '#wrapcentre > form > table.tablebg > tbody > tr[valign]',
  2276. replaceE: '#wrapcentre > div',
  2277. scrollD: 1500
  2278. }
  2279. }, // cs.rin.ru - 搜索页
  2280. crackhub: {
  2281. host: 'crackhub.site',
  2282. style: 'html.wp-dark-mode-active .inside-article {background-color: var(--wp-dark-mode-bg);}',
  2283. pager: {
  2284. nextL: 'a.next.page-numbers',
  2285. pageE: 'article[id^="post-"]',
  2286. replaceE: 'nav.paging-navigation',
  2287. scrollD: 2000
  2288. }
  2289. }, // Crackhub213
  2290. fitgirl: {
  2291. host: 'fitgirl-repacks.site',
  2292. pager: {
  2293. nextL: 'a.next.page-numbers',
  2294. pageE: 'article[id^="post-"]',
  2295. replaceE: 'nav.paging-navigation',
  2296. scrollD: 2500
  2297. }
  2298. }, // FitGirl Repacks
  2299. bilibili_search: {
  2300. host: 'search.bilibili.com',
  2301. url: ()=> {
  2302. locationC = true;
  2303. if (lp == '/all' || lp == '/video') {
  2304. curSite = DBSite.bilibili_search;
  2305. } else if (lp == '/article') {
  2306. curSite = DBSite.bilibili_search_article;
  2307. }
  2308. },
  2309. retry: 100,
  2310. pager: {
  2311. nextL: bilibili_search_nextL,
  2312. pageE: '//ul[contains(@class, "video-list")]/li | //script[contains(text(), "window.__INITIAL_STATE__")]',
  2313. insertP: ['ul.video-list', 3],
  2314. replaceE: 'ul.pages',
  2315. scriptT: 2,
  2316. scrollD: 1000
  2317. },
  2318. function: {
  2319. bF: bilibili_search_bF,
  2320. aF: bilibili_search_aF
  2321. }
  2322. }, // B 站(Bilibili) - 搜索页 - 视频
  2323. bilibili_search_article: {
  2324. retry: 100,
  2325. pager: {
  2326. nextL: bilibili_search_nextL,
  2327. pageE: 'li.article-item',
  2328. replaceE: 'ul.pages',
  2329. //scriptT: 2,
  2330. scrollD: 1000
  2331. }
  2332. }, // B 站(Bilibili) - 搜索页 - 专栏
  2333. cupfox: {
  2334. host: 'www.cupfox.com',
  2335. pager: {
  2336. type: 2,
  2337. nextL: '.load-more',
  2338. nextText: '点击加载更多',
  2339. scrollD: 700
  2340. }
  2341. }, // 茶杯狐
  2342. novipnoad: {
  2343. host: 'www.novipnoad.com',
  2344. url: ()=> {if (lp != '/' && !indexOF('.html')) {curSite = DBSite.novipnoad;}},
  2345. pager: {
  2346. nextL: 'a.nextpostslink',
  2347. pageE: '.video-listing-content .row > div',
  2348. replaceE: '.wp-pagenavi',
  2349. scrollD: 1500
  2350. },
  2351. function: {
  2352. bF: src_bF,
  2353. bFp: [0, 'img[data-original]', 'data-original']
  2354. }
  2355. }, // NO视频
  2356. ddrk: {
  2357. host: ['ddrk.me', 'ddys.tv'],
  2358. url: ()=> {if (lp == '/' || indexOF(/\/(category|tag)\//)) {curSite = DBSite.ddrk;}},
  2359. pager: {
  2360. nextL: 'a.next',
  2361. pageE: '.post-box-list > article',
  2362. replaceE: '.pagination_wrap',
  2363. scrollD: 1500
  2364. }
  2365. }, // 低端影视
  2366. nfmovies: {
  2367. host: 'www.nfmovies.com',
  2368. url: ()=> {if (lp == '/search.php' || indexOF('/list/')) {curSite = DBSite.nfmovies;}},
  2369. pager: {
  2370. nextL: '//ul[contains(@class, "myui-page")]/li/a[text()="下一页"]',
  2371. pageE: 'ul.myui-vodlist > li',
  2372. replaceE: 'ul.myui-page',
  2373. scrollD: 1500
  2374. },
  2375. function: {
  2376. bF: src_bF,
  2377. bFp: [1, 'a[data-original]', 'data-original']
  2378. }
  2379. }, // 奈菲影视
  2380. zxzj: {
  2381. host: ['www.zxzj.me', 'www.zxzj.fun'],
  2382. url: ()=> {if (lp != '/' && !indexOF('/detail/') && !indexOF('/video/')) {curSite = DBSite.zxzj;}},
  2383. style: 'div.stui-page__all {display: none !important;}',
  2384. pager: {
  2385. nextL: '//ul[contains(@class, "stui-page__item")]//a[text()="下一页"]',
  2386. pageE: 'ul.stui-vodlist > li',
  2387. replaceE: 'ul.stui-page__item',
  2388. scrollD: 1000
  2389. },
  2390. function: {
  2391. bF: src_bF,
  2392. bFp: [1, 'a[data-original]', 'data-original']
  2393. }
  2394. }, // 在线之家
  2395. enlienli: {
  2396. host: 'enlienli.com',
  2397. url: ()=> {if (indexOF('/show/') || indexOF('/search')) {curSite = DBSite.enlienli;}},
  2398. pager: {
  2399. nextL: 'a.page-number.page-next',
  2400. pageE: '.module-items > *',
  2401. replaceE: '#page',
  2402. scrollD: 1000
  2403. },
  2404. function: {
  2405. bF: src_bF,
  2406. bFp: [0, 'img[data-src]', 'data-src']
  2407. }
  2408. }, // 嗯哩嗯哩
  2409. mjw91: {
  2410. host: 'mjw91.com',
  2411. url: ()=> {if (!indexOF('/video/') || !indexOF('/vplay/')) {curSite = DBSite.mjw91;}},
  2412. pager: {
  2413. nextL: '.next-page > a',
  2414. pageE: '.m-movies > article',
  2415. replaceE: '.pagination',
  2416. scrollD: 1500
  2417. },
  2418. function: {
  2419. bF: src_bF,
  2420. bFp: [0, 'img[data-original]', 'data-original']
  2421. }
  2422. }, // 91 美剧网
  2423. zhenbuka: {
  2424. host: ['www.zhenbuka3.com', 'www.zhenbuka5.com'],
  2425. url: ()=> {if (indexOF('/vodtype/')) {curSite = DBSite.zhenbuka;}},
  2426. pager: {
  2427. nextL: '//ul[contains(@class, "stui-page")]/li/a[text()="下一页"]',
  2428. pageE: 'ul.stui-vodlist > li',
  2429. replaceE: 'ul.stui-page',
  2430. scrollD: 1500
  2431. },
  2432. function: {
  2433. bF: src_bF,
  2434. bFp: [1, 'a[data-original]', 'data-original']
  2435. }
  2436. }, // 真不卡影院
  2437. zzzfun: {
  2438. host: 'www.zzzfun.com',
  2439. url: ()=> {
  2440. if (indexOF('/vod_type') || indexOF('/vod_show')) {
  2441. curSite = DBSite.zzzfun;
  2442. } else if (indexOF('/vod_search')) {
  2443. curSite = DBSite.zzzfun_search;
  2444. }},
  2445. pager: {
  2446. nextL: '#page a[title="下一页"]',
  2447. pageE: 'ul.search-result > a',
  2448. replaceE: '#page',
  2449. scrollD: 1000
  2450. },
  2451. function: {
  2452. bF: src_bF,
  2453. bFp: [0, 'img[data-original]', 'data-original']
  2454. }
  2455. }, // ZzzFun 动漫
  2456. zzzfun_search: {
  2457. pager: {
  2458. nextL: '#page a[title="下一页"]',
  2459. pageE: 'ul.show-list > li',
  2460. replaceE: '#page',
  2461. scrollD: 1000
  2462. },
  2463. function: {
  2464. bF: src_bF,
  2465. bFp: [0, 'img[data-original]', 'data-original']
  2466. }
  2467. }, // ZzzFun 动漫 - 搜索页
  2468. tucao: {
  2469. host: 'www.tucao.one',
  2470. url: ()=> {if (indexOF('/list/')) {
  2471. curSite = DBSite.tucao;
  2472. } else if (indexOF('search', 's')) {
  2473. curSite = DBSite.tucao_search;
  2474. }},
  2475. pager: {
  2476. nextL: '.pagego a',
  2477. pageE: '.list > ul > li',
  2478. replaceE: '.newpages, .pagego, #float_show',
  2479. scrollD: 1000
  2480. }
  2481. }, // 吐槽弹幕网
  2482. tucao_search: {
  2483. pager: {
  2484. nextL: '//a[@class="a1"][contains(text(), "下一页")]',
  2485. pageE: '.search_list > *',
  2486. replaceE: '.pages',
  2487. scrollD: 1000
  2488. }
  2489. }, // 吐槽弹幕网 - 搜索页
  2490. mandao: {
  2491. host: 'www.mandao.tv',
  2492. url: ()=> {if (lp != '/' && !indexOF('/man')) {
  2493. curSite = DBSite.mandao;
  2494. }},
  2495. pager: {
  2496. nextL: '//div[contains(@class, "page")]/a[text()=">"]',
  2497. pageE: '.index-tj > ul > li',
  2498. replaceE: '.page',
  2499. scrollD: 1000
  2500. },
  2501. function: {
  2502. bF: src_bF,
  2503. bFp: [0, 'img[data-original]', 'data-original']
  2504. }
  2505. }, // 漫岛动漫
  2506. yxdm: {
  2507. host: 'www.yxdm.li',
  2508. url: ()=> {if (indexOF('/search') || indexOF('/category') || indexOF('/resource')) {curSite = DBSite.yxdm;}},
  2509. pager: {
  2510. nextL: '//a[@class="nextPage" or text()="下一页"]',
  2511. pageE: '.dhnew > ul > li',
  2512. replaceE: '.pagelist',
  2513. scrollD: 2000
  2514. }
  2515. }, // 怡萱动漫
  2516. nicotv: {
  2517. host: 'www.nicotv.me',
  2518. url: ()=> {if (indexOF('/search') || indexOF('/type')) {curSite = DBSite.nicotv;}},
  2519. pager: {
  2520. nextL: '//ul[contains(@class, "pagination ")]//a[text()="»"]',
  2521. pageE: 'ul.list-unstyled > li',
  2522. replaceE: 'ul.pagination ',
  2523. scrollD: 1000
  2524. },
  2525. function: {
  2526. bF: src_bF,
  2527. bFp: [0, 'img[data-original]', 'data-original']
  2528. }
  2529. }, // 妮可动漫
  2530. yhdm: {
  2531. host: ['www.imomoe.la', 'www.imomoe.live'],
  2532. url: ()=> {if (indexOF('/list/')) {
  2533. curSite = DBSite.yhdm;
  2534. } else if (lp == '/so.asp' || lp == '/search.asp') {
  2535. curSite = DBSite.yhdm_;
  2536. }},
  2537. pager: {
  2538. nextL: '//div[@class="pages"]/a[text()="下一页"]',
  2539. pageE: '#contrainer > .img> ul > li',
  2540. replaceE: '.pages',
  2541. scrollD: 1000
  2542. }
  2543. }, // 樱花动漫
  2544. yhdm_: {
  2545. pager: {
  2546. nextL: '//div[@class="pages"]/a[text()="下一页"]',
  2547. pageE: '#contrainer .fire .pics > ul > li',
  2548. replaceE: '.pages',
  2549. scrollD: 1000
  2550. }
  2551. }, // 樱花动漫 - 搜索页等
  2552. agefans: {
  2553. host: ['www.agemys.com', 'www.age.tv'],
  2554. url: ()=> {if (indexOF('/catalog/') || lp == '/search') {
  2555. curSite = DBSite.agefans;
  2556. } else if (lp == '/recommend' || lp == '/update') {
  2557. curSite = DBSite.agefans_;
  2558. } else if (lp == '/rank') {
  2559. curSite = DBSite.agefans_rank;
  2560. }},
  2561. pager: {
  2562. nextL: 'id("container")//div[@class="blockcontent"]/div[@style][not(@class)]/li/a[contains(text(), "下一页")]',
  2563. pageE: '#container .blockcontent1 > div',
  2564. replaceE: '#container .blockcontent > div[style]:not([class])',
  2565. scrollD: 1000
  2566. }
  2567. }, // AGE 动漫 - 全部/搜索
  2568. agefans_: {
  2569. pager: {
  2570. nextL: 'id("container")//div[@class="blockcontent"]/div[@style][not(@class)]/li/a[contains(text(), "下一页")]',
  2571. pageE: '#container .blockcontent > ul > li',
  2572. replaceE: '#container .blockcontent > div[style]:not([class])',
  2573. scrollD: 1000
  2574. }
  2575. }, // AGE 动漫 - 其他页
  2576. agefans_rank: {
  2577. pager: {
  2578. nextL: 'id("container")/ul[@style][not(@class)]/li/a[contains(text(), "下一页")]',
  2579. pageE: '#container > .div_right .blockcontent.div_right_r_3 > ul',
  2580. replaceE: '#container > ul[style]:not([class])',
  2581. scrollD: 1000
  2582. }
  2583. }, // AGE 动漫 - 排行榜
  2584. dm233: {
  2585. host: 'www.dm233.cc',
  2586. url: ()=> {if (indexOF('/catalog/') || lp == '/recommend/' || lp == '/search') {
  2587. curSite = DBSite.dm233;
  2588. } else if (lp == '/article/') {
  2589. curSite = DBSite.dm233_article;
  2590. } else if (lp == '/rank/') {
  2591. curSite = DBSite.dm233_rank;
  2592. }},
  2593. pager: {
  2594. nextL: '//div[@class="pagelist"]//a[contains(text(), "下一页") or contains(text(), "下一頁")]',
  2595. pageE: '.dhnew ul > li',
  2596. replaceE: '.pagelist',
  2597. scrollD: 1000
  2598. }
  2599. }, // 233 动漫
  2600. dm233_article: {
  2601. pager: {
  2602. nextL: '//div[@class="pagelist"]//a[contains(text(), "下一页") or contains(text(), "下一頁")]',
  2603. pageE: '.xgyd ul > li',
  2604. replaceE: '.pagelist',
  2605. scrollD: 1000
  2606. }
  2607. }, // 233 动漫 - 动漫情报/资讯
  2608. dm233_rank: {
  2609. pager: {
  2610. nextL: '//div[@class="pagelist"]//a[contains(text(), "下一页") or contains(text(), "下一頁")]',
  2611. pageE: '.side-update.normal-wai > .normal-nei',
  2612. replaceE: '.pagelist',
  2613. scrollD: 1000
  2614. }
  2615. }, // 233 动漫 - 排行榜
  2616. anime1: {
  2617. host: 'anime1.me',
  2618. url: ()=> {if (indexOF('s=', 's')) {curSite = DBSite.wp_nav_navigation;} else if (lp == '/') {curSite = DBSite.anime1;}},
  2619. history: false,
  2620. pager: {
  2621. type: 4,
  2622. nextL: ()=> { // 获取下一页内容(叠加)
  2623. let next = getCSS('a.paginate_button.next');
  2624. if (next && next.className.indexOf('disabled') === -1) {
  2625. let oldList = getCSS('#table-list > tbody').innerHTML;
  2626. if (oldList) {next.click(); pageNum.now = pageNum._now + 1; getCSS('#table-list > tbody').insertAdjacentHTML('afterbegin', oldList);}
  2627. }
  2628. },
  2629. interval: 500,
  2630. scrollD: 800
  2631. }
  2632. }, // Anime1
  2633. yinfans: {
  2634. host: /www\.yinfans\./,
  2635. style: '#post_container {height: auto !important;} #post_container > li {position: static !important; float: left !important; height: 620px !important;}',
  2636. pager: {
  2637. nextL: 'a.next',
  2638. pageE: '#post_container > li',
  2639. replaceE: '.pagination',
  2640. scrollD: 1500
  2641. }
  2642. }, // 音范丝
  2643. btbtt: {
  2644. host: /btbtt/,
  2645. pager: {
  2646. nextL: '//div[@class="page"]/a[contains(text(), "▶") or contains(text(), "下一页")]',
  2647. pageE: '#threadlist > *',
  2648. replaceE: '.page',
  2649. scrollD: 2000
  2650. }
  2651. }, // BT 之家
  2652. bdys: {
  2653. host: 'www.bd2020.com',
  2654. url: ()=> {if (lp != '/' && !indexOF(/\/\d+\.htm/)) {curSite = DBSite.bdys;}},
  2655. pager: {
  2656. type: 2,
  2657. nextL: 'div.layui-flow-more > a',
  2658. nextText: '加载更多',
  2659. scrollD: 1000
  2660. }
  2661. }, // BD 影视
  2662. gaoqing_fm: {
  2663. host: 'gaoqing.fm',
  2664. pager: {
  2665. type: 2,
  2666. nextL: '.col-md-12 > a, #loadmore > a',
  2667. interval: 1500,
  2668. scrollD: 1000
  2669. }
  2670. }, // 高清电台
  2671. yyds: {
  2672. host: 'yyds.fans',
  2673. url: ()=> {if (location.search != '' && !indexOF('p=', 's')) {curSite = DBSite.yyds;}},
  2674. pager: {
  2675. nextL: 'a.next.page-numbers',
  2676. pageE: '.list-grouped > div',
  2677. replaceE: 'nav.pagination',
  2678. scrollD: 1100
  2679. }
  2680. }, // YYDS 电影
  2681. kisssub: {
  2682. host: ['www.kisssub.org','www.comicat.org', /(share|www)\.acgnx\./],
  2683. pager: {
  2684. nextL: 'a.nextprev:last-of-type',
  2685. pageE: '#data_list > tr',
  2686. replaceE: '.pages',
  2687. scrollD: 2500
  2688. }
  2689. }, // 爱恋动漫 / 漫猫动漫 / 末日动漫
  2690. dmhy: {
  2691. host: ['share.dmhy.org', 'dmhy.anoneko.com'],
  2692. pager: {
  2693. nextL: '//div[@class="nav_title"]/a[contains(text(), "下一")]',
  2694. pageE: '#topic_list > tbody > tr',
  2695. replaceE: '.nav_title',
  2696. scrollD: 1500
  2697. },
  2698. function: {
  2699. aF: ()=> {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');`;}
  2700. }
  2701. }, // 动漫花园
  2702. futaacg: {
  2703. host: /futaacg\./,
  2704. pager: {
  2705. nextL: 'ul.pagination a[rel="next"]',
  2706. pageE: '.topic-list > div',
  2707. replaceE: 'ul.pagination',
  2708. scrollD: 1500
  2709. }
  2710. }, // 扶她动漫
  2711. acg_rip: {
  2712. host: 'acg.rip',
  2713. pager: {
  2714. nextL: 'li.next>a',
  2715. pageE: 'table.post-index > tbody > tr',
  2716. replaceE: 'ul.pagination',
  2717. scrollD: 1500
  2718. }
  2719. }, // ACG.RIP
  2720. bangumi: {
  2721. host: 'bangumi.moe',
  2722. url: ()=> {if (indexOF('/lite')) {curSite = DBSite.bangumi_lite;} else {curSite = DBSite.bangumi;}},
  2723. pager: {
  2724. type: 2,
  2725. nextL: '[torrent-list="lattorrents"] button[ng-click="loadMore()"] ,[torrent-list="torrents"] button[ng-click="loadMore()"]',
  2726. interval: 1000,
  2727. scrollD: 1500
  2728. }
  2729. }, // 萌番组
  2730. bangumi_lite: {
  2731. pager: {
  2732. nextL: '//section/a[./span[contains(@class, "next")]]',
  2733. pageE: 'li.torrent-li',
  2734. replaceE: '.page-btn-section',
  2735. scrollD: 2000
  2736. }
  2737. }, // 萌番组 lite
  2738. miobt: {
  2739. host: ['miobt.com', 'www.36dm.club'],
  2740. url: ()=> {curSite = DBSite.miobt; if (location.hostname === 'www.36dm.club') {curSite.pager.scrollD = 1000;}},
  2741. pager: {
  2742. nextL: '//a[@class="nextprev"][contains(text(), "〉") or contains(text(), "下一页") or contains(text(), "»")]',
  2743. pageE: '#data_list > tr',
  2744. replaceE: '.pages',
  2745. scrollD: 2000
  2746. }
  2747. }, // MioBT + 简单动漫
  2748. reimu: {
  2749. host: /\.reimu\./,
  2750. url: ()=> {if (lp == '/' || indexOF('/category') || indexOF('/tag')) curSite = DBSite.reimu},
  2751. pager: {
  2752. nextL: 'span.current+a.sfwppa-current-page',
  2753. pageE: 'article[id^="post-"]',
  2754. replaceE: '.wp-pagenavi',
  2755. scrollD: 1500
  2756. }
  2757. }, // REIMU
  2758. hacg: {
  2759. host: /\.hacg\./,
  2760. url: ()=> {if (indexOF('/wp/') && !indexOF(/\d+\.html/)) curSite = DBSite.hacg},
  2761. pager: {
  2762. nextL: 'a.nextpostslink',
  2763. pageE: 'article[id^="post-"]',
  2764. replaceE: '.wp-pagenavi',
  2765. scrollD: 1500
  2766. }
  2767. }, // HACG
  2768. nyaa: {
  2769. host: /nyaa\.si/,
  2770. pager: {
  2771. nextL: 'a[rel="next"], li.next > a',
  2772. pageE: 'table.torrent-list > tbody > tr',
  2773. replaceE: 'ul.pagination',
  2774. scrollD: 2000
  2775. }
  2776. }, // Nyaa
  2777. skrbt: {
  2778. host: /skrbt/,
  2779. url: ()=> {if (lp == '/search') curSite = DBSite.skrbt;},
  2780. pager: {
  2781. nextL: ()=> { // 获取下一页地址
  2782. let page = getCSS('a[onclick][aria-label="Next"]');
  2783. if (page) {page = /(?<=\()\d+(?=\))/.exec(page.onclick)[0];} else {return '';} // 获取下一页页码
  2784. if (page) return getNextF('#search-form').replace(/p=\d+/,'p=' + page)
  2785. return '';
  2786. },
  2787. pageE: 'div[class="row"] > .col-md-6 > ul',
  2788. insertP: ['nav[aria-label*="Page"]', 1],
  2789. replaceE: 'ul.pagination',
  2790. scrollD: 900
  2791. }
  2792. }, // SkrBT
  2793. _1337x: {
  2794. host: /1337x\./,
  2795. url: ()=> {if (indexOF('search/')) {curSite = DBSite._1337x;}},
  2796. pager: {
  2797. nextL: '//div[@class="pagination"]//a[text()=">>"]',
  2798. pageE: 'table.table-list > tbody > tr',
  2799. replaceE: '.pagination',
  2800. scrollD: 1200
  2801. }
  2802. }, // 1337x
  2803. rarbg: {
  2804. host: /rarbg/,
  2805. url: ()=> {if (lp == '/torrents.php') {curSite = DBSite.rarbg; curSite.function.bF(getAllCSS('table.lista2t tr.lista2'));}},
  2806. style: 'html::-webkit-scrollbar {height: 0 !important;}',
  2807. pager: {
  2808. nextL: '#pager_links > a[title="next page"]',
  2809. pageE: 'table.lista2t tr.lista2',
  2810. replaceE: '#pager_links',
  2811. scrollD: 1200
  2812. },
  2813. function: {
  2814. bF: pageElems => { // 插入前函数(鼠标指向显示封面)
  2815. pageElems.forEach(function (one) {
  2816. one.querySelectorAll('td > a[onmouseover][onmouseout]').forEach(function (now) {
  2817. now.parentElement.parentElement.setAttribute('onmouseover', now.getAttribute('onmouseover')); now.removeAttribute('onmouseover');
  2818. now.parentElement.parentElement.setAttribute('onmouseout', now.getAttribute('onmouseout')); now.removeAttribute('onmouseout');
  2819. });
  2820. });
  2821. return pageElems
  2822. }
  2823. }
  2824. }, // RARBG
  2825. /*thepiratebay: {
  2826. host: 'thepiratebay.org',
  2827. url: ()=> {if (lp == '/search.php') {curSite = DBSite.thepiratebay;}},
  2828. pager: {
  2829. type: 6,
  2830. nextL: 'center > b+a[href]',
  2831. pageE: 'ol#torrents > li[id]',
  2832. replaceE: 'center',
  2833. loadTime: 1000,
  2834. scrollD: 1500
  2835. }
  2836. },*/ // thepiratebay
  2837. subdh: {
  2838. host: 'subdh.com',
  2839. url: ()=> {if (lp == '/' || indexOF('/list/new')) {curSite = DBSite.subdh;} else if (indexOF('/search')) {curSite = DBSite.subdh_search;}},
  2840. pager: {
  2841. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  2842. pageE: '.col-lg-9 .bg-white.shadow-sm.rounded-3 > .row.gx-0',
  2843. replaceE: 'ul.pagination',
  2844. scrollD: 1000
  2845. }
  2846. }, // SubDH
  2847. subdh_search: {
  2848. pager: {
  2849. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  2850. pageE: '.col-lg-9 .bg-white.shadow-sm.rounded-3',
  2851. insertP: ['nav[aria-label="pagination"]', 1],
  2852. replaceE: 'ul.pagination',
  2853. scrollD: 1000
  2854. }
  2855. }, // SubDH - 搜索页
  2856. mini4k: {
  2857. host: 'www.mini4k.com',
  2858. url: ()=> {if (indexOF('/forum') && !indexOF('/topic')) {curSite = DBSite.mini4k; curSite.pager.pageE = '#block-white-content tbody > tr'} else if (lp != '/' && !indexOF(/\/\d{3,}/)) {curSite = DBSite.mini4k;};},
  2859. pager: {
  2860. nextL: 'a.pager__item--next',
  2861. pageE: 'div[class*="-item-list"] > ul > li',
  2862. replaceE: '.pagination',
  2863. scrollD: 2000
  2864. }
  2865. }, // MINI4K
  2866. bthaha: {
  2867. host: /bthaha/,
  2868. url: ()=> {if (indexOF('/search/')) {
  2869. curSite = DBSite.bthaha;
  2870. getAllCSS('[id^="list_top"], [id^="list_bottom"]').forEach(function (one) {one.parentElement.parentElement.hidden = true;});
  2871. }},
  2872. style: '[id^="list_top"], [id^="list_bottom"] {display: none !important;}',
  2873. pager: {
  2874. nextL: '//ul[@class="pagination"]/li/a[contains(text(), "下一页")]',
  2875. pageE: 'table.table > tbody > tr',
  2876. replaceE: 'ul.pagination',
  2877. scrollD: 1000
  2878. },
  2879. function: {
  2880. bF: pageElems => { // 插入前函数(隐藏底部元素)
  2881. pageElems.forEach(function (one) {let now = one.querySelector('[id^="list_top"], [id^="list_bottom"]'); if (now) {one.hidden = true;};});
  2882. return pageElems
  2883. }
  2884. }
  2885. }, // BTHaha
  2886. a4k: {
  2887. host: 'www.a4k.net',
  2888. url: ()=> {if (!indexOF('/subtitle/')) {curSite = DBSite.a4k;};},
  2889. pager: {
  2890. nextL: 'a.pager__item--next',
  2891. pageE: 'ul.list > li',
  2892. replaceE: '.pagination',
  2893. scrollD: 1000
  2894. }
  2895. }, // A4k 字幕网(字幕)
  2896. assrt: {
  2897. host: 'assrt.net',
  2898. url: ()=> {if (lp === '/sub/') {curSite = DBSite.assrt;} else if (indexOF('/list/')) {curSite = DBSite.assrt_list;}},
  2899. pager: {
  2900. nextL: ()=> getNextEP('#pl-current+a[href]:not([id])', 'page=', /page=\d+/),
  2901. pageE: '.resultcard > div:not(#top-banner):not(#bottom-banner):not(.pagelinkcard)',
  2902. insertP: ['.pagelinkcard', 1],
  2903. replaceE: '.pagelinkcard',
  2904. scrollD: 1000
  2905. }
  2906. }, // 射手网(字幕)
  2907. assrt_list: {
  2908. pager: {
  2909. nextL: '//a[@id="pl-nav" and text()=">"]',
  2910. pageE: '#resultsdiv > .subitem:not([id])',
  2911. replaceE: '.pagelinkcard',
  2912. scrollD: 1000
  2913. }
  2914. }, // 射手网(字幕)
  2915. subhd: {
  2916. host: 'subhd.tv',
  2917. url: ()=> {if (lp == '/forum/forum') {
  2918. curSite = DBSite.subhd_forum;
  2919. } else if (lp != '/' && lp != '/zu' && !indexOF('/a/') && !indexOF('/d/') && !indexOF('/forum/')) {
  2920. curSite = DBSite.subhd;
  2921. }},
  2922. pager: {
  2923. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  2924. pageE: '.bg-white.shadow-sm.rounded-3',
  2925. insertP: ['nav.clearfix', 1],
  2926. replaceE: 'nav.clearfix',
  2927. scrollD: 1000
  2928. }
  2929. }, // SubHD(字幕)
  2930. subhd_forum: {
  2931. pager: {
  2932. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  2933. pageE: '.bg-white.shadow-sm.rounded-3 > div',
  2934. replaceE: 'nav.clearfix',
  2935. scrollD: 800
  2936. }
  2937. }, // SubHD - forum(字幕)
  2938. manben: {
  2939. host: 'www.manben.com',
  2940. url: ()=> {if (indexOF(/\/m\d+/)) {
  2941. if (getCookie('showtype') != '2') {
  2942. document.cookie='showtype=2; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 开启 [垂直阅读] 模式
  2943. location.reload(); // 刷新网页
  2944. }
  2945. curSite = DBSite.mhxqiu;
  2946. }}
  2947. }, // 漫本
  2948. haoman: {
  2949. host: ['www.haoman6.com', 'www.g-lens.com'],
  2950. url: ()=> {
  2951. if (indexOF('/chapter/')) {
  2952. curSite = DBSite.haoman;
  2953. if (location.hostname == 'www.g-lens.com') curSite.function.bFp = [0, 'img[data-echo]', 'data-echo']
  2954. } else if (indexOF('/comic/')) {
  2955. if (getCSS('.chapter__more')) getCSS('.chapter__more').click();
  2956. } else if (indexOF('/category/') || indexOF('/search')) {
  2957. curSite = DBSite.haoman_list;
  2958. }},
  2959. style: '.rd-guess, .rd-aside, .page-index__btn {display: none !important;} .rd-article__pic {display: initial !important;} .rd-article__pic > img {margin: 0 auto;display: block;height: auto;min-height: 200px;}',
  2960. pager: {
  2961. nextL: ()=> {if (getCSS('a.rd-aside__item.j-rd-next')) return location.origin + getCSS('a.rd-aside__item.j-rd-next').getAttribute('_href')},
  2962. pageE: '.rd-article-wr > div',
  2963. replaceE: 'a.last-crumb, .rd-aside',
  2964. interval: 2000,
  2965. scrollD: 2000
  2966. },
  2967. function: {
  2968. bF: src_bF,
  2969. bFp: [0, 'img[dta-echo]', 'dta-echo']
  2970. }
  2971. }, // 好漫 6
  2972. haoman_list: {
  2973. pager: {
  2974. nextL: 'a.next',
  2975. pageE: '.cate-comic-list > div',
  2976. replaceE: '#Pagination',
  2977. scrollD: 1000
  2978. },
  2979. function: {
  2980. bF: src_bF,
  2981. bFp: [0, 'img[data-original]', 'data-original']
  2982. }
  2983. }, // 好漫 6 - 分类/搜索页
  2984. cartoonmad: {
  2985. host: ['www.cartoonmad.com','www.cartoonmad.cc'],
  2986. url: ()=> {if (indexOF('/comic/')) {
  2987. getCSS('body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child > a').href = 'javascript:void(0);'; // 清理图片上的链接
  2988. curSite = DBSite.cartoonmad;
  2989. } else if (lp != '/') {
  2990. curSite = DBSite.cartoonmad_list;
  2991. }},
  2992. style: '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;}',
  2993. pager: {
  2994. nextL: cartoonmad_nextL,
  2995. pageE: 'body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child img',
  2996. replaceE: 'body > table > tbody > tr:nth-child(2), body > table > tbody > tr:nth-child(5)',
  2997. scrollD: 2000
  2998. }
  2999. }, // 动漫狂
  3000. cartoonmad_list: {
  3001. pager: {
  3002. nextL: '//a[@class="pages"][contains(text(), "下一頁")]',
  3003. pageE: 'td[background="/image/content_box4.gif"]+td > table > tbody > tr',
  3004. replaceE: '//a[@class="pages"]/parent::td/parent::tr | //font[contains(text(), "目前在第")]',
  3005. scrollD: 1000
  3006. }
  3007. }, // 动漫狂 - 分类/搜索页
  3008. dongman: {
  3009. host: 'www.dongman.la',
  3010. url: ()=> {if (indexOF('/chapter/')) {
  3011. src_bF(getAllCSS('img.mdui-img-fluid[data-srcset]:not([src])'), [0, 'img[data-srcset]', 'data-srcset']);
  3012. curSite = DBSite.dongman;
  3013. } else if (indexOF('/detail/')) {
  3014. setTimeout(function(){getCSS('a#zhankai').click()}, 500)
  3015. } else if (indexOF('/manhua/')) {
  3016. curSite = DBSite.dongman_list;
  3017. }},
  3018. style: 'button.prePic, button.nextPic, footer, header, #left-drawer {display: none !important;} body, #app {padding: 0 !important;} .slick-track {width: 100% !important;} .lazyBox {width: 100%; display: inline-block;}',
  3019. pager: {
  3020. nextL: '//footer//a[./label[text()="下一章"]]',
  3021. pageE: '.lazyBox',
  3022. insertP: ['.slick-track', 3],
  3023. replaceE: 'footer',
  3024. scrollD: 3000
  3025. },
  3026. function: {
  3027. bF: src_bF,
  3028. bFp: [0, 'img[data-srcset]', 'data-srcset']
  3029. }
  3030. }, // 动漫啦
  3031. dongman_list: {
  3032. pager: {
  3033. nextL: '//a[@class="GPageLink" and text()="下一页"]',
  3034. pageE: '.cy_list_mh > ul',
  3035. replaceE: '.NewPages',
  3036. scrollD: 2000
  3037. }
  3038. }, // 动漫啦 - 分类页
  3039. manhuacat: {
  3040. host: ['www.manhuacat.com', 'www.maofly.com'],
  3041. url: ()=> {if (indexOF(/\/manga\/\d+\/.+\.html/)) {
  3042. if (getCookie('is_pull') == 'true') { // 强制关闭 [下拉] 模式
  3043. document.cookie='is_pull=false; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 关闭 [下拉] 模式
  3044. location.reload(); // 刷新网页
  3045. }
  3046. setTimeout(manhuacat_init, 100);
  3047. curSite = DBSite.manhuacat;
  3048. } else if (indexOF('/list')) {
  3049. curSite = DBSite.manhuacat_list;
  3050. } else if (indexOF('/search') || indexOF('/update')) {
  3051. curSite = DBSite.manhuacat_search;
  3052. }},
  3053. style: '#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;}', // 隐藏不需要的元素,调整图片
  3054. pager: {
  3055. type: 4,
  3056. nextL: manhuacat_nextL,
  3057. insertP: ['.img-content', 3],
  3058. insertE: manhuacat_insertE,
  3059. replaceE: '.comic-detail > .breadcrumb-bar, .comic-detail >h2.h4, .vg-r-data, body > script:not([src])',
  3060. interval: 2000,
  3061. scrollD: 3000
  3062. }
  3063. }, // 漫画猫
  3064. manhuacat_list: {
  3065. pager: {
  3066. nextL: '//div[contains(@class, "pagination")]//a[contains(text(), "下一页") or contains(text(), "下页")]',
  3067. pageE: '.comic-main-section > *',
  3068. replaceE: '.pagination',
  3069. scrollD: 1000
  3070. },
  3071. function: {
  3072. bF: src_bF,
  3073. bFp: [0, 'img[data-original]', 'data-original']
  3074. }
  3075. }, // 漫画猫 - 分类页
  3076. manhuacat_search: {
  3077. pager: {
  3078. nextL: '//div[contains(@class, "pagination")]//a[contains(text(), "下一页") or contains(text(), "下页")]',
  3079. pageE: '.comic-main-section .row > div',
  3080. replaceE: '.pagination',
  3081. scrollD: 1000
  3082. }
  3083. }, // 漫画猫 - 搜索页
  3084. manhuatai: {
  3085. host: 'www.manhuatai.net',
  3086. url: ()=> {if (indexOF('/manhua/')) {
  3087. curSite = DBSite.manhuatai;
  3088. } else if (indexOF('/fenlei_') || indexOF('/top_')) {
  3089. curSite = DBSite.manhuatai_list;
  3090. } else if (indexOF('/search')) {
  3091. curSite = DBSite.manhuatai_search;
  3092. }},
  3093. pager: {
  3094. nextL: '//div[contains(@class, "page")]//a[@href][contains(text(), "下一页") or contains(text(), "下一章")]',
  3095. pageE: '#htmlContent p.img > img',
  3096. replaceE: '.page, .title',
  3097. scrollD: 2000
  3098. }
  3099. }, // 漫画台
  3100. manhuatai_list: {
  3101. pager: {
  3102. nextL: '#pagelink a.next',
  3103. pageE: '.article-list',
  3104. replaceE: '#pagelink',
  3105. scrollD: 1500
  3106. }
  3107. }, // 漫画台 - 分类页
  3108. manhuatai_search: {
  3109. pager: {
  3110. nextL: '#pagelink a.next',
  3111. pageE: '#content > table > tbody > tr:not([align])',
  3112. replaceE: '#pagelink',
  3113. scrollD: 1500
  3114. }
  3115. }, // 漫画台 - 搜索页
  3116. manhuapi: {
  3117. host: 'www.manhuapi.com',
  3118. url: ()=> {if (indexOF('/chapter/')) {
  3119. curSite = DBSite.manhuapi;
  3120. } else if (!indexOF(/\/manhua\/\d+\.html/)) {
  3121. curSite = DBSite.manhuapi_list;
  3122. }},
  3123. pager: {
  3124. nextL: '//div[@class="page"]/a[text()="下一页" or text()="下一章"]',
  3125. pageE: '.mh_list img[src]',
  3126. replaceE: '.page',
  3127. scrollD: 2000
  3128. }
  3129. }, // 漫画皮
  3130. manhuapi_list: {
  3131. pager: {
  3132. nextL: '//div[@class="pages"]/a[text()="下一页"]',
  3133. pageE: '.cy_list_mh > ul',
  3134. replaceE: '.pages',
  3135. scrollD: 1500
  3136. }
  3137. }, // 漫画皮 - 分类页
  3138. imanhuaw: {
  3139. host: ['www.imanhuaw.net', 'www.imanhuaw.com', 'www.ccshwy.com'],
  3140. url: ()=> {
  3141. if (getCSS('.mh-search-result')) {
  3142. curSite = DBSite.imanhuaw_list;
  3143. } else if (getCSS('a#zhankai')) {
  3144. getCSS('a#zhankai').click();
  3145. } else if (indexOF(/\/\d{3,}\.html/)) {
  3146. curSite = DBSite.imanhuaw; imanhuaw_init();
  3147. }
  3148. },
  3149. style: '#sider-left, #sider-right, .main-left, .main-right, .w996.tc, .title > span {display: none !important;} #qTcms_Pic_middle img {max-width: 110%;height: auto;}',
  3150. pager: {
  3151. type: 4,
  3152. nextL: imanhuaw_nextL,
  3153. insertP: ['#qTcms_Pic_middle img:last-of-type', 4],
  3154. insertE: imanhuaw_insertE,
  3155. replaceE: '.title h2',
  3156. interval: 2000,
  3157. scrollD: 3000
  3158. }
  3159. }, // 爱漫画 + 188漫画网
  3160. imanhuaw_list: {
  3161. pager: {
  3162. nextL: '//div[@class="NewPages"]//a[text()="下一页"]',
  3163. pageE: 'ul.mh-search-list > li',
  3164. replaceE: '.NewPages',
  3165. scrollD: 1500
  3166. }
  3167. }, // 爱漫画 - 分类页
  3168. manhuagui: {
  3169. host: ['www.mhgui.com', 'tw.mhgui.com', 'www.manhuagui.com', 'tw.manhuagui.com'],
  3170. url: ()=> {if (indexOF(/\/comic\/\d+\/\d+\.html/)) {
  3171. if (!getXpath('//li[@class="pfunc"]/a[@class="current"][text()="双击" or text()="雙擊"]')) getXpath('//li[@class="pfunc"]/a[text()="双击" or text()="雙擊"]').click();
  3172. pausePage = false;
  3173. setTimeout(manhuagui_init, 100);
  3174. curSite = DBSite.manhuagui;
  3175. } else if (indexOF('list/') || indexOF('/s/')) {
  3176. curSite = DBSite.manhuagui_list;
  3177. }},
  3178. style: '.sub-btn, .tc {display: none !important;} #mangaBox > img {width: auto !important;height: auto !important;display: block !important;margin: 0 auto !important;max-width: 100% !important;}',
  3179. pager: {
  3180. type: 4,
  3181. nextL: manhuagui_nextL,
  3182. pageE: 'body > script:not([src])',
  3183. insertP: ['#mangaBox', 3],
  3184. insertE: manhuagui_insertE,
  3185. replaceE: 'title',
  3186. interval: 4000,
  3187. scrollD: 2500
  3188. }
  3189. }, // 漫画柜
  3190. manhuagui_list: {
  3191. pager: {
  3192. nextL: '//div[@class="pager"]/a[text()="下一页" or text()="下一頁"]',
  3193. pageE: '.book-result > ul > li, .book-list > ul > li',
  3194. insertP: ['.book-result > ul, .book-list > ul', 3],
  3195. replaceE: '.pager',
  3196. scrollD: 1500
  3197. },
  3198. function: {
  3199. bF: src_bF,
  3200. bFp: [0, 'img[data-src]', 'data-src']
  3201. }
  3202. }, // 漫画台 - 分类/搜索页
  3203. _36manga: {
  3204. host: ['36manga.com', 'www.36manga.com', '36manhua.com', 'www.36manhua.com'],
  3205. url: ()=> {if (indexOF(/\/manhua\/.+\/\d+\.html/)) {
  3206. if (localStorage.getItem('chapterScroll') != '"pagination"') {
  3207. localStorage.setItem('chapterScroll', '"pagination"'); location.reload()
  3208. } else {
  3209. pausePage = false;
  3210. setTimeout(_36manga_init, 100);
  3211. curSite = DBSite._36manga;
  3212. }
  3213. } else if (indexOF('list/') || indexOF('/search/')) {
  3214. curSite = DBSite._36manga_list;
  3215. }},
  3216. style: '#sider-left, #sider-right, p.img_info, .tc, .chapter-view + .w996 {display: none !important;} #images > img {width: auto !important;height: auto !important;display: block !important;margin: 0 auto !important;max-width: 100% !important;}',
  3217. pager: {
  3218. type: 4,
  3219. nextL: _36manga_nextL,
  3220. pageE: '//body/script[contains(text(), "chapterImages")]',
  3221. insertP: ['#images', 3],
  3222. insertE: _36manga_insertE,
  3223. replaceE: '.title',
  3224. interval: 4000,
  3225. scrollD: 2500
  3226. }
  3227. }, // 36漫画
  3228. _36manga_list: {
  3229. pager: {
  3230. nextL: 'ul.pagination li.next a',
  3231. pageE: '#contList',
  3232. replaceE: 'ul.pagination',
  3233. scrollD: 1500
  3234. }
  3235. }, // 36漫画 - 分类/搜索页
  3236. manhuadb: {
  3237. host: 'www.manhuadb.com',
  3238. url: ()=> {if (indexOF(/\/manhua\/\d+\/.+\.html/)) {
  3239. if (getCSS('img.img-fluid.show-pic')) getCSS('img.img-fluid.show-pic').style.display = 'none'; // 隐藏第一个图片(避免重复)
  3240. setTimeout(manhuadb_init, 100);
  3241. curSite = DBSite.manhuadb;
  3242. } else if (indexOF('/list')) {
  3243. curSite = DBSite.manhuacat_list;
  3244. } else if (indexOF('/search') || indexOF('/update')) {
  3245. curSite = DBSite.manhuacat_search;
  3246. }},
  3247. style: '.row.m-0.pt-3.ad_2_wrap, .row.m-0.ad_1_wrap, .pagination.justify-content-center, #left, #right {display: none !important;}',
  3248. pager: {
  3249. type: 4,
  3250. nextL: manhuadb_nextL,
  3251. pageE: 'body > script:not([type]):not([src]), .vg-r-data, ol.links-of-books.num_div',
  3252. insertP: ['.pjax-container', 3],
  3253. insertE: manhuadb_insertE,
  3254. interval: 5000,
  3255. scrollD: 3000
  3256. }
  3257. }, // 漫画 DB
  3258. hicomic: {
  3259. host: 'www.hicomic.net',
  3260. url: ()=> {if (indexOF('/chapters/')) {
  3261. setTimeout(hicomic_init, 100);
  3262. curSite = DBSite.hicomic;
  3263. }},
  3264. style: '.content {height: auto !important;} .footer, .left_cursor, .right_cursor, .finish {display: none !important;} .content > img {display: block !important;margin: 0 auto !important;}',
  3265. pager: {
  3266. type: 4,
  3267. nextL: hicomic_nextL,
  3268. insertP: ['.content', 3],
  3269. insertE: hicomic_insertE,
  3270. interval: 5000,
  3271. scrollD: 3000
  3272. }
  3273. }, // HiComic (嗨漫画)
  3274. dmzj: {
  3275. host: 'www.dmzj.com',
  3276. url: ()=> {if (indexOF('/view/')) {
  3277. if (getCookie('display_mode') != '1') { // 强制开启 [上下滚动阅读] 模式
  3278. document.cookie='display_mode=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 开启 [上下滚动阅读] 模式
  3279. location.reload(); // 刷新网页
  3280. }
  3281. setTimeout(function() {dmzj_init('.comic_wraCon > a > img')}, 100);
  3282. curSite = DBSite.dmzj;
  3283. } else if (indexOF('/category') || indexOF('/update')) {
  3284. curSite = DBSite.dmzj_list;
  3285. } else if (indexOF('/rank')) {
  3286. curSite = DBSite.dmzj_rank;
  3287. }},
  3288. style: '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;}', // 隐藏中间的页数信息
  3289. pager: {
  3290. type: 4,
  3291. nextL: 'span.next > a',
  3292. insertP: ['.comic_wraCon', 3],
  3293. insertE: dmzj_insertE,
  3294. replaceE: '.wrap_last_mid, .wrap_last_head',
  3295. interval: 2000,
  3296. scrollD: 3000
  3297. }
  3298. }, // 动漫之家 - 原创
  3299. dmzj_list: {
  3300. style: '.wrap_mhlist_l.con_left, .wrap_list {height: auto!important;}',
  3301. pager: {
  3302. nextL: 'a.pg_next',
  3303. pageE: 'ul.list_con_li > li',
  3304. replaceE: '.page',
  3305. scrollD: 1000
  3306. }
  3307. }, // 动漫之家 - 原创 - 分类页
  3308. dmzj_rank: {
  3309. style: '.wrap_mhlist_l.con_left {height: auto!important;}',
  3310. pager: {
  3311. nextL: 'a.pg_next',
  3312. pageE: '.ph_r_con_li > div:not(.ad_column)',
  3313. replaceE: '.page',
  3314. scrollD: 1000
  3315. }
  3316. }, // 动漫之家 - 原创 - 排行榜
  3317. dmzj_manhua: {
  3318. host: 'manhua.dmzj.com',
  3319. url: ()=> {if (indexOF(/\/\d+\.shtml/)) {
  3320. let chapterScroll = getCSS('#qiehuan_txt') // 强制为 [上下滚动阅读] 模式
  3321. if (chapterScroll && chapterScroll.textContent === '切换到上下滚动阅读') {chapterScroll.click();}
  3322. setTimeout(function() {dmzj_init('#center_box > .inner_img img[src]')}, 100);
  3323. curSite = DBSite.dmzj_manhua;
  3324. /*} else if (indexOF('/tags/')) {
  3325. curSite = DBSite.dmzj_manhua_list;*/
  3326. } else if (indexOF('/update')) {
  3327. curSite = DBSite.dmzj_manhua_update;
  3328. }},
  3329. style: '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;}', // 隐藏中间的页数信息
  3330. pager: {
  3331. type: 4,
  3332. nextL: '#next_chapter',
  3333. insertP: ['#center_box', 3],
  3334. insertE: dmzj_manhua_insertE,
  3335. replaceE: '.display_graybg',
  3336. interval: 2000,
  3337. scrollD: 3000
  3338. }
  3339. }, // 动漫之家 - 日漫
  3340. /*dmzj_manhua_list: {
  3341. pager: {
  3342. nextL: ()=> getNextUPN(/(?<=-)\d+(?=\.shtml)/, /-\d+\.shtml/, '-', '.shtml', '2', getCSS('#topage > option:last-child').value),
  3343. pageE: '#search_list_div ul',
  3344. scrollD: 1500
  3345. }
  3346. },*/ // 动漫之家 - 日漫 - 分类页
  3347. dmzj_manhua_update: {
  3348. pager: {
  3349. nextL: '//div[@class="pages"]/a[contains(text(), "下一页")]',
  3350. pageE: '.newpic_content > *:not(.pages)',
  3351. replaceE: '.pages',
  3352. scrollD: 1000
  3353. }
  3354. }, //动漫之家 - 日漫 - 最新更新
  3355. acgn: {
  3356. host: 'comic.acgn.cc',
  3357. url: ()=> {
  3358. if (indexOF('/view-')) {
  3359. curSite = DBSite.acgn;
  3360. acgn_aF();
  3361. } else if (indexOF('/cate-') || indexOF('/pinyin-')) {
  3362. curSite = DBSite.acgn_list;
  3363. }
  3364. },
  3365. style: '.img1 {cursor: initial !important;}',
  3366. pager: {
  3367. nextL: '#next_chapter',
  3368. pageE: '.pic[_src]',
  3369. replaceE: '[class^="display_"]',
  3370. interval: 2000,
  3371. scrollD: 2000
  3372. },
  3373. function: {
  3374. aF: acgn_aF
  3375. }
  3376. }, // 动漫戏说
  3377. acgn_list: {
  3378. pager: {
  3379. nextL: 'a[rel="next"]',
  3380. pageE: 'ul#display > li',
  3381. replaceE: '#pagination',
  3382. scrollD: 1000
  3383. }
  3384. }, // 动漫戏说 - 分类页
  3385. ykmh: {
  3386. host: 'www.ykmh.com',
  3387. url: ()=> {if (indexOF(/\/\d+\.html/)) {
  3388. let chapterScroll = getCSS('#qiehuan_txt') // 强制为 [上下滚动阅读] 模式
  3389. if (localStorage.getItem('chapterScroll') != '"scroll"') {
  3390. localStorage.setItem('chapterScroll', '"scroll"'); location.reload()
  3391. } else {
  3392. setTimeout(ykmh_init, 100);
  3393. curSite = DBSite.ykmh;
  3394. }
  3395. } else if (indexOF('/list') || indexOF('/search')) {
  3396. curSite = DBSite.ykmh_list;
  3397. }},
  3398. style: 'p.img_info {display: none !important;} #images > img {display: block !important;margin: 0 auto !important; border: none !important; padding: 0 !important; max-width: 99% !important; height: auto !important;}',
  3399. pager: {
  3400. type: 4,
  3401. nextL: ykmh_nextL,
  3402. insertP: ['#images', 3],
  3403. insertE: ykmh_insertE,
  3404. replaceE: '.head_title, span.head_wz',
  3405. interval: 2000,
  3406. scrollD: 3000
  3407. }
  3408. }, // 优酷漫画
  3409. ykmh_list: {
  3410. pager: {
  3411. nextL: 'li.next > a',
  3412. pageE: 'li.list-comic',
  3413. replaceE: 'ul.pagination',
  3414. scrollD: 1000
  3415. }
  3416. }, // 优酷漫画 - 分类页
  3417. copymanga: {
  3418. host: /copymanga\./,
  3419. url: ()=> {if (indexOF('/chapter/')) {
  3420. curSite = DBSite.copymanga;
  3421. } else if (indexOF('/comics')) {
  3422. curSite = DBSite.copymanga_list;
  3423. }},
  3424. style: '.upMember, .comicContainerAds, .footer {display: none !important;} body, html {height: auto !important;}',
  3425. iframe: true,
  3426. pager: {
  3427. type: 5,
  3428. nextL: '.comicContent-next > a',
  3429. style: 'h4.header, h4.header +div[style*="fixed"] {display: none !important;}',
  3430. scrollD: 3000
  3431. }
  3432. }, // 拷贝漫画
  3433. copymanga_list: {
  3434. pager: {
  3435. nextL: 'li.next > a',
  3436. pageE: '.exemptComic-box > div',
  3437. replaceE: 'ul.page-all',
  3438. scrollD: 1500
  3439. },
  3440. function: {
  3441. bF: src_bF,
  3442. bFp: [0, 'img[data-src]', 'data-src']
  3443. }
  3444. }, // 拷贝漫画 - 分类页
  3445. mhxqiu: {
  3446. host: /\.mhxqiu/,
  3447. url: ()=> {if (indexOF(/\/\d+\.html/)) { // 阅读页
  3448. curSite = DBSite.mhxqiu;
  3449. } else if (indexOF(/\/\d+\/$/)) { // 目录页
  3450. setTimeout(function(){if (getCSS('#zhankai')) getCSS('#zhankai').click();}, 500)
  3451. } else if (indexOF(/\/(sort|rank)\//)) { // 分类页
  3452. curSite = DBSite.mhxqiu_list;
  3453. }},
  3454. style: '.imgFloat_1, .imgFloat_2, .main_control, span.comic-ft {display: none !important;} html, body, #mainView {height: auto !important;} body.view .main ul.comic-contain li{margin:0 auto !important;} .comic-contain .loaded{box-shadow: none !important;}',
  3455. pager: {
  3456. type: 4,
  3457. nextL: '#mainControlNext',
  3458. insertP: ['#comicContain', 3],
  3459. insertE: mhxqiu_insertE,
  3460. replaceE: '.main_control, h1.chaptername_title, span.title-comicHeading',
  3461. interval: 4000,
  3462. scrollD: 3000
  3463. }
  3464. }, // 漫画星球
  3465. mhxqiu_list: {
  3466. pager: {
  3467. nextL: '//div[@class="NewPages"]//a[contains(text(), "下一页")]',
  3468. pageE: '.cy_list_mh > ul',
  3469. replaceE: '.NewPages',
  3470. scrollD: 1000
  3471. }
  3472. }, // 漫画星球 - 分类页
  3473. fffdm: {
  3474. host: 'manhua.fffdm.com',
  3475. url: ()=> {if (location.pathname.split('/').length === 4) {curSite = DBSite.fffdm;}},
  3476. style: '#footer, #header {display: none !important;} #mhimg0 img {display: block !important;margin: 0 auto !important;}',
  3477. pager: {
  3478. type: 4,
  3479. nextL: '//a[contains(text(), "下一页") or contains(text(), "下一頁") or contains(text(), "下一话") or contains(text(), "下一話")]',
  3480. insertP: ['#mhimg0', 3],
  3481. insertE: fffdm_insertE,
  3482. replaceE: '.navigation, #weizhi, h1',
  3483. scrollD: 2000
  3484. }
  3485. }, // 风之动漫
  3486. baozimh: {
  3487. host: ['www.webmota.com', 'cn.webmota.com', 'cn.baozimh.com'],
  3488. url: ()=> {
  3489. if (indexOF('/chapter/')) {
  3490. curSite = DBSite.baozimh;
  3491. } else if (indexOF('/comic/')) {
  3492. if (getCSS('#button_show_all_chatper')) getCSS('#button_show_all_chatper').click();
  3493. }},
  3494. style: '#footer, #header {display: none !important;} .header, .bottom-bar {opacity: 0.3;}',
  3495. pager: {
  3496. nextL: '.next_chapter > a',
  3497. pageE: '.comic-contain > amp-img',
  3498. replaceE: '.next_chapter, .bottom-bar, .header .title',
  3499. scrollD: 2000
  3500. }
  3501. }, // 包子漫画
  3502. leyuman: {
  3503. host: 'www.leyuman.com',
  3504. url: ()=> {if (indexOF(/\/comic\/\d+\/\d+\.html/)) {
  3505. curSite = DBSite.leyuman;
  3506. setTimeout(leyuman_init, 100);
  3507. } else if (indexOF(/\/comic\/\d+\.html/)) {
  3508. setTimeout(function(){if (getCSS('#read-more')) getCSS('#read-more').click();}, 500)
  3509. } else {
  3510. curSite = DBSite.leyuman_list;
  3511. }},
  3512. style: '.mh_select, .mh_comicpic > p, mh_headpager {display: none !important;} .mh_comicpic > img{width: 100% !important; height: auto !important;}',
  3513. pager: {
  3514. type: 4,
  3515. nextL: '#xurl',
  3516. insertP: ['.mh_comicpic', 3],
  3517. insertE: leyuman_insertE,
  3518. replaceE: '.mh_headpager, .mh_readtitle',
  3519. interval: 3000,
  3520. scrollD: 3000
  3521. }
  3522. }, // 乐语漫画
  3523. leyuman_list: {
  3524. pager: {
  3525. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  3526. pageE: '.works_recommend.classification_works > ul',
  3527. replaceE: '.paging',
  3528. scrollD: 1000
  3529. },
  3530. function: {
  3531. bF: src_bF,
  3532. bFp: [0, 'img[data-src]', 'data-src']
  3533. }
  3534. }, // 乐语漫画 - 分类页
  3535. _77mh: {
  3536. host: 'www.77mh.cc',
  3537. url: ()=> {if (indexOF(/\/\d+\.html/)) {
  3538. curSite = DBSite._77mh;
  3539. setTimeout(_77mh_init, 100);
  3540. } else if (indexOF('/colist_')) {
  3541. setTimeout(function(){if (getCSS('#listmore1, .listmore')) getCSS('#listmore1, .listmore').click();}, 500)
  3542. } else {
  3543. curSite = DBSite._77mh_list;
  3544. }},
  3545. style: '.page_num, #bdtopbot {display: none !important;} #comicImg > img {display: block !important;margin: 0 auto !important; border: none !important; padding: 0 !important; max-width: 99% !important; height: auto !important;}',
  3546. pager: {
  3547. type: 4,
  3548. nextL: _77mh_nextL,
  3549. insertP: ['#comicImg', 3],
  3550. insertE: _77mh_insertE,
  3551. interval: 3000,
  3552. scrollD: 2000
  3553. }
  3554. }, // 新新漫画
  3555. _77mh_list: {
  3556. pager: {
  3557. nextL: '//div[@class="pages_s"]/a[text()="下一页"]',
  3558. pageE: '.ar_list_co > ul > li',
  3559. replaceE: '.pages_s',
  3560. scrollD: 1000
  3561. }
  3562. }, // 新新漫画 - 分类页
  3563. _77mh_search: {
  3564. host: 'so.77mh.cc',
  3565. pager: {
  3566. nextL: 'a.next',
  3567. pageE: '.ar_list_co > ul > dl',
  3568. replaceE: '.pages_s',
  3569. scrollD: 1000
  3570. }
  3571. }, // 新新漫画 - 搜索页
  3572. gufengmh: {
  3573. host: /gufengmh/,
  3574. url: ()=> {if (indexOF(/\/\d+.+\.html/)) {
  3575. let chapterScroll = getCSS('#chapter-scroll') // 强制为 [下拉阅读] 模式
  3576. if (chapterScroll && chapterScroll.className === '') {chapterScroll.click();}
  3577. curSite = DBSite.gufengmh;
  3578. } else if (indexOF(/\/(update|list|search)/)) {
  3579. curSite = DBSite.gufengmh_list;
  3580. }},
  3581. style: 'p.img_info {display: none !important;}', // 隐藏中间的页数信息
  3582. pager: {
  3583. type: 4,
  3584. nextL: gufengmh_nextL,
  3585. pageE: 'body > script:first-child',
  3586. insertP: ['#images', 3],
  3587. insertE: gufengmh_insertE,
  3588. interval: 5000,
  3589. scrollD: 4000
  3590. }
  3591. }, // 古风漫画网
  3592. gufengmh_list: {
  3593. pager: {
  3594. nextL: 'li.next > a',
  3595. pageE: 'ul.book-list > li',
  3596. replaceE: 'ul.pagination',
  3597. scrollD: 1000
  3598. }
  3599. }, // 古风漫画网 - 分类页
  3600. szcdmj: {
  3601. host: 'www.szcdmj.com',
  3602. url: ()=> {
  3603. if (indexOF('/szcchapter/')) {
  3604. curSite = DBSite.szcdmj;
  3605. } else if (indexOF('/szcbook/')) {
  3606. if (getCSS('#detail-list-more')) getCSS('#detail-list-more').click();
  3607. } else if (lp == '/szcbolist' || lp == '/update') {
  3608. curSite = DBSite.szcdmj_list;
  3609. }},
  3610. style: '.header {opacity: 0.3 !important;}',
  3611. pager: {
  3612. nextL: '//div[@class="fanye"][1]/a[@href][text()="下一页" or text()="下一话"]',
  3613. pageE: '.comicpage > div',
  3614. insertP: ['.comicpage', 3],
  3615. replaceE: '.fanye,h1.title',
  3616. scrollD: 2000
  3617. },
  3618. function: {
  3619. bF: src_bF,
  3620. bFp: [0, 'img[data-original]', 'data-original']
  3621. }
  3622. }, // 砂之船动漫家
  3623. szcdmj_list: {
  3624. pager: {
  3625. nextL: '#nextPage',
  3626. pageE: 'ul.mh-list > li',
  3627. replaceE: '.pagination',
  3628. scrollD: 1000
  3629. }
  3630. }, // 砂之船动漫家 - 分类/搜索页
  3631. mangabz: {
  3632. host: ['mangabz.com', 'www.mangabz.com'],
  3633. url: ()=> {if (indexOF(/\/m\d+/)) {
  3634. setTimeout(mangabz_init, 1500);
  3635. curSite = DBSite.mangabz;
  3636. } else if (indexOF(/\/\d+bz\//)) {
  3637. if (getCSS('.detail-list-form-more')) getCSS('.detail-list-form-more').click();
  3638. } else if (indexOF('/manga-list') || lp == '/search') {
  3639. curSite = DBSite.mangabz_list;
  3640. }},
  3641. style: 'body > .container > div:not([id]) {display: none !important;} .top-bar {opacity: 0.3 !important;} #cp_img > img{display: block !important;margin: 0 auto !important; max-width: 99% !important; width: auto !important; height: auto !important;}',
  3642. pager: {
  3643. type: 4,
  3644. nextL: mangabz_nextL,
  3645. insertP: ['#cp_img', 3],
  3646. insertE: mangabz_insertE,
  3647. replaceE: 'p.top-title, body > .container > div:not([id])',
  3648. interval: 500,
  3649. scrollD: 2000
  3650. }
  3651. }, // Mangabz 漫画
  3652. mangabz_list: {
  3653. pager: {
  3654. nextL: '//div[contains(@class,"page-pagination")]//a[contains(text(), ">")]',
  3655. pageE: 'ul.mh-list > li',
  3656. replaceE: '.page-pagination',
  3657. scrollD: 800
  3658. }
  3659. }, // Mangabz 漫画 - 分类/搜索页
  3660. dm5: {
  3661. host: 'www.dm5.com',
  3662. url: ()=> {if (indexOF(/\/m\d+/)) {
  3663. setTimeout(mangabz_init, 1500);
  3664. curSite = DBSite.dm5;
  3665. } else if (indexOF('/manga-list') || lp == '/search' || getCSS('.box-body > ul.mh-list > li')) {
  3666. curSite = DBSite.mangabz_list;
  3667. } else if (getCSS('.detail-more')) {
  3668. getCSS('.detail-more').click();
  3669. }},
  3670. style: '.view-paging > .container, .view-comment {display: none !important;} .rightToolBar {opacity: 0.3 !important;} #cp_img > img{display: block !important;margin: 0 auto !important; max-width: 99% !important; width: auto !important; height: auto !important;} body {overflow: auto !important;}',
  3671. pager: {
  3672. type: 4,
  3673. nextL: dm5_nextL,
  3674. insertP: ['#cp_img', 3],
  3675. insertE: dm5_insertE,
  3676. replaceE: '.view-paging > .container, .rightToolBar',
  3677. interval: 500,
  3678. scrollD: 2000
  3679. }
  3680. }, // 动漫屋
  3681. xmanhua: {
  3682. host: ['xmanhua.com', 'www.xmanhua.com'],
  3683. url: ()=> {if (indexOF(/\/m\d+/)) {
  3684. setTimeout(mangabz_init, 1500);
  3685. curSite = DBSite.xmanhua;
  3686. } else if (indexOF(/\/\d+xm\//)) {
  3687. if (getCSS('.detail-list-form-more')) getCSS('.detail-list-form-more').click();
  3688. } else if (indexOF('/manga-list') || lp == '/search') {
  3689. curSite = DBSite.xmanhua_list;
  3690. }},
  3691. style: 'a.reader-bottom-page {display: none !important;} .header, .reader-bottom {opacity: 0.3 !important;} #cp_img > img{display: block !important;margin: 0 auto !important; max-width: 99% !important; width: auto !important; height: auto !important;}',
  3692. hiddenPN: true,
  3693. pager: {
  3694. type: 4,
  3695. nextL: xmanhua_nextL,
  3696. insertP: ['#cp_img', 3],
  3697. insertE: xmanhua_insertE,
  3698. replaceE: '.reader-title, body > .container > div:not([id])',
  3699. interval: 500,
  3700. scrollD: 2500
  3701. }
  3702. }, // Xmanhua 漫画
  3703. xmanhua_list: {
  3704. pager: {
  3705. nextL: '//div[@class="page-pagination"]//a[contains(text(), ">")]',
  3706. pageE: 'ul.mh-list > li',
  3707. replaceE: '.page-pagination',
  3708. scrollD: 1000
  3709. }
  3710. }, // Xmanhua 漫画 - 分类/搜索页
  3711. cocomanga: {
  3712. host: 'www.cocomanga.com',
  3713. url: ()=> {if (indexOF('.html')) {
  3714. if (!(getCookie('mh_readmode') === '' || getCookie('mh_readmode') === '3')) {
  3715. document.cookie='mh_readmode=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/'; // 强制开启自带的无缝翻页功能
  3716. location.reload(); // 刷新网页
  3717. }
  3718. setTimeout(cocomanga_init, 500);
  3719. curSite = DBSite.cocomanga;
  3720. } else if (indexOF(/\/\d+\/$/)) {
  3721. setTimeout(function(){if (getCSS('a.website-display-all')) getCSS('a.website-display-all').click();}, 300)
  3722. } else if (lp == '/show') {
  3723. curSite = DBSite.cocomanga_list;
  3724. } else if (lp == '/search') {
  3725. curSite = DBSite.cocomanga_search;
  3726. }},
  3727. style: '.mh_readend, .mh_footpager, .mh_readmode {display: none !important;} .mh_comicpic img {cursor: unset !important;} .mh_comicpic img {min-height: 150px;}',
  3728. pager: {
  3729. type: 4,
  3730. nextL: '//a[contains(@class, "read_page_link") and contains(string(), "下一章")][not(contains(@href, "javascript"))]',
  3731. insertP: ['#mangalist', 3],
  3732. insertE: cocomanga_insertE,
  3733. replaceE: '.mh_readtitle, .mh_headpager > a.mh_prevbook, .mh_readend',
  3734. interval: 1000,
  3735. scrollD: 2500
  3736. }
  3737. }, // COCOMANGA 漫画
  3738. cocomanga_list: {
  3739. pager: {
  3740. nextL: ()=> getNextEP('.fed-page-info a.fed-btns-green+a[onclick]', 'page=', /page=\d+/),
  3741. pageE: 'ul.fed-list-info > li',
  3742. replaceE: '.fed-page-info',
  3743. scrollD: 1000
  3744. },
  3745. function: {
  3746. bF: src_bF,
  3747. bFp: [1, 'a[data-original]', 'data-original']
  3748. }
  3749. }, // COCOMANGA 漫画 - 分类页
  3750. cocomanga_search: {
  3751. pager: {
  3752. nextL: ()=> getNextEP('.fed-page-info a.fed-btns-green+a[onclick]', 'page=', /page=\d+/),
  3753. pageE: 'dl.fed-deta-info',
  3754. replaceE: '.fed-page-info',
  3755. scrollD: 1000
  3756. },
  3757. function: {
  3758. bF: src_bF,
  3759. bFp: [1, 'a[data-original]', 'data-original']
  3760. }
  3761. }, // COCOMANGA 漫画 - 搜索页
  3762. qidian: {
  3763. host: 'www.qidian.com',
  3764. url: ()=> {if (indexOF('/all/')) {curSite = DBSite.qidian;}},
  3765. pager: {
  3766. nextL: 'a[class*="pagination-next"]',
  3767. pageE: 'ul.all-img-list > li',
  3768. replaceE: '#page-container',
  3769. scrollD: 900
  3770. }
  3771. }, // 起点中文
  3772. qidian_read: {
  3773. host: 'read.qidian.com',
  3774. style: '.admire-wrap {display: none !important;}',
  3775. pager: {
  3776. nextL: 'a[id$="chapterNext"]',
  3777. pageE: '.main-text-wrap > div:not(.admire-wrap)',
  3778. replaceE: '.chapter-control',
  3779. scrollD: 900
  3780. }
  3781. }, // 起点中文 - 阅读页
  3782. qimao: {
  3783. host: 'www.qimao.com',
  3784. url: ()=> {if (indexOF(/\/shuku\/\d+-\d+\//) || indexOF('/reader/index/')) {curSite = DBSite.qimao;}},
  3785. pager: {
  3786. nextL: '//div[@class="reader-footer"]/a[text()="下一章"]',
  3787. pageE: '.article > p',
  3788. replaceE: '.reader-footer',
  3789. scrollD: 900
  3790. }
  3791. }, // 七猫中文
  3792. zxcs: {
  3793. host: 'zxcs.me',
  3794. url: ()=> {if (indexOF('/sort/')) curSite = DBSite.zxcs;},
  3795. pager: {
  3796. nextL: '#pagenavi > span+a',
  3797. pageE: 'dl[id="plist"]',
  3798. replaceE: '#pagenavi',
  3799. scrollD: 900
  3800. }
  3801. }, // 知轩藏书
  3802. baoshuu: {
  3803. host: 'www.baoshuu.com',
  3804. url: ()=> {if (indexOF('/TXT/list')) curSite = DBSite.baoshuu;},
  3805. pager: {
  3806. nextL: '//div[@class="listl2"]//a[text()="下一页"]',
  3807. pageE: '.listl2 > ul > li',
  3808. replaceE: '.listl2 > dl',
  3809. scrollD: 900
  3810. }
  3811. }, // 宝书网
  3812. baoshuu_m: {
  3813. host: 'm.baoshuu.com',
  3814. url: ()=> {if (indexOF('/TXT/list')) curSite = DBSite.baoshuu_m;},
  3815. pager: {
  3816. nextL: '//div[@class="man_first"]//a[text()="下一页"]',
  3817. pageE: '.man_first > ul > li',
  3818. replaceE: '.man_first > dl',
  3819. scrollD: 900
  3820. }
  3821. }, // 宝书网- 手机版
  3822. yushubo: {
  3823. host: 'www.yushubo.com',
  3824. url: ()=> {if (indexOF('/read_')) {
  3825. curSite = DBSite.yushubo;
  3826. } else if (indexOF('/lists/')) {
  3827. curSite = DBSite.yushubo_list;
  3828. } else if (indexOF('/all')) {
  3829. curSite = DBSite.yushubo_all;
  3830. }},
  3831. style: '.readbg.mt10 {display: none !important;}',
  3832. pager: {
  3833. nextL: '//div[contains(@class, "articlebtn")]/a[contains(text(), "下一页") or contains(text(), "下一章")]',
  3834. pageE: '#BookText',
  3835. insertP: ['#BookText', 6],
  3836. insertP6Br: true,
  3837. replaceE: '.articlebtn',
  3838. scrollD: 1000
  3839. }
  3840. }, // 御书网
  3841. yushubo_list: {
  3842. pager: {
  3843. nextL: 'id("pager")//a[contains(text(), "下一页")]',
  3844. pageE: '.books-list > ul > li',
  3845. replaceE: '#pager',
  3846. scrollD: 1000
  3847. }
  3848. }, // 御书网 - 分类页
  3849. yushubo_all: {
  3850. pager: {
  3851. nextL: 'id("pager")//a[contains(text(), "下一页")]',
  3852. pageE: 'ul.search-list > li',
  3853. replaceE: '#pager',
  3854. scrollD: 1000
  3855. }
  3856. }, // 御书网 - 书库页
  3857. soxscc: {
  3858. host: 'www.soxscc.org',
  3859. url: ()=> {if (indexOF(/\/\d{4,}\.html/)) {curSite = DBSite.soxscc;}},
  3860. style: '.content > p, img {display: none !important;}',
  3861. pager: {
  3862. nextL: '//font[contains(text(), "下一章")]/following-sibling::a[1]',
  3863. pageE: '.content',
  3864. insertP: ['.content', 6],
  3865. insertP6Br: true,
  3866. replaceE: '.pagego',
  3867. scrollD: 1500
  3868. }
  3869. }, // 搜小说
  3870. ihuaben: {
  3871. host: 'www.ihuaben.com',
  3872. url: ()=> {if (indexOF(/\/\d{4,}\.html/)) {curSite = DBSite.ihuaben;}},
  3873. style: '.discription > p > i, img, #container, #BDBannerBottom_PC, iframe, .navFooter {display: none !important;} .discription > p {font-size: 16px; min-height: 24px; padding-bottom: 24px;}',
  3874. pager: {
  3875. nextL: 'id("preAndNextBar")/a[contains(text(), "下一章")]',
  3876. pageE: '#contentsource > p',
  3877. insertP: ['.discription', 3],
  3878. replaceE: '#preAndNextBar',
  3879. scrollD: 1000
  3880. }
  3881. }, // 话本小说网
  3882. xineyby: {
  3883. host: 'www.xineyby.com',
  3884. url: ()=> {if (indexOF('/read/')) {
  3885. curSite = DBSite.xineyby;
  3886. } else if (indexOF(/\/(list|quanben|search)/)) {
  3887. curSite = DBSite.xineyby_list;
  3888. }},
  3889. pager: {
  3890. nextL: 'id("footlink")/a[contains(text(), "下一页")]',
  3891. pageE: '#contents',
  3892. insertP: ['#contents', 6],
  3893. insertP6Br: true,
  3894. replaceE: '#footlink, #amain dd h1',
  3895. scrollD: 900
  3896. }
  3897. }, // 无错小说网
  3898. xineyby_list: {
  3899. pager: {
  3900. nextL: '#pagelink a.next',
  3901. pageE: '#content > dd tbody > tr:not(:first-child)',
  3902. insertP: ['#content > dd tbody', 3],
  3903. replaceE: '#pagelink',
  3904. scrollD: 900
  3905. }
  3906. }, // 无错小说网 - 分类/搜索页
  3907. _530p: {
  3908. host: 'www.530p.com',
  3909. url: ()=> {if (indexOF(/\/\d{4,}\.htm/)) {curSite = DBSite._530p;}},
  3910. pager: {
  3911. nextL: '#nextLink',
  3912. pageE: '#cp_content',
  3913. insertP: ['#cp_content', 6],
  3914. insertP6Br: true,
  3915. replaceE: '#pg_bar',
  3916. scrollD: 1500
  3917. }
  3918. }, // 无弹窗小说网
  3919. xiaoshuo77: {
  3920. host: 'm.xiaoshuo77.net',
  3921. url: ()=> {if (indexOF('.html')) {curSite = DBSite.xiaoshuo77; xs_bF(getAllCSS('#novelcontent'), [/(<br>)?(&nbsp;)+内容未完,下一页.*$|【本章阅读.*$/, '<br>']);}},
  3922. style: '#novelcontent > p, img {display: none !important;}',
  3923. pager: {
  3924. nextL: '.page_chapter a.p4',
  3925. pageE: '#novelcontent',
  3926. insertP: ['#novelcontent', 6],
  3927. replaceE: '.page_chapter',
  3928. scrollD: 1500
  3929. },
  3930. function: {
  3931. bF: xs_bF,
  3932. bFp: [/(<br>)?(&nbsp;)+内容未完,下一页.*$|【本章阅读.*$/, '<br>']
  3933. }
  3934. }, // 读书族小说网
  3935. linovel: {
  3936. host: 'www.linovel.net',
  3937. url: ()=> {if (indexOF(/\/book\/\d+\/.+\.html/)) {
  3938. insStyle('.reward-section {display: none !important;}');
  3939. } else if (indexOF('/cat/')) {
  3940. curSite = DBSite.linovel;
  3941. }},
  3942. pager: {
  3943. nextL: '//ul[@class="pagination"]/li/a[contains(text(), "下一页")]',
  3944. pageE: '.rank-book-list > div',
  3945. replaceE: 'ul.pagination',
  3946. scrollD: 1000
  3947. }
  3948. }, // 轻之文库
  3949. _23qb: {
  3950. host: 'www.23qb.net',
  3951. url: ()=> {if (indexOF(/\/book\/\d+\/.+\.html/)) {
  3952. curSite = DBSite._23qb; xs_bF(getAllCSS('#mlfy_main_text > *'), [/(继续下一页).+|铅笔小说.+/, '']);
  3953. } else if (lp != '/' && !indexOF(/\/book\/\d+\//)) {
  3954. curSite = DBSite._23qb_list;
  3955. }},
  3956. pager: {
  3957. nextL: ()=> (location.origin + ReadParams.url_next),
  3958. pageE: 'id("TextContent")/p | //script[contains(text(), "ReadParams")]',
  3959. insertP: ['#TextContent', 3],
  3960. replaceE: '.chepnav',
  3961. scriptT: 2,
  3962. scrollD: 1500
  3963. },
  3964. function: {
  3965. bF: xs_bF,
  3966. bFp: [/.*继续下一页.*|.*铅笔小说.*/, '']
  3967. }
  3968. }, // 铅笔小说
  3969. _23qb_list: {
  3970. pager: {
  3971. nextL: '.pages a.next, .pages > strong+a',
  3972. pageE: '#sitebox > dl',
  3973. replaceE: '.pages',
  3974. scrollD: 1000
  3975. },
  3976. function: {
  3977. bF: src_bF,
  3978. bFp: [0, 'img[_src]', '_src']
  3979. }
  3980. }, // 铅笔小说 - 分类页
  3981. linovelib: {
  3982. host: 'www.linovelib.com',
  3983. url: ()=> {if (indexOF(/\/novel\/\d+\/.+\.html/)) {
  3984. curSite = DBSite.linovelib;
  3985. } else if (indexOF('/wenku/')) {
  3986. curSite = DBSite.linovelib_wenku;
  3987. } else if (indexOF('/top/') || indexOF('/topfull/') || indexOF('toplist.php')) {
  3988. curSite = DBSite.linovelib_top;
  3989. }},
  3990. pager: {
  3991. nextL: '//p[@class="mlfy_page"]/a[contains(text(), "下一页") or contains(text(), "下一章")]',
  3992. pageE: '#mlfy_main_text > *',
  3993. replaceE: 'p.mlfy_page',
  3994. scrollD: 1000
  3995. }
  3996. }, // 哔哩轻小说
  3997. linovelib_wenku: {
  3998. pager: {
  3999. nextL: '#pagelink > a.next',
  4000. pageE: '.store_collist > div.bookbox',
  4001. replaceE: '#pagelink',
  4002. scrollD: 1000
  4003. },
  4004. function: {
  4005. bF: src_bF,
  4006. bFp: [0, 'img[data-original]', 'data-original']
  4007. }
  4008. }, // 哔哩轻小说 - 文库
  4009. linovelib_top: {
  4010. pager: {
  4011. nextL: '#pagelink > a.next',
  4012. pageE: '.rankpage_box > div.rank_d_list',
  4013. replaceE: '#pagelink',
  4014. scrollD: 1000
  4015. },
  4016. function: {
  4017. bF: src_bF,
  4018. bFp: [0, 'img[data-original]', 'data-original']
  4019. }
  4020. }, // 哔哩轻小说 - 全本
  4021. linovelib_w: {
  4022. host: 'w.linovelib.com',
  4023. url: ()=> {if (indexOF(/\/novel\/\d+\/.+\.html/)) {
  4024. curSite = DBSite.linovelib_w;
  4025. } else if (indexOF('/wenku/') || indexOF('/sa/')) {
  4026. curSite = DBSite.linovelib_w_wenku;
  4027. }},
  4028. style: 'body {min-height: 1000px;}',
  4029. pager: {
  4030. nextL: ()=> {if (ReadParams) {return (location.origin + ReadParams.url_next)}; return ''},
  4031. pageE: '//body/script[contains(text(), "var ReadParams")] | id("apage")/div',
  4032. insertP: ['#apage', 3],
  4033. scriptT: 2,
  4034. scrollD: 1000
  4035. }
  4036. }, // 哔哩轻小说 (手机版)
  4037. linovelib_w_wenku: {
  4038. pager: {
  4039. nextL: '#pagelink > strong+a ,#pagelink a.next',
  4040. pageE: 'ol.book-ol > li',
  4041. replaceE: '#pagelink',
  4042. scrollD: 1000
  4043. },
  4044. function: {
  4045. bF: src_bF,
  4046. bFp: [0, 'img[data-original]', 'data-original']
  4047. }
  4048. }, // 哔哩轻小说 (手机版) - 文库
  4049. ao3: {
  4050. host: 'archiveofourown.org',
  4051. url: ()=> {if (indexOF(/\/works$/) || lp == '/works/search') {
  4052. curSite = DBSite.ao3;
  4053. } else if (indexOF(/\/works\/\d+\/chapters\//)) {
  4054. curSite = DBSite.ao3_post;
  4055. }},
  4056. pager: {
  4057. nextL: 'li.next a',
  4058. pageE: 'li.work[id^="work_"]',
  4059. replaceE: '.pagination',
  4060. scrollD: 2500
  4061. }
  4062. }, // AO3 - 列表页 + 搜索页
  4063. ao3_post: {
  4064. pager: {
  4065. nextL: 'li.chapter.next a',
  4066. pageE: '#workskin > div',
  4067. replaceE: '#main ul.navigation, #feedback > ul.actions',
  4068. scrollD: 2000
  4069. }
  4070. }, // AO3 - 阅读页
  4071. _423down: {
  4072. host: 'www.423down.com',
  4073. url: ()=> {if (!indexOF('.html')) curSite = DBSite._423down;},
  4074. pager: {
  4075. nextL: '//div[@class="paging"]//a[contains(text(),"下一页")]',
  4076. pageE: 'div.content-wrap ul.excerpt > li',
  4077. replaceE: 'div.paging',
  4078. scrollD: 2000
  4079. }
  4080. }, // 423Down
  4081. iao_su: {
  4082. host: 'iao.su',
  4083. pager: {
  4084. nextL: 'li.next > a',
  4085. pageE: '#index > article, #archive > article',
  4086. insertP: ['ol.page-navigator', 1],
  4087. replaceE: 'ol.page-navigator',
  4088. scriptT: 3,
  4089. scrollD: 1000
  4090. }
  4091. }, // 不死鸟
  4092. sharerw: {
  4093. host: 'www.sharerw.com',
  4094. url: ()=> {if (!indexOF('.html')) {if (lp == '/search.php') {curSite = DBSite.sharerw_search;} else {curSite = DBSite.sharerw;};};},
  4095. pager: {
  4096. nextL: 'span.next > a',
  4097. pageE: '.new-post > article',
  4098. replaceE: '.pagebar',
  4099. scrollD: 1500
  4100. }
  4101. }, // 分享者
  4102. sharerw_search: {
  4103. pager: {
  4104. nextL: 'span.next > a',
  4105. pageE: '#mainbox > article',
  4106. replaceE: '.pagebar',
  4107. scrollD: 1500
  4108. }
  4109. }, // 分享者 - 搜索页
  4110. extfans: {
  4111. host: 'www.extfans.com',
  4112. url: '/^\\/.+/',
  4113. pager: {
  4114. nextL: 'a.page-next',
  4115. pageE: '.app-item-content, .article-item-content',
  4116. replaceE: '.pagination-content',
  4117. scrollD: 2000
  4118. }
  4119. }, // 扩展迷
  4120. appinn: {
  4121. host: 'www.appinn.com',
  4122. pager: {
  4123. nextL: 'a.next.page-numbers',
  4124. pageE: 'section#latest-posts > article',
  4125. replaceE: 'div.nav-links',
  4126. scrollD: 1500
  4127. }
  4128. }, // 小众软件
  4129. isharepc: {
  4130. host: 'www.isharepc.com',
  4131. pager: {
  4132. nextL: 'a.next.page-numbers',
  4133. pageE: '.content > div.post',
  4134. replaceE: 'nav.pagination',
  4135. scrollD: 1000
  4136. }
  4137. }, // 乐软博客
  4138. ghxi: {
  4139. host: 'www.ghxi.com',
  4140. url: ()=> {if (lp == '/' && !location.search) {curSite = DBSite.ghxi;} else {curSite = DBSite.ghxi_list;}},
  4141. pager: {
  4142. type: 2,
  4143. nextL: '.load-more',
  4144. interval: 1000,
  4145. scrollD: 5000
  4146. }
  4147. }, // 果核剥壳 - 首页
  4148. ghxi_list: {
  4149. pager: {
  4150. nextL: 'a.next',
  4151. pageE: 'ul.post-loop > li',
  4152. replaceE: 'ul.pagination',
  4153. scrollD: 1500
  4154. },
  4155. function: {
  4156. bF: src_bF,
  4157. bFp: [0, 'img[data-original]', 'data-original']
  4158. }
  4159. }, // 果核剥壳 - 分类/搜索页
  4160. _6yit: {
  4161. host: ['www.6yit.com'],
  4162. url: ()=> {if (!indexOF('.html')) {curSite = DBSite._6yit;}},
  4163. pager: {
  4164. nextL: 'a.next.page-numbers',
  4165. pageE: 'posts.posts-item.list',
  4166. replaceE: '.pagenav',
  4167. scrollD: 1500
  4168. }
  4169. }, // 六音软件
  4170. apprcn: {
  4171. host: ['www.apprcn.com', 'free.apprcn.com'],
  4172. url: ()=> {if (lp == '/' || indexOF('/category/')) {curSite = DBSite.apprcn;}},
  4173. pager: {
  4174. nextL: '//div[@class="pagination"]//a[contains(text(), "Next")]',
  4175. pageE: 'article.article',
  4176. replaceE: '.pagination',
  4177. scrollD: 1000
  4178. }
  4179. }, // 反斗软件
  4180. weidown: {
  4181. host: 'www.weidown.com',
  4182. url: ()=> {if (indexOF('/search/')) { //搜索页
  4183. curSite = DBSite.weidown_search;
  4184. } else if (indexOF('/special')) { // 专题页
  4185. curSite = DBSite.weidown_special;
  4186. } else {
  4187. curSite = DBSite.weidown;
  4188. }},
  4189. pager: {
  4190. nextL: 'a.nextpage',
  4191. pageE: '.articleWrapper > .itemArticle, .articleWrapper > .richTextItem.search',
  4192. insertP: ['.articleWrapper', 3],
  4193. replaceE: '#pageGroup',
  4194. scrollD: 1500
  4195. }
  4196. }, // 微当下载
  4197. weidown_search: {
  4198. pager: {
  4199. nextL: 'a.nextpage',
  4200. pageE: '.articleListWrapper > .richTextItem.search',
  4201. replaceE: '#pageGroup',
  4202. scrollD: 700
  4203. }
  4204. }, // 微当下载 - 搜索页
  4205. weidown_special: {
  4206. pager: {
  4207. nextL: 'a.nextpage',
  4208. pageE: '.special > .item, .articleWrapper > div',
  4209. insertP: ['.special, .articleWrapper', 3],
  4210. replaceE: '#pageGroup',
  4211. scrollD: 700
  4212. }
  4213. }, // 微当下载 - 专题页
  4214. fsylr: {
  4215. host: 'fsylr.com',
  4216. url: ()=> {if (!indexOF('.html')) {curSite = DBSite.fsylr;}},
  4217. pager: {
  4218. nextL: 'a.next.page-numbers',
  4219. pageE: '.posts-con > div:not([class*="posts-"])',
  4220. replaceE: 'nav.pagination',
  4221. scrollD: 2000
  4222. }
  4223. }, // 发烧友绿软
  4224. iplaysoft: {
  4225. host: 'www.iplaysoft.com',
  4226. url: ()=> {if (indexOF('.html') || indexOF('/p/')) {curSite = DBSite.iplaysoft_comment;} else {curSite = DBSite.iplaysoft;}},
  4227. pager: {
  4228. nextL: '.pagenavi a[title="下一页"]',
  4229. pageE: '#postlist > div.entry',
  4230. replaceE: '.pagenavi-button, .pagenavi',
  4231. scrollD: 1200
  4232. },
  4233. function: {
  4234. bF: src_bF,
  4235. bFp: [0, 'img[data-src]', 'data-src']
  4236. }
  4237. }, // 异次元软件
  4238. iplaysoft_comment: {
  4239. pager: {
  4240. type: 2,
  4241. nextL: '#loadHistoryComments',
  4242. nextTextOf: '展开后面',
  4243. scrollD: 1200
  4244. }
  4245. }, // 异次元软件 - 评论
  4246. mubolin: {
  4247. host: 'www.mubolin.cn',
  4248. pager: {
  4249. nextL: 'a.next.page-numbers',
  4250. pageE: '#recent-content > div',
  4251. replaceE: 'nav.pagination',
  4252. scrollD: 1500
  4253. }
  4254. }, // 悪魔の小站
  4255. mpyit: {
  4256. host: 'www.mpyit.com',
  4257. url: ()=> {if (lp == '/' && !location.search) {
  4258. curSite = DBSite.mpyit;
  4259. } else if (indexOF('/category/') || indexOF('?s=', 's')) { // 搜索页 / 分类页
  4260. curSite = DBSite.mpyit_category;
  4261. }},
  4262. pager: {
  4263. nextL: 'a.page-numbers[title="下一页"]',
  4264. pageE: '#post > div[id^="post-"]',
  4265. replaceE: '#post > #pagenavi',
  4266. scrollD: 1700
  4267. }
  4268. }, // 老殁 | 殁漂遥
  4269. mpyit_category: {
  4270. pager: {
  4271. nextL: 'a.page-numbers[title="下一页"]',
  4272. pageE: '#content > div[class^="entry_box"]',
  4273. replaceE: '#content > #pagenavi',
  4274. scrollD: 1700
  4275. }
  4276. }, // 老殁 | 殁漂遥 - 搜索页/分类页
  4277. tenlonstudio: {
  4278. host: 'www.tenlonstudio.com',
  4279. url: ()=> {if (lp == '/' && !location.search) {
  4280. curSite = DBSite.tenlonstudio;
  4281. } else {
  4282. curSite = DBSite.tenlonstudio_list;
  4283. }},
  4284. pager: {
  4285. type: 2,
  4286. nextL: '.load-more',
  4287. nextText: '加载更多',
  4288. interval: 500,
  4289. scrollD: 1000
  4290. }
  4291. }, // 腾龙工作室
  4292. tenlonstudio_list: {
  4293. pager: {
  4294. nextL: '//div[@class="btn-pager"]/a[contains(text(), "❯")]',
  4295. pageE: 'li.post-list-item',
  4296. replaceE: '.ajax-pager',
  4297. scrollD: 1000
  4298. }
  4299. }, // 腾龙工作室 - 分类/搜索页
  4300. yxssp: {
  4301. host: 'www.yxssp.com',
  4302. pager: {
  4303. nextL: '//div[contains(@class, "page-nav")]/a[last()]',
  4304. pageE: '.td-modules-container.td-module-number4 > div',
  4305. replaceE: '.page-nav.td-pb-padding-side',
  4306. scrollD: 1000
  4307. }
  4308. }, // 异星软件空间
  4309. yrxitong: {
  4310. host: 'www.yrxitong.com',
  4311. url: ()=> {
  4312. if (lp == '/sr.jsp') {
  4313. curSite = DBSite.yrxitong_search;
  4314. } else if (!indexOF('/h-nd-')) {
  4315. curSite = DBSite.yrxitong;
  4316. }
  4317. },
  4318. pager: {
  4319. nextL: 'span.pageNext > a',
  4320. pageE: '#containerFormsCenter .m_news_list > div',
  4321. replaceE: '.pagenation',
  4322. scrollD: 1200
  4323. },
  4324. function: {
  4325. bF: src_bF,
  4326. bFp: [1, 'a[data-original]', 'data-original']
  4327. }
  4328. }, // 小鱼儿 yr 系统
  4329. yrxitong_search: {
  4330. pager: {
  4331. nextL: 'span.pageNext > a',
  4332. pageE: '#containerFormsCenter .newsList > div',
  4333. replaceE: '.pagenation',
  4334. scrollD: 2000
  4335. }
  4336. }, // 小鱼儿 yr 系统 - 搜索页
  4337. downg: {
  4338. host: 'www.downg.com',
  4339. url: ()=> {if (indexOF('/new/')) {curSite = DBSite.downg;}},
  4340. pager: {
  4341. nextL: 'a.nextpage',
  4342. pageE: '.ApdList > ul.ApdLi',
  4343. replaceE: '.pagination',
  4344. scrollD: 1500
  4345. }
  4346. }, // 绿软家园
  4347. sordum: {
  4348. host: 'www.sordum.org',
  4349. pager: {
  4350. nextL: 'a.next.page-numbers',
  4351. pageE: '.article > article',
  4352. replaceE: 'nav.navigation.posts-navigation',
  4353. scrollD: 1500
  4354. }
  4355. }, // (下面这几个都是国外博客网站)
  4356. winaero: {
  4357. host: 'winaero.com',
  4358. url: ()=> {if (lp == '/' || indexOF('/category/')) curSite = DBSite.winaero;},
  4359. pager: {
  4360. nextL: 'a.next.page-numbers',
  4361. pageE: '#main > article',
  4362. replaceE: '.pagination',
  4363. scrollD: 1500
  4364. }
  4365. },
  4366. lrepacks: {
  4367. host: 'lrepacks.net',
  4368. url: ()=> {if (!indexOF('.html')) curSite = DBSite.lrepacks;},
  4369. pager: {
  4370. nextL: '.page_next > a',
  4371. pageE: '#main .post-list article',
  4372. replaceE: '.page_nav',
  4373. scrollD: 1500
  4374. },
  4375. function: {
  4376. bF: pageElems => { // 插入前函数(调整 class)
  4377. pageElems.forEach(function (one) {
  4378. let now = one.querySelector('.slideUp, .elementFade');
  4379. if (now) now.className = now.className.replace('slideUp','slideUpRun').replace('elementFade','elementFadeRun');
  4380. });
  4381. return pageElems
  4382. }
  4383. }
  4384. },
  4385. dlandroid: {
  4386. host: 'dlandroid.com',
  4387. url: ()=> {if (indexOF('/cat/') || (lp === '/' && indexOF('?s=', 's'))) curSite = DBSite.dlandroid;},
  4388. pager: {
  4389. nextL: 'a.next.page-numbers',
  4390. pageE: 'div.post',
  4391. replaceE: '.navigation',
  4392. scrollD: 1500
  4393. },
  4394. function: {
  4395. bF: src_bF,
  4396. bFp: [0, 'img[data-src]', 'data-src']
  4397. }
  4398. }, // DlAndroid
  4399. winhelponline: {
  4400. host: 'www.winhelponline.com',
  4401. url: ()=> {if (lp == '/blog/') {curSite = DBSite.winhelponline;}},
  4402. pager: {
  4403. nextL: 'span.prev > a',
  4404. pageE: '#main > article',
  4405. replaceE: 'nav.paging-navigation',
  4406. scrollD: 2000
  4407. }
  4408. },
  4409. windowslatest: {
  4410. host: 'www.windowslatest.com',
  4411. pager: {
  4412. nextL: '//div[contains(@class, "page-nav")]/a[last()]',
  4413. pageE: '.td-ss-main-content > div:not(.td-block-title-wrap):not(.page-nav)',
  4414. replaceE: '.page-nav',
  4415. scrollD: 2000
  4416. }
  4417. },
  4418. thewindowsclub: {
  4419. host: 'www.thewindowsclub.com',
  4420. url: ()=> {curSite = DBSite.thewindowsclub; if (lp == '/') {curSite.pager.scrollD = 2000;}},
  4421. pager: {
  4422. nextL: 'li.pagination-next > a',
  4423. pageE: '#genesis-content > article.post',
  4424. replaceE: '.pagination',
  4425. scrollD: 1500
  4426. }
  4427. },
  4428. acs: {
  4429. host: ['pubs.acs.org','onlinelibrary.wiley.com'],
  4430. url: ()=> {if (indexOF('/doSearch')) {curSite = DBSite.acs;}},
  4431. pager: {
  4432. nextL: 'a.pagination__btn--next',
  4433. pageE: 'ul.items-results > *',
  4434. replaceE: '.pagination',
  4435. scrollD: 3000
  4436. }
  4437. }, // Wiley Online Library + ACS (Publications)
  4438. libgen: {
  4439. host: /libgen/,
  4440. url: ()=> {if (lp == '/search.php') {curSite = DBSite.libgen;}},
  4441. pager: {
  4442. nextL: '//font/a[contains(text(), "►")]',
  4443. pageE: 'table[rules="rows"] > tbody > tr:nth-of-type(n+2), .paginator+script:not([src])',
  4444. insertP: ['table[rules="rows"] > tbody', 3],
  4445. replaceE: '//td[./font/a[contains(text(), "►")]]',
  4446. scriptT: 2,
  4447. scrollD: 2000
  4448. }
  4449. }, // Library Genesis
  4450. sciencedirect: {
  4451. host: 'www.sciencedirect.com',
  4452. url: ()=> {locationC = true; if (lp == '/search') {curSite = DBSite.sciencedirect; setTimeout(function(){insStyle('html, body {height: ' + (document.documentElement.scrollHeight || document.body.scrollHeight) + 'px;}')}, 2000)}},
  4453. style: 'footer {display: none !important;}',
  4454. iframe: true,
  4455. pager: {
  4456. type: 5,
  4457. nextL: 'a[data-aa-name="srp-next-page"]',
  4458. scrollD: 2000
  4459. }
  4460. }, // ScienceDirect
  4461. Z_Library: {
  4462. host: /(\dlib|b-ok\d?|booksc|z-lib)\./,
  4463. url: ()=> {if (indexOF('/s/')) {curSite = DBSite.Z_Library;}},
  4464. pager: {
  4465. nextL: '//div[@class="paginator"]//span/strong/parent::span/parent::td/following-sibling::td[1]//a',
  4466. pageE: 'id("searchResultBox")/div | //script[contains(string(), "pagerOptions")]',
  4467. insertP: ['#searchResultBox', 3],
  4468. replaceE: '.paginator',
  4469. scriptT: 2,
  4470. scrollD: 2000
  4471. },
  4472. function: {
  4473. bF: src_bF,
  4474. bFp: [0, 'img[data-src]', 'data-src']
  4475. }
  4476. }, // Z-Library
  4477. pubmed: {
  4478. host: 'pubmed.ncbi.nlm.nih.gov',
  4479. pager: {
  4480. type: 2,
  4481. nextL: 'button.load-button.next-page',
  4482. nextText: 'Show more results',
  4483. scrollD: 1500
  4484. }
  4485. }, // PubMed
  4486. x_mol: {
  4487. host: 'www.x-mol.com',
  4488. url: ()=> {if (indexOF('/search/q') || indexOF('/paper/')) {curSite = DBSite.x_mol;}},
  4489. pager: {
  4490. nextL: ()=> getNextEP('.pagination li.active+li > a', 'pageIndex=', /pageIndex=\d+/),
  4491. pageE: '.magazine-senior-search-results-list > ul > li, .magazine-model-content-new > ul > li',
  4492. insertP: ['.magazine-senior-search-results-list > ul, .magazine-model-content-new > ul', 3],
  4493. replaceE: '.pagination',
  4494. scrollD: 2000
  4495. }
  4496. }, // X-MOL
  4497. cqvip: {
  4498. host: 'www.cqvip.com',
  4499. url: ()=> {if (indexOF('/search')) {curSite = DBSite.cqvip;}},
  4500. pager: {
  4501. type: 6,
  4502. nextL: '//ul[@class="pagenum"]//a[text()="下一页"]',
  4503. pageE: 'ul.prolist:last-child > li',
  4504. replaceE: 'ul.pagenum',
  4505. loadTime: 1000,
  4506. scrollD: 2000
  4507. }
  4508. }, // 维普网
  4509. ablesci: {
  4510. host: 'www.ablesci.com',
  4511. url: ()=> {if (indexOF('/detail')) {curSite = DBSite.ablesci_p;} else if (getCSS('ul.fly-list')) {curSite = DBSite.ablesci;}},
  4512. pager: {
  4513. nextL: 'li.next > a',
  4514. pageE: 'ul.fly-list > li',
  4515. replaceE: '.pages',
  4516. scrollD: 2000
  4517. }
  4518. }, // 科研通
  4519. ablesci_p: {
  4520. thread: true,
  4521. pager: {
  4522. nextL: 'li.next > a',
  4523. pageE: 'ul#jieda > li',
  4524. replaceE: '.pages',
  4525. scrollD: 2000
  4526. }
  4527. }, // 科研通 - 帖子内
  4528. coolkeyan: {
  4529. host: 'www.coolkeyan.com',
  4530. url: ()=> {if (location.hash.indexOf('/project/') > -1) curSite = DBSite.coolkeyan;},
  4531. style: '.q-img {height: auto !important;} .q-img__image {max-height: 1000px !important;} .row.q-my-sm.q-gutter-sm {display: none !important;}',
  4532. pager: {
  4533. type: 4,
  4534. nextL: coolkeyan_nextL,
  4535. insertP: ['//div[contains(@class, "q-img__image")][last()]', 4],
  4536. insertE: coolkeyan_insertE,
  4537. scrollD: 1500
  4538. }
  4539. }, // 酷科研
  4540. muchong: {
  4541. host: 'muchong.com',
  4542. url: ()=> {if (indexOF('/f-') || indexOF('search.php')) {
  4543. curSite = DBSite.muchong;
  4544. } else if (indexOF('/t-')) {
  4545. curSite = DBSite.muchong; curSite.pager.pageE = '#maincontent > table > tbody:not(.header)'; curSite.pager.scrollD = 2000; curSite.thread = true;
  4546. }},
  4547. style: 'tr.forum_head {display: none !important;}',
  4548. pager: {
  4549. nextL: '//div[contains(@class, "xmc_Pages")]//a[text()="下一页"]',
  4550. pageE: '.forum_body table > tbody',
  4551. replaceE: '.xmc_Pages',
  4552. scrollD: 1500
  4553. }
  4554. }, // 小木虫
  4555. google_scholar: {
  4556. host: 'scholar.google.com',
  4557. url: ()=> {if (lp == '/scholar') {curSite = DBSite.google_scholar;}},
  4558. pager: {
  4559. nextL: '//a[./span[contains(@class, "next")]]',
  4560. pageE: '#gs_res_ccl_mid > *',
  4561. insertP: ['#gs_res_ccl_mid', 3],
  4562. replaceE: '#gs_n',
  4563. scriptT: 1,
  4564. scrollD: 2000
  4565. }
  4566. }, // 谷歌学术
  4567. google_scholar_: {
  4568. host: 'sc.panda321.com',
  4569. pager: {
  4570. nextL: '//a[./span[contains(@class, "next")]]',
  4571. pageE: '#gs_res_ccl_mid > *',
  4572. insertP: ['#gs_res_ccl_mid', 3],
  4573. replaceE: '#gs_n',
  4574. scriptT: 1,
  4575. scrollD: 2000
  4576. },
  4577. function: {
  4578. bF: pageElems => {
  4579. getCSS('#gs_n').remove();
  4580. return pageElems
  4581. }
  4582. }
  4583. }, // 谷歌学术 - 其他镜像站
  4584. bing_academic: {
  4585. style: 'li.aca_algo_count {display: none !important;}',
  4586. pager: {
  4587. nextL: 'a.sb_pagN',
  4588. pageE: '#b_results > li.aca_algo',
  4589. replaceE: '#b_results .b_pag',
  4590. scrollD: 1000
  4591. }
  4592. }, // 必应学术
  4593. baidu_xueshu: {
  4594. host: 'xueshu.baidu.com',
  4595. url: ()=> {if (lp == '/s') {
  4596. curSite = DBSite.baidu_xueshu;
  4597. } else if (indexOF('journal/navigation')) {
  4598. curSite = DBSite.baidu_xueshu_journal;
  4599. } else if (indexOF('paper/show')) {
  4600. curSite = DBSite.baidu_xueshu_paper;
  4601. }},
  4602. pager: {
  4603. nextL: 'id("page")/a[./i[@class="c-icon-pager-next"]]',
  4604. pageE: '#bdxs_result_lists > div.result',
  4605. replaceE: '#page',
  4606. scrollD: 1000
  4607. }
  4608. }, // 百度学术
  4609. baidu_xueshu_journal: {
  4610. pager: {
  4611. nextL: 'a.res-page-next',
  4612. pageE: '#journaldetail > div',
  4613. replaceE: '.res-page',
  4614. scrollD: 1000
  4615. }
  4616. }, // 百度学术
  4617. baidu_xueshu_paper: {
  4618. pager: {
  4619. type: 2,
  4620. nextL: 'div:not([style*="display: none"]) > .more_btn',
  4621. nextText: '加载更多',
  4622. scrollD: 1000
  4623. }
  4624. }, // 百度学术
  4625. so_xueshu: {
  4626. host: 'xueshu.so.com',
  4627. url: ()=> {if (lp == '/s') {curSite = DBSite.so_xueshu;}},
  4628. pager: {
  4629. nextL: 'a#snext',
  4630. pageE: 'ul.list > li',
  4631. replaceE: '#page',
  4632. scrollD: 1000
  4633. }
  4634. }, // 360 学术
  4635. wanfangdata: {
  4636. host: 's.wanfangdata.com.cn',
  4637. url: ()=> {locationC = true; curSite = DBSite.wanfangdata;},
  4638. style: '#zkFooter {display: none !important;}',
  4639. iframe: true,
  4640. pager: {
  4641. type: 5,
  4642. nextL: ()=> getNextEP('.pager.active+span.pager', 'p=', /p=\d+/),
  4643. scrollD: 2000
  4644. }
  4645. }, // 万方数据知识服务
  4646. nsfc: {
  4647. host: ['output.nsfc.gov.cn', 'kd.nsfc.gov.cn'],
  4648. url: ()=> {if (indexOF('/conclusionProject/')) curSite = DBSite.nsfc;},
  4649. style: '#pageNoUl {display: none !important;}',
  4650. pager: {
  4651. type: 4,
  4652. nextL: nsfc_nextL,
  4653. insertP: ['#pageNoUl', 1],
  4654. insertE: nsfc_insertE,
  4655. scrollD: 1500
  4656. }
  4657. }, // 国家自然科学基金
  4658. stackoverflow: {
  4659. host: 'stackoverflow.com',
  4660. url: ()=> {if (indexOF('/questions') && !indexOF(/\/questions\/\d+\//)) {
  4661. curSite = DBSite.stackoverflow;
  4662. } else if (lp == '/search') {
  4663. curSite = DBSite.stackoverflow_search;
  4664. } else if (lp == '/tags') {
  4665. curSite = DBSite.stackoverflow_tags;
  4666. } else if (lp == '/users') {
  4667. curSite = DBSite.stackoverflow_users;
  4668. }},
  4669. pager: {
  4670. nextL: 'a[rel="next"]',
  4671. pageE: '#questions > div',
  4672. replaceE: '.pager',
  4673. scrollD: 2000
  4674. }
  4675. }, // StackOverflow - Questions
  4676. stackoverflow_tags: {
  4677. pager: {
  4678. nextL: 'a[rel="next"]',
  4679. pageE: '#tags-browser > div',
  4680. replaceE: '.pager',
  4681. scrollD: 2000
  4682. }
  4683. }, // StackOverflow - Tags
  4684. stackoverflow_users: {
  4685. pager: {
  4686. nextL: 'a[rel="next"]',
  4687. pageE: '#user-browser > div:first-child > div',
  4688. replaceE: '.pager',
  4689. scrollD: 2000
  4690. }
  4691. }, // StackOverflow - Users
  4692. stackoverflow_search: {
  4693. pager: {
  4694. nextL: 'a[rel="next"]',
  4695. pageE: '.js-search-results > div:first-child > div',
  4696. replaceE: '.pager',
  4697. scrollD: 2000
  4698. }
  4699. }, // StackOverflow - Search
  4700. segmentfault: {
  4701. host: 'segmentfault.com',
  4702. url: ()=> {locationC = true;
  4703. if (indexOF('/questions')) {
  4704. curSite = DBSite.segmentfault;
  4705. } else if (lp == '/search') {
  4706. curSite = DBSite.segmentfault_search;
  4707. }},
  4708. pager: {
  4709. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  4710. pageE: 'ul.list-group > li',
  4711. replaceE: 'ul.pagination',
  4712. scrollD: 1000
  4713. }
  4714. }, // SegmentFault - Questions
  4715. segmentfault_search: {
  4716. pager: {
  4717. nextL: 'a[rel="next"]',
  4718. pageE: '.search-result > section',
  4719. replaceE: 'ul.pagination',
  4720. scrollD: 1000
  4721. }
  4722. }, // SegmentFault - Search
  4723. w3school_com_cn: {
  4724. host: 'www.w3school.com.cn',
  4725. url: ()=> {if (location.pathname.split('/').length > 2) {curSite = DBSite.w3school_com_cn;}},
  4726. style: '#maincontent h1:not(:nth-of-type(1)) {margin-top: 30px;}',
  4727. pager: {
  4728. type: 3,
  4729. nextL: ()=> { // 过滤部分非本页的参考手册
  4730. let next = getCSS('li.next > a[href]')
  4731. if (next && next.href.indexOf('/index.') === -1) return next.href;
  4732. curSite = {SiteTypeID: 0}; return ''
  4733. },
  4734. pageE: '#maincontent > *:not([class*="prenextnav"]):not(#bpn):not(#tpn)',
  4735. insertP: ['id("bpn") | //div[contains(@class, "prenextnav")][last()]', 1],
  4736. replaceE: 'ul.prenext, #navsecond',
  4737. scrollE: 'id("bpn") | //div[contains(@class, "prenextnav")][last()]',
  4738. forceHTTPS: true,
  4739. scrollD: 600
  4740. }
  4741. }, // W3school
  4742. w3cschool_cn: {
  4743. host: 'www.w3cschool.cn',
  4744. url: ()=> {if (location.pathname.split('/').length > 2) {curSite = DBSite.w3cschool_cn;}},
  4745. style: '.widget-body, #rfbanner {display: none !important;}',
  4746. pager: {
  4747. nextL: '.next-link > a',
  4748. pageE: '#pro-mian-header, .content-bg',
  4749. replaceE: '.content-links, .splitter-sidebar',
  4750. scrollD: 1500
  4751. }
  4752. }, // W3Cschool
  4753. runoob: {
  4754. host: 'www.runoob.com',
  4755. url: ()=> {if (location.pathname.split('/').length > 2 && getCSS('#leftcolumn')) {curSite = DBSite.runoob;}},
  4756. style: '#comments, #postcomments, #respond, #footer {display: none !important;} .article-intro h1:not(:nth-of-type(1)) {margin: 30px 0 10px 0;}',
  4757. pager: {
  4758. nextL: ()=> { // 过滤部分非本页的参考手册
  4759. let next = getCSS('#leftcolumn > a[style]~a[href]')
  4760. if (next && next.href.split('/').length === location.href.split('/').length && next.href.split('/')[3] === location.href.split('/')[3]) return next.href;
  4761. next.href = location.href; curSite = {SiteTypeID: 0}; return ''
  4762. },
  4763. pageE: '#content > *, script[src*="assets/js/main.min.js"]',
  4764. insertP: ['#content', 3],
  4765. replaceE: '.previous-next-links, #leftcolumn',
  4766. scriptT: 2,
  4767. forceHTTPS: true,
  4768. scrollD: 1000
  4769. }
  4770. }, // 菜鸟教程
  4771. cnblogs: {
  4772. host: ['www.cnblogs.com', 'zzk.cnblogs.com'],
  4773. url: ()=> {
  4774. if (location.hostname === 'zzk.cnblogs.com') {
  4775. curSite = DBSite.cnblogs_search;
  4776. } else if (getCSS('#post_list')) {
  4777. curSite = DBSite.cnblogs_list;
  4778. } else if (location.pathname.split('/').length === 3 && getCSS('.topicListFooter')) {
  4779. curSite = DBSite.cnblogs;
  4780. if (!getCSS('#homepage_top_pager')) {
  4781. getCSS('.forFlow').insertAdjacentHTML(getAddTo(2), '<div id="homepage_top_pager" class="topicListFooter"></div>');
  4782. getCSS('.forFlow').insertAdjacentHTML(getAddTo(3), '<div id="homepage_bottom_pager" class="topicListFooter"></div>');
  4783. }
  4784. }
  4785. },
  4786. pager: {
  4787. nextL: '//div[@class="topicListFooter"]//a[contains(text(), "下一页")]',
  4788. pageE: 'div.day',
  4789. replaceE: '.topicListFooter',
  4790. scrollD: 1000
  4791. }
  4792. }, // 博客园 - 文章列表(个人)
  4793. cnblogs_list: {
  4794. pager: {
  4795. nextL: '//div[@class="pager"]//a[contains(text(), ">")]',
  4796. pageE: '#post_list > article',
  4797. replaceE: '.pager',
  4798. scrollD: 1000
  4799. }
  4800. }, // 博客园 - 文章列表
  4801. cnblogs_search: {
  4802. pager: {
  4803. nextL: '//div[@class="pager"]//a[contains(text(), ">")]',
  4804. pageE: 'div.searchItem',
  4805. replaceE: '.pager',
  4806. scrollD: 1000
  4807. }
  4808. }, // 博客园 - 搜索页
  4809. gitee: {
  4810. host: 'gitee.com',
  4811. url: ()=> {
  4812. if (indexOF('/explore/')) {
  4813. curSite = DBSite.gitee;
  4814. } else if (indexOF(/\/issues$/)) {
  4815. curSite = DBSite.gitee_issues;
  4816. } else if (indexOF(/\/releases/)) {
  4817. curSite = DBSite.gitee_releases;
  4818. } else if (indexOF(/\/tags/)) {
  4819. curSite = DBSite.gitee_tags;
  4820. }
  4821. if (curSite.SiteTypeID > 0 && !curSite.pager.nextL) {
  4822. curSite.pager.type = 1;
  4823. curSite.pager.nextL = 'a[rel="next"]';
  4824. curSite.pager.replaceE = '.pagination';
  4825. curSite.pager.scrollD = 2500;
  4826. }
  4827. },
  4828. pager: {
  4829. pageE: '.items > .item',
  4830. }
  4831. }, // Gitee - Explore 列表
  4832. gitee_issues: {
  4833. pager: {
  4834. pageE: '.issue-wrapper',
  4835. }
  4836. }, // Gitee - Issues 列表
  4837. gitee_releases: {
  4838. pager: {
  4839. pageE: '.release-tag-item',
  4840. }
  4841. }, // Gitee - Releases 列表
  4842. gitee_tags: {
  4843. pager: {
  4844. pageE: '.tag-item',
  4845. }
  4846. }, // Gitee - Tags 列表
  4847. gitee_search: {
  4848. host: 'search.gitee.com',
  4849. url: ()=> {if (location.search) curSite = DBSite.gitee_search;},
  4850. pager: {
  4851. nextL: 'li.next:not(.disabled) > a',
  4852. pageE: '#hits-list > div',
  4853. replaceE: 'ul.pagination',
  4854. scrollD: 1000
  4855. }
  4856. }, // Gitee - Search 列表
  4857. github: {
  4858. host: ['github.com', 'hub.fastgit.org'],
  4859. url: ()=> {locationC = true;
  4860. if (lp == '/') {
  4861. curSite = DBSite.github;
  4862. } else if (indexOF('tab=stars', 's')) {
  4863. curSite = DBSite.github_star;
  4864. } else if (indexOF('tab=repositories', 's')) {
  4865. curSite = DBSite.github_repositories;
  4866. } else if (indexOF(/\/issues$/) || indexOF(/\/pulls$/)) {
  4867. curSite = DBSite.github_issues;
  4868. } else if (indexOF(/\/discussions$/) || indexOF('/discussions/categories')) {
  4869. curSite = DBSite.github_discussions;
  4870. } else if (indexOF(/\/releases$/)) {
  4871. curSite = DBSite.github_releases;
  4872. } else if (indexOF(/\/tags$/)) {
  4873. curSite = DBSite.github_tags;
  4874. } else if (indexOF('/commits')) {
  4875. curSite = DBSite.github_commits;
  4876. } else if (indexOF('/notifications')) {
  4877. curSite = DBSite.github_notifications;
  4878. } else if (indexOF('/search')) {
  4879. if (!location.search) return
  4880. if (!indexOF('type=', 's')) {
  4881. if (lp == '/search') {
  4882. curSite = DBSite.github_search_repositories;
  4883. } else {
  4884. curSite = DBSite.github_search_code;
  4885. }
  4886. } else {
  4887. curSite = DBSite['github_search_' + /type=[a-z]+/.exec(location.search.toLowerCase())[0].replace('type=','')];
  4888. }
  4889. if (curSite.SiteTypeID > 0 && !curSite.pager.nextL) {
  4890. curSite.pager.type = 1;
  4891. curSite.pager.nextL = 'a.next_page';
  4892. curSite.pager.replaceE = '.pagination';
  4893. curSite.pager.scrollD = 3000;
  4894. }
  4895. }},
  4896. pager: {
  4897. type: 2,
  4898. nextL: '.ajax-pagination-btn',
  4899. nextText: 'More',
  4900. scrollD: 2500
  4901. }
  4902. }, // Github - 首页
  4903. github_star: {
  4904. pager: {
  4905. nextL: '//div[@class="paginate-container"]//a[contains(text(), "Next")]',
  4906. pageE: '#js-pjax-container .position-relative div[class^="col-lg-"] > div:not(.position-relative):not(.paginate-container)',
  4907. insertP: ['.paginate-container', 1],
  4908. replaceE: '.paginate-container',
  4909. scrollD: 3000
  4910. }
  4911. }, // Github - 用户 Star 列表
  4912. github_repositories: {
  4913. pager: {
  4914. nextL: '//div[@class="paginate-container"]//a[contains(text(), "Next")]',
  4915. pageE: '#user-repositories-list > ul > li',
  4916. replaceE: '.paginate-container',
  4917. scrollD: 3000
  4918. }
  4919. }, // Github - 用户 项目 列表
  4920. github_issues: {
  4921. pager: {
  4922. nextL: 'a.next_page',
  4923. pageE: '.js-navigation-container.js-active-navigation-container > div[id^="issue_"]',
  4924. replaceE: '.pagination',
  4925. scrollD: 3000
  4926. }
  4927. }, // Github - Issues 列表 / PR 列表
  4928. github_discussions: {
  4929. pager: {
  4930. nextL: 'a.next_page',
  4931. pageE: 'ul[aria-labelledby="discussions-list"] > li',
  4932. replaceE: '.pagination',
  4933. scrollD: 3000
  4934. }
  4935. }, // Github - Discussions 列表
  4936. github_releases: {
  4937. pager: {
  4938. nextL: 'a.next_page',
  4939. pageE: '#repo-content-pjax-container > div[data-pjax] > div:not(.paginate-container)',
  4940. replaceE: '.pagination',
  4941. scrollD: 3000
  4942. }
  4943. }, // Github - Releases 列表
  4944. github_tags: {
  4945. pager: {
  4946. nextL: '//div[@class="pagination"]/a[contains(text(), "Next")]',
  4947. pageE: '.Box-body > div.Box-row',
  4948. replaceE: '.pagination',
  4949. scrollD: 3000
  4950. }
  4951. }, // Github - Tags 列表
  4952. github_commits: {
  4953. pager: {
  4954. nextL: '//div[@class="paginate-container"]//a[contains(text(), "Older")]',
  4955. pageE: 'div.js-navigation-container > div',
  4956. replaceE: '.paginate-container',
  4957. scrollD: 3000
  4958. }
  4959. }, // Github - Commits 列表
  4960. github_notifications: {
  4961. pager: {
  4962. nextL: 'nav.paginate-container > a[aria-label="Next"]',
  4963. pageE: 'li.notifications-list-item',
  4964. replaceE: 'nav.paginate-container, .js-notifications-list-paginator-counts',
  4965. scrollD: 3000
  4966. }
  4967. }, // Github - Notifications 列表
  4968. github_search_repositories: {
  4969. pager: {
  4970. pageE: 'ul.repo-list > li',
  4971. }
  4972. }, //Github - Search 列表
  4973. github_search_code: {
  4974. pager: {
  4975. pageE: '.code-list-item',
  4976. }
  4977. }, // Github - Search 列表 - Code
  4978. github_search_commits: {
  4979. pager: {
  4980. pageE: '#commit_search_results > div',
  4981. }
  4982. }, // Github - Search 列表 - Commit
  4983. github_search_issues: {
  4984. pager: {
  4985. pageE: '.issue-list-item',
  4986. }
  4987. }, // Github - Search 列表 - Issues
  4988. github_search_discussions: {
  4989. pager: {
  4990. pageE: '.discussion-list-item',
  4991. }
  4992. }, // Github - Search 列表 - Discussions
  4993. github_search_registrypackages: {
  4994. pager: {
  4995. pageE: '#package_search_results > div',
  4996. }
  4997. }, // Github - Search 列表 - Package
  4998. github_search_marketplace: {
  4999. pager: {
  5000. pageE: '#marketplace_search_results > div:first-child > div',
  5001. }
  5002. }, // Github - Search 列表 - Marketplace
  5003. github_search_topics: {
  5004. pager: {
  5005. pageE: '.topic-list-item',
  5006. }
  5007. }, // Github - Search 列表 - Topics
  5008. github_search_wikis: {
  5009. pager: {
  5010. pageE: '#wiki_search_results > div:first-child > div',
  5011. }
  5012. }, // Github - Search 列表 - wiki
  5013. github_search_users: {
  5014. pager: {
  5015. pageE: '#user_search_results > div:first-child > div',
  5016. }
  5017. }, // Github - Search 列表 - user
  5018. oi_wiki: {
  5019. host: 'oi-wiki.org',
  5020. style: 'blockquote.page-copyright, h2#__comments, form#gitalk-form {display: none !important;} article.md-content__inner{min-height: 700px;}',
  5021. pager: {
  5022. nextL: 'li.md-nav__item.md-nav__item--active.md-nav__item--nested li.md-nav__item--active+li a',
  5023. pageE: 'article.md-content__inner',
  5024. insertP: ['article.md-content__inner', 6],
  5025. replaceE: '.md-sidebar.md-sidebar--primary',
  5026. scrollD: 1300
  5027. }
  5028. }, // OI Wiki
  5029. dusaiphoto: {
  5030. host: 'www.dusaiphoto.com',
  5031. url: ()=> {if (location.pathname.indexOf('/article/') > -1) {curSite = DBSite.dusaiphoto;}},
  5032. style: 'h1.article-title {margin-top: 80px;}',
  5033. pager: {
  5034. nextL: 'a.hvr-bounce-to-left',
  5035. pageE: '#main > .mt-4 >div > .mb-4, #article_body',
  5036. replaceE: '.col-12.font-title, #sidebar',
  5037. scrollD: 1500
  5038. }
  5039. }, // dusaiphoto
  5040. guokr: {
  5041. host: 'www.guokr.com',
  5042. pager: {
  5043. type: 2,
  5044. nextL: 'div[class*="LoadMoreWrap"]',
  5045. interval: 1500,
  5046. scrollD: 1500
  5047. }
  5048. }, // 果壳网
  5049. landian: {
  5050. host: 'www.landian.vip',
  5051. url: ()=> {if (lp != '/' && !indexOF('/archives/') && !indexOF('/search/')) {curSite = DBSite.landian;}},
  5052. style: '.pagination {display: none !important;}',
  5053. pager: {
  5054. nextL: ()=> getNextUPN(/(?<=\/page\/)\d+/, /\/page\/\d+/, '/page/', '', '2', getCSS('.pagination > button.end').textContent),
  5055. pageE: '.content li.color-border',
  5056. scrollD: 1500
  5057. }
  5058. }, // 蓝点网
  5059. kenengba: {
  5060. host: 'kenengba.com',
  5061. url: ()=> {if (lp == '/' || indexOF('/page/') || indexOF('/category/') || indexOF('/tag/')) {curSite = DBSite.kenengba;}},
  5062. pager: {
  5063. nextL: '//div[@class="pagebar"]/a[@href and text()=">>"]',
  5064. pageE: 'article.post',
  5065. replaceE: '.pagebar',
  5066. scrollD: 3000
  5067. }
  5068. }, // 可能吧
  5069. expreview: {
  5070. host: 'www.expreview.com',
  5071. pager: {
  5072. type: 2,
  5073. nextL: '#show_article_red_1SHOW',
  5074. interval: 1500,
  5075. scrollD: 1500
  5076. }
  5077. }, // 超能网
  5078. ithome: {
  5079. host: 'www.ithome.com',
  5080. pager: {
  5081. type: 2,
  5082. nextL: 'a.more',
  5083. interval: 1500,
  5084. scrollD: 1500
  5085. }
  5086. }, // IT之家
  5087. _36kr: {
  5088. host: ['36kr.com', 'www.36kr.com'],
  5089. url: ()=> {if (lp != '/' && !indexOF('/p/') && !indexOF('/newsflashes/')) {curSite = DBSite._36kr;}},
  5090. pager: {
  5091. type: 2,
  5092. nextL: '.kr-loading-more-button.show',
  5093. nextText: '查看更多',
  5094. scrollD: 1500
  5095. }
  5096. }, // 36氪
  5097. _36kr_m: {
  5098. host: 'm.36kr.com',
  5099. pager: {
  5100. type: 2,
  5101. nextL: '.kr-loading-more-button-default',
  5102. nextText: '查看更多',
  5103. scrollD: 1500
  5104. }
  5105. }, // 36氪 - 手机版
  5106. sciencealert: {
  5107. host: 'www.sciencealert.com',
  5108. pager: {
  5109. type: 2,
  5110. nextL: '.load-more',
  5111. nextTextOf: 'LOAD MORE',
  5112. scrollD: 2000
  5113. }
  5114. }, // ScienceAlert
  5115. zhutix: {
  5116. host: 'zhutix.com',
  5117. url: ()=> {if (getCSS('#post-list')) {
  5118. curSite = DBSite.zhutix;
  5119. } else {
  5120. curSite = DBSite.zhutix_list;
  5121. }},
  5122. pager: {
  5123. nextL: '//li[@class="next-page"]/a | //div[@class="btn-pager"]/a[contains(text(), "❯")]',
  5124. pageE: '#post-list > ul > li',
  5125. replaceE: '.pagination, .b2-pagenav.post-nav',
  5126. scrollD: 1500
  5127. }
  5128. }, // 致美化
  5129. zhutix_list: {
  5130. pager: {
  5131. nextL: 'li.next-page a',
  5132. pageE: '#primary-home > div:not(.pagination)',
  5133. replaceE: '.pagination',
  5134. scrollD: 1500
  5135. }
  5136. }, // 致美化 - 文章列表
  5137. lanzou: {
  5138. host: /\.lanzou[a-z]\./,
  5139. hiddenPN: true,
  5140. pager: {
  5141. type: 2,
  5142. nextL: '#filemore',
  5143. nextTextOf: '更多',
  5144. isHidden: true,
  5145. scrollD: 800
  5146. }
  5147. }, // 蓝奏云 - 分享链接列表
  5148. lanzou_: {
  5149. host: 'pc.woozooo.com',
  5150. iframe: true,
  5151. hiddenPN: true,
  5152. pager: {
  5153. type: 2,
  5154. nextL: '#filemore > span[onclick]',
  5155. nextText: '显示更多文件',
  5156. isHidden: true,
  5157. scrollD: 800
  5158. }
  5159. }, // 蓝奏云 - 后台
  5160. alipanso: {
  5161. host: 'www.alipanso.com',
  5162. url: ()=> {if (lp == '/search.html') {curSite = DBSite.alipanso;}},
  5163. style: '.pager-wrap {display: none !important;}',
  5164. pager: {
  5165. nextL: ()=> getNextUP('page=', /page=\d+/),
  5166. pageE: '#res_list > div',
  5167. scrollD: 2000
  5168. }
  5169. }, // 阿里盘搜
  5170. wikihow: {
  5171. host: ['www.wikihow.com', 'zh.wikihow.com'],
  5172. url: ()=> {if (indexOF('/Category:')) {
  5173. curSite = DBSite.wikihow;
  5174. } else if (indexOF('/wikiHowTo') && indexOF('?search=', 's')) {
  5175. curSite = DBSite.wikihow_search;
  5176. }},
  5177. pager: {
  5178. nextL: 'a.pag_next',
  5179. pageE: '#cat_all > .cat_grid > div',
  5180. replaceE: '#large_pagination',
  5181. scriptT: 3,
  5182. scrollD: 2000
  5183. }
  5184. }, // 指南
  5185. wikihow_search: {
  5186. pager: {
  5187. nextL: '#searchresults_footer > a.buttonright',
  5188. pageE: '#searchresults_list > a',
  5189. replaceE: '#searchresults_footer',
  5190. scrollD: 3000
  5191. }
  5192. }, // 指南 - 搜索页
  5193. afreecatv: {
  5194. host: 'www.afreecatv.com',
  5195. pager: {
  5196. type: 2,
  5197. nextL: '.btn-more > button',
  5198. interval: 2000,
  5199. scrollD: 1000
  5200. }
  5201. }, // 直播
  5202. greasyfork: {
  5203. host: 'greasyfork.org',
  5204. url: ()=> {if (indexOF(/\/scripts$/) || indexOF('/scripts/by-site/')) {
  5205. curSite = DBSite.greasyfork;
  5206. } else if (indexOF(/\/feedback$/)) {
  5207. curSite = DBSite.greasyfork_feedback;
  5208. } else if (indexOF('/discussions') && !indexOF(/\/\d+/)) {
  5209. curSite = DBSite.greasyfork_discussions;
  5210. }},
  5211. pager: {
  5212. nextL: 'a.next_page',
  5213. pageE: 'ol#browse-script-list > li',
  5214. replaceE: '.pagination',
  5215. scrollD: 1300
  5216. }
  5217. }, // GreasyFork
  5218. greasyfork_feedback: {
  5219. pager: {
  5220. nextL: 'a.next_page',
  5221. pageE: '.script-discussion-list > div',
  5222. replaceE: '.pagination',
  5223. scrollD: 1800
  5224. }
  5225. }, // GreasyFork - 反馈页
  5226. greasyfork_discussions: {
  5227. pager: {
  5228. nextL: 'a.next_page',
  5229. pageE: '.discussion-list > div',
  5230. replaceE: '.pagination',
  5231. scrollD: 1300
  5232. }
  5233. }, // GreasyFork - 讨论页
  5234. userscript: {
  5235. host: 'www.userscript.zone',
  5236. url: ()=> {if (lp == '/search') {curSite = DBSite.userscript;}},
  5237. pager: {
  5238. nextL: ()=> getNextF('.next > form'),
  5239. pageE: '.row.script',
  5240. replaceE: '.pagination',
  5241. scrollD: 1000
  5242. }
  5243. }, // UserScript
  5244. userstyles: {
  5245. host: 'userstyles.world',
  5246. url: ()=> {if (lp == '/explore') {curSite = DBSite.userstyles;}},
  5247. pager: {
  5248. nextL: 'a.Pagination-button.next',
  5249. pageE: '.card',
  5250. replaceE: '.Pagination',
  5251. scrollD: 1500
  5252. }
  5253. }, // UserStyles
  5254. getquicker: {
  5255. host: 'getquicker.net',
  5256. url: '/\\/Share\\//',
  5257. pager: {
  5258. nextL: '//a[@class="page-link" and text()="下一页"]',
  5259. pageE: 'table.table > tbody > tr:not(:first-child), script[src^="/js/site.js"]',
  5260. insertP: ['table.table > tbody', 3],
  5261. replaceE: 'ul.pagination',
  5262. scriptT: 2,
  5263. scrollD: 1000
  5264. }
  5265. }, // Quicker
  5266. xposed: {
  5267. host: 'repo.xposed.info',
  5268. url: '/\/module-overview/',
  5269. pager: {
  5270. nextL: 'li.pager-next > a',
  5271. pageE: '.view-content > table > tbody > tr',
  5272. replaceE: 'ul.pager',
  5273. scrollD: 1500
  5274. }
  5275. }, // Xposed
  5276. bookmarkearth: {
  5277. host: 'www.bookmarkearth.com',
  5278. url: ()=> {if (lp == '/' || lp == '/page') {
  5279. curSite = DBSite.bookmarkearth;
  5280. } else if (lp == '/s/search') {
  5281. curSite = DBSite.bookmarkearth_search;
  5282. }},
  5283. pager: {
  5284. nextL: ()=> getNextUP('currentPage=', /currentPage=\d+/, '/page', '2', getCSS('ul.pager').dataset.totalpage),
  5285. pageE: '.document-piece',
  5286. replaceE: 'ul.pager',
  5287. scrollD: 1000
  5288. }
  5289. }, // 书签地球
  5290. bookmarkearth_search: {
  5291. pager: {
  5292. nextL: ()=> getNextEP('a.cut-page-item.active+a.cut-page-item', 'currentPage=', /currentPage=\d+/),
  5293. pageE: '.document-piece',
  5294. replaceE: '.cut-page',
  5295. scrollD: 1000
  5296. }
  5297. }, // 书签地球 - 搜索页
  5298. smzdm: {
  5299. host: ['www.smzdm.com', 'search.smzdm.com'],
  5300. url: ()=> {if (location.hostname === 'search.smzdm.com' || indexOF('/fenlei/') || indexOF(/\/mall\/.+\/.+/)) {curSite = DBSite.smzdm;}},
  5301. pager: {
  5302. nextL: '//ul[@class="pagenation-list"]//a[contains(text() ,"下一页")] | //ul[@class="pagenation-list"]/li[contains(@class, "next-page")]/a',
  5303. pageE: '#feed-main-list > li',
  5304. replaceE: 'ul.pagenation-list',
  5305. scrollD: 1500
  5306. }
  5307. }, // 什么值得买 - 分类/搜索页
  5308. meidebi: {
  5309. host: 'www.meidebi.com',
  5310. url: ()=> {if (indexOF('/fenlei/') || lp == '/Search') {
  5311. curSite = DBSite.meidebi;
  5312. }},
  5313. pager: {
  5314. nextL: 'a.next',
  5315. pageE: '.share-list > ul > li',
  5316. replaceE: '.h-pages',
  5317. scrollD: 1500
  5318. }
  5319. }, // 没得比 - 分类/搜索页
  5320. netbian: {
  5321. host: 'pic.netbian.com',
  5322. style: 'li.nextpage {display: none !important;}',
  5323. pager: {
  5324. nextL: '//div[@class="page"]/a[contains(text(),"下一页")]',
  5325. pageE: '.slist ul > li:not(.nextpage)',
  5326. replaceE: '.page',
  5327. scrollD: 1000
  5328. }
  5329. }, // 彼岸图网
  5330. ioliu: {
  5331. host: 'bing.ioliu.cn',
  5332. url: ()=> {if (!indexOF('/photo/') && !indexOF('.html')) {curSite = DBSite.ioliu; document.head.appendChild(document.createElement('base')).target = '_blank';}},
  5333. style: '.progressive--not-loaded {filter: none !important;}',
  5334. pager: {
  5335. nextL: '//div[@class="page"]/a[contains(text(), "下一页")]',
  5336. pageE: 'body > .container > div.item',
  5337. replaceE: '.page',
  5338. scrollD: 1000
  5339. }
  5340. }, // 必应壁纸
  5341. konachan: {
  5342. host: 'konachan.net',
  5343. url: ()=> {if (indexOF('/post')) {curSite = DBSite.konachan; document.head.appendChild(document.createElement('base')).target = '_blank';}},
  5344. style: 'html, body {min-height: 1000px;} .javascript-hide {display: inline-block !important;} ul#post-list-posts img, ul#post-list-posts .inner{width: auto !important; height: auto !important;} ul#post-list-posts li {width: 33% !important;} a.directlink {margin: 0 !important;}',
  5345. pager: {
  5346. nextL: 'a.next_page',
  5347. pageE: 'ul#post-list-posts > li',
  5348. replaceE: '#paginator',
  5349. scrollD: 1000
  5350. }
  5351. }, // 动漫壁纸
  5352. nastol: {
  5353. host: 'www.nastol.com.ua',
  5354. pager: {
  5355. nextL: '//a[./span[@class="nav-next"]]',
  5356. pageE: '#dle-content > div',
  5357. replaceE: '.navigation',
  5358. scrollD: 1000
  5359. }
  5360. }, // 壁纸
  5361. hdqwalls: {
  5362. host: 'hdqwalls.com',
  5363. pager: {
  5364. nextL: 'a#next',
  5365. pageE: '.wallpapers_container > div.wall-resp',
  5366. replaceE: 'ul.pagination',
  5367. scrollD: 1000
  5368. }
  5369. }, // 壁纸
  5370. xinpianchang: {
  5371. host: 'www.xinpianchang.com',
  5372. style: '.lazy-img {opacity: 1 !important;}',
  5373. pager: {
  5374. nextL: '.page > a[title="下一页"]',
  5375. pageE: 'div[class*="-container"] div[class*="-con"] > ul > li, div[class*="-container"] div[class*="-con"] > div[class*="-wrap"] > ul > li',
  5376. insertP: ['div[class*="-container"] div[class*="-con"] > ul, div[class*="-container"] div[class*="-con"] > div[class*="-wrap"] > ul', 3],
  5377. replaceE: '.page',
  5378. scrollD: 2000
  5379. },
  5380. function: {
  5381. bF: src_bF,
  5382. bFp: [0, 'img[_src]', '_src']
  5383. }
  5384. }, // 新片场
  5385. planetminecraft: {
  5386. host: 'www.planetminecraft.com',
  5387. url: ()=> {if (!indexOF('/forums/') && !indexOF('/posts/')) {curSite = DBSite.planetminecraft;}},
  5388. style: '.resource .r-preview>a img[loading=lazy]:not(.lazyloaded) {visibility: initial !important;}',
  5389. pager: {
  5390. nextL: 'a.pagination_next',
  5391. pageE: '.resource_block > ul.resource_list > li',
  5392. replaceE: '.pagination',
  5393. scrollD: 3000
  5394. }
  5395. }, // Planet Minecraft
  5396. cadtutor: {
  5397. host: 'www.cadtutor.net',
  5398. url: ()=> {
  5399. if (indexOF('/forum/forum/')) {
  5400. curSite = DBSite.cadtutor;
  5401. } else if (indexOF('/forum/topic/')) {
  5402. curSite = DBSite.cadtutor_post;
  5403. } else if (indexOF('/forum/search/')) {
  5404. curSite = DBSite.cadtutor_search;
  5405. }},
  5406. pager: {
  5407. nextL: 'a[rel="next"]',
  5408. pageE: 'ol.ipsDataList > li:not([data-rowid])~li',
  5409. replaceE: 'ul.ipsPagination',
  5410. scrollD: 2000
  5411. }
  5412. }, // CADTutor - 列表页
  5413. cadtutor_post: {
  5414. thread: true,
  5415. pager: {
  5416. nextL: 'a[rel="next"]',
  5417. pageE: '#elPostFeed > form > *:not(input):not(.after-first-post)',
  5418. replaceE: 'ul.ipsPagination',
  5419. scrollD: 2000
  5420. }
  5421. }, // CADTutor - 帖子内
  5422. cadtutor_search: {
  5423. pager: {
  5424. nextL: 'a[rel="next"]',
  5425. pageE: 'ol.ipsStream > li',
  5426. replaceE: 'ul.ipsPagination',
  5427. scrollD: 2000
  5428. }
  5429. }, // CADTutor - 搜索页
  5430. theswamp: {
  5431. host: 'www.theswamp.org',
  5432. url: ()=> {
  5433. if (!location.search) return
  5434. if (indexOF('board=', 's')) {
  5435. curSite = DBSite.theswamp;
  5436. } else if (indexOF('topic=', 's')) {
  5437. curSite = DBSite.theswamp_post;
  5438. }},
  5439. pager: {
  5440. nextL: '.pagelinks > strong+a',
  5441. pageE: '#messageindex tbody > tr:not([class])',
  5442. replaceE: '.pagelinks',
  5443. scrollD: 2000
  5444. }
  5445. }, // TheSwamp - 列表页
  5446. theswamp_post: {
  5447. thread: true,
  5448. pager: {
  5449. nextL: '.pagelinks > strong+a',
  5450. pageE: '#forumposts form > *',
  5451. replaceE: '.pagelinks',
  5452. scrollD: 2000
  5453. }
  5454. } // TheSwamp - 帖子内
  5455. };
  5456. // 向后兼容
  5457. if (JSON.stringify(GM_getValue('menu_customRules', {})).indexOf('functionS') > -1 || JSON.stringify(GM_getValue('menu_customRules', {})).indexOf('css;') > -1) { // 改名过渡,过段时间将其移除
  5458. GM_setValue('menu_customRules', JSON.parse(JSON.stringify(GM_getValue('menu_customRules', {})).replaceAll('functionS', 'url').replaceAll('css;', '')))
  5459. }
  5460. //console.log(GM_getValue('menu_customRules'), GM_getValue('menu_rules'))
  5461. // 合并 自定义规则、外置规则、内置规则
  5462. DBSite = Object.assign(GM_getValue('menu_customRules', {}), GM_getValue('menu_rules', {}), DBSite)
  5463. // 生成 SiteTypeID
  5464. setSiteTypeID();
  5465. //console.log(DBSite)
  5466. // 用于脚本判断(针对部分特殊的网站)
  5467. SiteType = {
  5468. BAIDU_TIEBA: DBSite.baidu_tieba.SiteTypeID
  5469. };
  5470. }
  5471. // 获取外置翻页规则
  5472. function getRulesUrl(update = false) {
  5473. if (GM_getValue('menu_ruleUpdateTime') == null) update = true
  5474. if (update) GM_setValue('menu_ruleUpdateTime', '1970/1/1');
  5475. //console.log(new Date().getTime());
  5476. let timeNow = new Date().getFullYear() + '/' + (new Date().getMonth() + 1) + '/' + new Date().getDate(),
  5477. timeOld = GM_getValue('menu_ruleUpdateTime');
  5478. if (!timeOld || timeOld != timeNow) { // 是新的一天
  5479. GM_setValue('menu_ruleUpdateTime', timeNow); // 写入时间以供后续比较
  5480.  
  5481. GM_xmlhttpRequest({
  5482. url: 'https://userscript.xiu2.xyz/other/Autopage/rules.json',
  5483. method: 'GET',
  5484. responseType: 'json',
  5485. overrideMimeType: 'application/json; charset=utf-8',
  5486. timeout: 5000,
  5487. onload: function (response) {
  5488. try {
  5489. //console.log('最终 URL:' + response.finalUrl, '返回内容:',response.response)
  5490. if (response.response) {
  5491. GM_setValue('menu_rules', response.response);
  5492. if (update) {
  5493. curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  5494. registerMenuCommand(); // 重新判断规则
  5495. //console.log(new Date().getTime());
  5496. //console.log(curSite);
  5497. if (curSite.style) {insStyle(curSite.style)} // 插入 Style CSS 样式
  5498. curSite.pageUrl = ''; // 下一页URL
  5499. pageLoading(); // 自动无缝翻页
  5500.  
  5501. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  5502. pausePageEvent(); // 左键双击网页空白处暂停翻页
  5503. GM_notification({text: '✅ 已更新外置翻页规则!如果依然无法翻页,则说明还不支持,欢迎提交申请~', timeout: 5000});
  5504. }
  5505. } else {
  5506. GM_notification({text: '❌ 更新失败,请联系作者解决...', timeout: 5000});
  5507. }
  5508. } catch (e) {
  5509. console.log(e);
  5510. GM_notification({text: '❌ 更新失败,请联系作者解决...', timeout: 5000});
  5511. }
  5512. }
  5513. })
  5514. }
  5515. }
  5516.  
  5517.  
  5518. // --------------------------------------------------------
  5519.  
  5520.  
  5521. // 判断网站类型
  5522. webTypeIf();
  5523.  
  5524. // 帖子内自动翻页判断
  5525. if (!GM_getValue('menu_thread')) {
  5526. if (curSite.thread) {curSite = {SiteTypeID: 0}; pageNum.now = 1;}
  5527. }
  5528.  
  5529. //console.log(curSite)
  5530. // 显示页码
  5531. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');}
  5532. // 左键双击网页空白处暂停翻页
  5533. pausePageEvent();
  5534. // 强制新标签页打开链接(翻页模式 5/6)
  5535. if (curSite.forceTarget) forceTarget();
  5536.  
  5537. // 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则
  5538. if (locationC) {
  5539. nowLocation = location.href
  5540. if (window.onurlchange === undefined) {addUrlChangeEvent();} // Tampermonkey v4.11 版本添加的 onurlchange 事件 grant,可以监控 pjax 等网页的 URL 变化
  5541. if (webType === 1) {
  5542. window.addEventListener('urlchange', function(){
  5543. lp = location.pathname;
  5544. //console.log(nowLocation, location.href)
  5545. if (curSite.history !== false && window.top.document.xiu_nowUrl === location.href) {nowLocation = location.href; return}
  5546. if (nowLocation == location.href) return
  5547. if (curSite.pager && curSite.pager.type == 5) {
  5548. if (self != top) {window.top.location.href = location.href;} else {if (getCSS('iframe#xiu_iframe')) {getCSS('iframe#xiu_iframe').remove();}}
  5549. pausePage = true;
  5550. } // 对于翻页模式 5,如果是 iframe 框架内 URL 变动,则升级为顶级页面,如果是顶级页面的 URL 变动,则清理 iframe 框架
  5551. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  5552. registerMenuCommand(); // 重新判断规则
  5553. //console.log(curSite);
  5554. if (curSite.style) {insStyle(curSite.style)} // 插入 Style CSS 样式
  5555. // 帖子内自动翻页判断
  5556. if (!GM_getValue('menu_thread')) {
  5557. if (curSite.thread) {curSite = {SiteTypeID: 0}; pageNum.now = 1;}
  5558. }
  5559. curSite.pageUrl = ''; // 下一页URL
  5560. pageLoading(); // 自动无缝翻页
  5561.  
  5562. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  5563. pausePageEvent(); // 左键双击网页空白处暂停翻页
  5564. })
  5565. } else if (webType === 2) {
  5566. window.addEventListener('urlchange', function(){
  5567. lp = location.pathname;
  5568. //console.log(nowLocation, location.href)
  5569. if (nowLocation == location.href) return
  5570. setTimeout(function(){
  5571. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  5572. discuz_(); // 重新判断规则
  5573.  
  5574. // 帖子内自动翻页判断
  5575. if (!GM_getValue('menu_thread')) {
  5576. if (curSite.thread) {curSite = {SiteTypeID: 0}; pageNum.now = 1;}
  5577. }
  5578.  
  5579. if (curSite.style) {insStyle(curSite.style)} // 插入 Style CSS 样式
  5580. curSite.pageUrl = ''; // 下一页URL
  5581. pageLoading(); // 自动无缝翻页
  5582.  
  5583. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  5584. pausePageEvent(); // 左键双击网页空白处暂停翻页
  5585. }, 500)
  5586. })
  5587. } else if (webType === 3) {
  5588. window.addEventListener('urlchange', function(){
  5589. lp = location.pathname;
  5590. if (nowLocation == location.href) return
  5591. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  5592. DBSite.flarum.url(); // 重新判断规则
  5593. if (curSite.style) {insStyle(curSite.style)} // 插入 Style CSS 样式
  5594. pageLoading(); // 自动无缝翻页
  5595.  
  5596. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  5597. pausePageEvent(); // 左键双击网页空白处暂停翻页
  5598. })
  5599. }
  5600. }
  5601. // 插入 Style CSS 样式
  5602. if (curSite.style) insStyle(curSite.style)
  5603.  
  5604. // 对翻页模式 5 的子 iframe 添加一个跟随滚动的事件
  5605. if (curSite.pager && curSite.pager.type === 5 && self != top) {
  5606. var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop
  5607. window.addEventListener('scroll', function (e) {
  5608. let scrollTop = window.parent.document.documentElement.scrollTop || window.parent.document.body.scrollTop,
  5609. clientHeight = window.parent.document.documentElement.clientHeight || window.parent.document.body.clientHeight,
  5610. scrollHeight = window.parent.document.documentElement.scrollHeight || window.parent.document.body.scrollHeight,
  5611. afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  5612. delta = afterScrollTop - beforeScrollTop;
  5613. if (delta == 0) return false;
  5614. beforeScrollTop = afterScrollTop;
  5615. //console.log(delta, scrollHeight - (scrollTop + clientHeight), '2222')
  5616. if (delta > 0 && scrollTop + clientHeight < scrollHeight) {
  5617. window.parent.scrollBy(0, delta*2);
  5618. }
  5619. }, false);
  5620. }
  5621.  
  5622. // 下一页URL
  5623. curSite.pageUrl = '';
  5624. // 自动无缝翻页
  5625. pageLoading();
  5626.  
  5627.  
  5628. // --------------------------------------------------------
  5629.  
  5630.  
  5631. // [Discuz! 论坛] 判断各版块帖子列表类型
  5632. function discuzForum(m) {
  5633. if (m == 'm') { // 手机版页面
  5634. if (getCSS('a.loadmore')) {
  5635. curSite = DBSite.discuz_m_forum;
  5636. } else if (getCSS('.threadlist')) {
  5637. curSite = DBSite.discuz_m; curSite.pager.pageE = '.threadlist > ul > li';
  5638. } else if (getCSS('[id^="normalthread_"]')) {
  5639. curSite = DBSite.discuz_m; curSite.pager.pageE = '[id^="normalthread_"]:not(.ZDlist)';
  5640. }
  5641. if (curSite.SiteTypeID !== 0 && location.hostname === 'keylol.com') {curSite.history = false; locationC = true;}
  5642. } else {
  5643. if (getCSS('#autopbn')) { // 判断是否有 [下一页] 按钮
  5644. curSite = DBSite.discuz_forum;
  5645. } else if (getCSS('#waterfall')) { // 判断是否为图片模式
  5646. if (!getCSS('#pgbtn, .pgbtn')) { // 如果各版块帖子列表已存在这个元素,说明自带了无缝翻页
  5647. curSite = DBSite.discuz_waterfall; waterfallStyle(); // 图片模式列表样式预处理
  5648. }
  5649. } else {
  5650. curSite = DBSite.discuz_guide;
  5651. }
  5652. }
  5653. }
  5654. // [Discuz! 论坛] 判断手机版帖子内
  5655. function discuzThreadM() {
  5656. if (getCSS('[id^="pid"]')) {
  5657. curSite = DBSite.discuz_m; curSite.pager.pageE = '[id^="pid"], [id^="pid"]+div:not([id="post_new"])'
  5658. } else if (getCSS('[id^="post_"]')) {
  5659. curSite = DBSite.discuz_m; curSite.pager.pageE = '[id^="post_"]';
  5660. }
  5661. if (curSite.SiteTypeID !== 0 && location.hostname === 'keylol.com') {curSite.history = false; locationC = true;}
  5662. }
  5663. function discuz_() {
  5664. if (getCSS('body[id="nv_forum"][class^="pg_"][onkeydown*="27"]')) {
  5665. switch (getCSS('body[id="nv_forum"][class^="pg_"][onkeydown*="27"]').className) {
  5666. case 'pg_forumdisplay': // < 各版块帖子列表 >
  5667. discuzForum(); break;
  5668. case 'pg_viewthread': // < 帖子内 >
  5669. curSite = DBSite.discuz_thread; break;
  5670. case 'pg_guide': // < 导读帖子列表等 >
  5671. curSite = DBSite.discuz_guide; break;
  5672. case 'pg_collection': // < 淘贴列表 >
  5673. curSite = DBSite.discuz_collection; break;
  5674. }
  5675. }
  5676. // 如果上面没有匹配的则继续 < 搜索结果 >
  5677. if (curSite.SiteTypeID === 0) {
  5678. if (indexOF('search') || getCSS('body[id="nv_search"][onkeydown*="27"]')) {
  5679. if (indexOF('mobile=2', 's')) { // 手机版页面
  5680. curSite = DBSite.discuz_m; curSite.pager.pageE = '.threadlist > ul > li'; locationC = true;
  5681. } else {
  5682. curSite = DBSite.discuz_search;
  5683. }
  5684. }
  5685. }
  5686. // 如果上面没有匹配的则继续
  5687. if (curSite.SiteTypeID === 0) {
  5688. if (indexOF('.html')) { // 判断是不是静态网页(.html 结尾)
  5689. if (indexOF('/forum-')) { // < 各版块帖子列表 >
  5690. if (getXpath('//head/meta[@name="applicable-device" and @content="mobile"] | //head/title[contains(text(), "手机版")] | //head/link[contains(@href, "/mobile/")] | //head/script[contains(@src, "/mobile/")]')) { // 手机版页面
  5691. discuzForum('m');
  5692. } else {
  5693. discuzForum();
  5694. }
  5695. } else if (indexOF('/thread-')) { // < 帖子内 >
  5696. if (getXpath('//head/meta[@name="applicable-device" and @content="mobile"] | //head/title[contains(text(), "手机版")] | //head/link[contains(@href, "/mobile/")] | //head/script[contains(@src, "/mobile/")]')) { // 手机版页面
  5697. discuzThreadM();
  5698. } else {
  5699. curSite = DBSite.discuz_thread;
  5700. }
  5701. }
  5702. }
  5703. }
  5704. // 如果上面没有匹配的则继续
  5705. if (curSite.SiteTypeID === 0) {
  5706. if (indexOF('mod=forumdisplay', 's') || indexOF('forumdisplay.php')) { // < 各版块帖子列表 >
  5707. if (indexOF('mobile=2', 's') || indexOF('mobile=yes', 's') || getXpath('//head/meta[@name="applicable-device" and @content="mobile"] | //head/title[contains(text(), "手机版")] | //head/link[contains(@href, "/mobile/")] | //head/script[contains(@src, "/mobile/")]')) { // 手机版页面
  5708. discuzForum('m');
  5709. } else {
  5710. discuzForum();
  5711. }
  5712. } else if (indexOF('mod=viewthread', 's') || indexOF('viewthread.php')) { // < 帖子内 >
  5713. if (indexOF('mobile=2', 's') || getXpath('//head/meta[@name="applicable-device" and @content="mobile"] | //head/title[contains(text(), "手机版")] | //head/link[contains(@href, "/mobile/")] | //head/script[contains(@src, "/mobile/")]')) { // 手机版页面
  5714. discuzThreadM();
  5715. } else {
  5716. curSite = DBSite.discuz_thread;
  5717. }
  5718. } else if (indexOF('mod=guide', 's')) { // < 导读帖子列表 >
  5719. curSite = DBSite.discuz_guide;
  5720. } else if(indexOF('mod=space', 's') && indexOF('do=thread', 's')) { // 别人的主题/回复
  5721. curSite = DBSite.discuz_youspace;
  5722. } else if (indexOF('mod=collection', 's')) { // < 淘贴列表 >
  5723. curSite = DBSite.discuz_collection;
  5724. } else if (getCSS('#threadlist')) { // < 部分论坛的各板块 URL 是自定义的 >
  5725. discuzForum();
  5726. } else if (getCSS('#postlist')) { // < 部分论坛的帖子内 URL 是自定义的 >
  5727. curSite = DBSite.discuz_thread;
  5728. } else { // 手机版判断
  5729. discuzForum('m');
  5730. if (curSite.SiteTypeID === 0) discuzThreadM();
  5731. }
  5732. }
  5733. }
  5734. // [Discuz! 论坛] 图片模式列表样式预处理
  5735. function waterfallStyle() {
  5736. let width = getCSS('#waterfall > li:first-child').style.width;
  5737. if (width) 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;}`);
  5738. }
  5739.  
  5740.  
  5741. // [谷歌搜索] 的插入前函数(加载视频图片)
  5742. function google_bF(pageElems) {
  5743. if (!indexOF('tbm=nws', 's')){
  5744. pageElems.forEach(function (one) {
  5745. getAllCSS('a[aria-label][href*="https://www.youtube.com/watch?v="]').forEach(function (one1) {
  5746. let img = getCSS('img', one1)
  5747. if (img) img.src = `https://i.ytimg.com/vi/${one1.href.split('?v=')[1]}/mqdefault.jpg`
  5748. })
  5749. });
  5750. }
  5751. return pageElems
  5752. }
  5753.  
  5754.  
  5755. // [必应搜索] 的插入前函数(加载网站图标)
  5756. function bing_bF(pageElems) {
  5757. if (!getCSS('.b_title > a.sh_favicon')) {
  5758. insStyle('.b_title > a.sh_favicon {display: none !important;}');
  5759. delete curSite.function
  5760. //console.log(curSite)
  5761. return pageElems
  5762. }
  5763. pageElems.forEach(function (one) {
  5764. getAllCSS('div.rms_iac[data-src]').forEach(function (one1) {
  5765. one1.outerHTML = `<img src="${one1.dataset.src}" height="16" width="16" alt="全球 Web 图标" role="presentation" class="rms_img">`;
  5766. })
  5767. });
  5768. return pageElems
  5769. }
  5770.  
  5771.  
  5772. // [百度贴吧](发帖按钮点击事件)
  5773. function baidu_tieba_1() {
  5774. let button = getCSS('.tbui_aside_fbar_button.tbui_fbar_post > a');
  5775. if (button) {
  5776. button.remove();
  5777. getCSS('li.tbui_aside_fbar_button.tbui_fbar_down').insertAdjacentHTML(getAddTo(4), '<li class="tbui_aside_fbar_button tbui_fbar_post"><a href="javascript:void(0);" title="因为 [自动无缝翻页] 的原因,请点击该按钮发帖!"></a></li>')
  5778. button = getCSS('.tbui_aside_fbar_button.tbui_fbar_post > a');
  5779. if (button) {
  5780. button.onclick = function(){
  5781. let button2 = getCSS('div.edui-btn.edui-btn-fullscreen.edui-btn-name-portrait');
  5782. if (button2) {button2.click();} else {alert('提示:登录后才能发帖!');}
  5783. return false;
  5784. }
  5785. }
  5786. }
  5787. }
  5788. // [百度贴吧] 插入数据
  5789. function baidu_tieba_insertE(pageElems, type) {
  5790. if (!pageElems) return
  5791. // 获取 <script> 内容
  5792. const scriptElems = getXpath(`//script[contains(text(), 'Bigpipe.register("frs-list/pagelet/thread_list", ')]`, pageElems, pageElems);
  5793. if (scriptElems) {
  5794. // 从 <script> 中提取帖子列表字符串
  5795. let scriptText = scriptElems.textContent.replace('Bigpipe.register("frs-list/pagelet/thread_list", ','');
  5796. scriptText = scriptText.slice(0, scriptText.indexOf(').'));
  5797. // 字符串转 Element 元素
  5798. let temp_baidu_tieba = document.createElement('div'); temp_baidu_tieba.innerHTML = JSON.parse(scriptText).content;
  5799. processElems(temp_baidu_tieba);
  5800. }
  5801. }
  5802.  
  5803.  
  5804. // [V2EX] 的插入后函数(新标签页打开链接)
  5805. function v2ex_aF(css) {
  5806. let links = getAllCSS(css);if (!links) return
  5807. links.forEach(function (_this) {_this.target = '_blank';});
  5808. }
  5809.  
  5810.  
  5811. // [NexusMods] 获取下一页地址
  5812. function nexusmods_nextL() {
  5813. if (getCSS('.nexus-ui-blocker')) return
  5814. let modList;
  5815. if (indexOF('/news')) {modList = RH_NewsTabContent;} else {modList = RH_ModList;}
  5816. if (!modList) return
  5817. let out_items = JSON.stringify(modList.out_items).replace(/{|}|"/g,''),
  5818. nextNum = getXpath('//div[contains(@class, "pagenav")][1]//a[contains(@class, "page-selected")]/parent::li/following-sibling::li/a'),
  5819. categories = modList.out_items.categories, categoriesUrl = '';
  5820. var url = '';
  5821. if (nextNum && nextNum.innerText) {
  5822. nextNum = nextNum.innerText;
  5823. if (out_items.indexOf('page:') > -1) {
  5824. out_items = out_items.replace(/page:\d+/, `page:${nextNum}`)
  5825. } else {
  5826. out_items += `,page:${nextNum}`;
  5827. }
  5828. if (categories && categories != []) {
  5829. for (let i = 0; i < categories.length; i++) {
  5830. categoriesUrl += `,categories[]:${categories[i]}`
  5831. }
  5832. categoriesUrl = categoriesUrl.replace(/,/,'');
  5833. if (out_items.indexOf('categories:') > -1) {
  5834. out_items = out_items.replace(/categories:\[.*\]/, categoriesUrl)
  5835. }
  5836. }
  5837. return `https://www.nexusmods.com${modList.uri}?RH_${modList.id}=${out_items}`
  5838. }
  5839. return ''
  5840. }
  5841. // [NexusMods] 的插入前函数(隐藏底部元素)
  5842. function nexusmods_bF(pageElems) {
  5843. pageElems.forEach(function (one) {
  5844. let now = one.querySelector('.mod-tile-left');
  5845. if (now) {
  5846. let downloadCount = now.querySelector('.downloadcount > span.flex-label');
  5847. if (downloadCount) {
  5848. if (GlobalModStats[now.dataset.gameId] && GlobalModStats[now.dataset.gameId][now.dataset.modId]) {
  5849. downloadCount.textContent = shortFormat(parseInt(GlobalModStats[now.dataset.gameId][now.dataset.modId].total));
  5850. }
  5851. }
  5852. }
  5853. });
  5854. return pageElems
  5855. }
  5856.  
  5857.  
  5858. // [bilibili_search] 获取下一页地址
  5859. function bilibili_search_nextL() {
  5860. if (!location.search) return
  5861. let pageActive = 1, pageLast = parseInt(getXpath('//ul[@class="pages"]/li[contains(@class, "page-item")][not(contains(@class, "next") or contains(@class, "prev"))][last()]').innerText);
  5862. if (!pageLast) return
  5863. if (indexOF(/page=\d+/, 's')) {
  5864. pageActive = parseInt(/page=\d+/.exec(location.search)[0].replace('page=',''))
  5865. }
  5866. if (pageActive < pageLast) {
  5867. if (indexOF(/page=\d+/, 's')) {
  5868. return (location.origin + location.pathname + location.search.replace(/page=\d+/,`page=${pageActive+1}`))
  5869. } else {
  5870. return (location.origin + location.pathname + location.search + `&page=${pageActive+1}`)
  5871. }
  5872. }
  5873. }
  5874. // [bilibili_search] 插入前函数(加载图片)
  5875. function bilibili_search_bF(pageElems) {
  5876. pageElems.forEach(function (one) {
  5877. let img = getCSS('.img > .lazy-img > img[src=""]', one)
  5878. if (img) {
  5879. img.setAttribute('data-srclz', 'lazy')
  5880. }
  5881. });
  5882. return pageElems
  5883. }
  5884. // [bilibili_search] 插入后函数(加载图片)
  5885. function bilibili_search_aF() {
  5886. let result = __INITIAL_STATE__.flow[__INITIAL_STATE__.flow.fields[0]].result;
  5887. if (result.length > 0) {
  5888. let imgArr = getAllCSS('.img > .lazy-img > img[data-srclz]');
  5889. if (imgArr.length > 0) {
  5890. for (let i = 0; i < imgArr.length; i++) {
  5891. imgArr[i].src = result[i].pic;
  5892. imgArr[i].removeAttribute('data-srclz');
  5893. }
  5894. }
  5895. }
  5896. }
  5897.  
  5898.  
  5899. // [漫画狂] 获取下一页地址
  5900. function cartoonmad_nextL() {
  5901. let url = getXpath('//a[@class="pages"][contains(text(),"下一頁")]');
  5902. if (url) {
  5903. if (url.getAttribute('href') === 'thend.asp') {
  5904. url = getXpath('//a[@class="pages"][contains(string(),"下一話")]')
  5905. if (url) return url.href;
  5906. pausePage = false;
  5907. GM_notification({text: `注意:该网站早期漫画(如海贼王、柯南)因为网站自身问题而无法翻至下一话(仅限于显示为 [第 X 卷]/[下一卷] 的)。\n因此需要手动去 [目录页] 进入下一卷!`, timeout: 10000});
  5908. } else {
  5909. return url.href;
  5910. }
  5911. }
  5912. return '';
  5913. }
  5914.  
  5915.  
  5916. // [漫画猫] 初始化(显示本话所以图片)
  5917. function manhuacat_init() {
  5918. let _img = '';
  5919. for (let now of img_data_arr) {_img += `<img src="${asset_domain}${img_pre}${now}">`;}
  5920. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  5921.  
  5922. }
  5923. // [漫画猫] 获取下一页地址
  5924. function manhuacat_nextL(pageElems, type) {
  5925. if (type === 'url') {
  5926. if(pageElems.code == '0000') {
  5927. if (pageElems.url === curSite.pageUrl) return
  5928. curSite.pageUrl = pageElems.url;
  5929. getPageElems_(curSite.pageUrl); // 真正的下一页链接
  5930. }
  5931. } else {
  5932. let vg_r_data = getCSS('.vg-r-data');
  5933. if (vg_r_data) {
  5934. getPageElems_(`${location.origin}/chapter_num?chapter_id=${vg_r_data.dataset.chapter_num}&ctype=1&type=${vg_r_data.dataset.chapterType};`, 'json', 'GET', '', 'url');
  5935. }
  5936. }
  5937. }
  5938. // [漫画猫] 插入数据
  5939. function manhuacat_insertE(pageElems, type) {
  5940. if (!pageElems) return
  5941. if (type === 'url') { // 获取下一页链接
  5942. manhuacat_nextL(pageElems, type); return
  5943. }
  5944. addHistory(pageElems);
  5945. replaceElems(pageElems);
  5946.  
  5947. // 插入图片
  5948. let _img = '', _img_arr = LZString.decompressFromBase64(getXpath('//body/script[not(@src)][contains(text(), "img_data")]').textContent.split('"')[1]).split(','), vg_r_data = getCSS('.vg-r-data');;
  5949. for (let now of _img_arr) {_img += `<img src="${vg_r_data.dataset.chapterDomain}${img_pre}${now}">`;}
  5950. if (_img) {
  5951. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5952. pageNum.now = pageNum._now + 1
  5953. }
  5954. }
  5955.  
  5956.  
  5957. // [漫画柜] 初始化(将本话其余图片插入网页中)
  5958. function manhuagui_init() {
  5959. // hook imgDate 代码
  5960. SMH.imgData = function(n) {window['imgDate'] = n;return{preInit:function(){}}}
  5961. // 重新执行本页的 imgDate 代码
  5962. insScript(curSite.pager.pageE);
  5963. let _img = '', imgPath = `${location.protocol}//i.hamreus.com${window['imgDate'].path}`;
  5964. //console.log(imgPath, window['imgDate'])
  5965. if (!(window['imgDate']) || !(imgPath)) return
  5966. // 遍历图片文件名数组,组合为 img 标签
  5967. for (let i = 0; i < window['imgDate'].files.length; i++) {_img += `<img src="${imgPath + window['imgDate'].files[i]}?e=${window['imgDate'].sl.e}&m=${window['imgDate'].sl.m}">`;}
  5968. // 插入并覆盖原来的一个图片
  5969. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  5970. pausePage = true;
  5971. }
  5972. // [漫画柜] 获取下一页地址
  5973. function manhuagui_nextL() {
  5974. if (window['imgDate'].nextId == 0) return
  5975. var url = location.origin + location.pathname.replace(window['imgDate'].cid.toString(), window['imgDate'].nextId.toString())
  5976. if (url === curSite.pageUrl) return
  5977. curSite.pageUrl = url
  5978. getPageElems_(curSite.pageUrl);
  5979. }
  5980. // [漫画柜] 插入数据
  5981. function manhuagui_insertE(pageElems, type) {
  5982. if (!pageElems) return
  5983. // 重新执行本页的 imgDate 代码
  5984. insScript(curSite.pager.pageE, document.body, pageElems);
  5985. let _img = '', imgPath = `${location.protocol}//i.hamreus.com${window['imgDate'].path}`;
  5986. //console.log(imgPath, window['imgDate'])
  5987. if (!(window['imgDate']) || !(imgPath)) return
  5988. // 遍历图片文件名数组,组合为 img 标签
  5989. for (let i = 0; i < window['imgDate'].files.length; i++) {_img += `<img src="${imgPath + window['imgDate'].files[i]}?e=${window['imgDate'].sl.e}&m=${window['imgDate'].sl.m}">`;}
  5990. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  5991. addHistory(pageElems);
  5992. pageNum.now = pageNum._now + 1
  5993. }
  5994.  
  5995.  
  5996. // [36漫画] 初始化(将本话其余图片插入网页中)
  5997. function _36manga_init() {
  5998. let _img = '', imgPath = `${SinConf.resHost[0].domain[0]}${chapterPath}`;
  5999. if (!(chapterImages) || !(imgPath)) return
  6000. // 遍历图片文件名数组,组合为 img 标签
  6001. for (let i = 0; i < chapterImages.length; i++) {_img += `<img src="${imgPath}${chapterImages[i]}">`;}
  6002. // 插入并覆盖原来的一个图片
  6003. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  6004. pausePage = true;
  6005. }
  6006. // [36漫画] 获取下一页地址
  6007. function _36manga_nextL() {
  6008. if (!nextChapterData.id) return
  6009. var url = comicUrl + nextChapterData.id + '.html'
  6010. if (url === curSite.pageUrl) return
  6011. curSite.pageUrl = url
  6012. getPageElems_(curSite.pageUrl);
  6013. }
  6014. // [36漫画] 插入数据
  6015. function _36manga_insertE(pageElems, type) {
  6016. if (!pageElems) return
  6017. // 插入并执行数据代码
  6018. insScript(curSite.pager.pageE, document.body, pageElems);
  6019. let _img = '', imgPath = `${SinConf.resHost[0].domain[0]}${chapterPath}`;
  6020. if (!(chapterImages) || !(imgPath)) return
  6021. // 遍历图片文件名数组,组合为 img 标签
  6022. for (let i = 0; i < chapterImages.length; i++) {_img += `<img src="${imgPath}${chapterImages[i]}">`;}
  6023. // 插入并覆盖原来的一个图片
  6024. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  6025. addHistory(pageElems);
  6026. pageNum.now = pageNum._now + 1
  6027. }
  6028.  
  6029.  
  6030. // [爱漫画] 获取全部图片
  6031. function imanhuaw_getIMG() {
  6032. let _img = '', _imgUrl;
  6033. for (let one of base64_decode(qTcms_S_m_murl_e).split("$qingtiandy$")) {
  6034. _imgUrl = one;
  6035. if (one.substring(0,1) == '/') {
  6036. _imgUrl = qTcms_m_weburl + _imgUrl;
  6037. } else {
  6038. if (qTcms_Pic_m_if != '2') {
  6039. one = one.replace(/\?/gi, 'a1a1');
  6040. one = one.replace(/&/gi, 'b1b1');
  6041. one = one.replace(/%/gi, 'c1c1');
  6042. let m_httpurl = '';
  6043. if (typeof(qTcms_S_m_mhttpurl) != 'undefined') m_httpurl = base64_decode(qTcms_S_m_mhttpurl);
  6044. if (location.hostname == 'www.ccshwy.com') qTcms_m_indexurl = 'http://h.ccshwy.com/';
  6045. _imgUrl = qTcms_m_indexurl + 'statics/pic/?p=' + escape(one) + '&picid=' + qTcms_S_m_id + '&m_httpurl=' + escape(m_httpurl);
  6046. } else {
  6047. _imgUrl = _imgUrl.replace('http:', '') ;
  6048. _imgUrl = _imgUrl.replace('https:', '');
  6049. }
  6050. }
  6051. _img += `<img src="${_imgUrl}">`;
  6052. }
  6053. return _img;
  6054. }
  6055. // [爱漫画] 初始化(调整本话其余图片)
  6056. function imanhuaw_init() {
  6057. getOne(curSite.pager.insertP[0]).outerHTML = imanhuaw_getIMG();
  6058. document.oncontextmenu = function(){}
  6059. }
  6060. // [爱漫画] 获取下一页地址
  6061. function imanhuaw_nextL() {
  6062. let next = location.origin + qTcms_Pic_nextArr
  6063. if (next && next != location.origin && next != curSite.pageUrl) {
  6064. curSite.pageUrl = next;
  6065. getPageElems_(curSite.pageUrl);
  6066. }
  6067. }
  6068. // [爱漫画] 插入数据
  6069. function imanhuaw_insertE(pageElems, type) {
  6070. if (!pageElems) return
  6071. // 插入并运行 <script>
  6072. insScript('//head/script[not(@src)][contains(text(), "qTcms_S_m_murl_e")]', document.body, pageElems);
  6073. // 将 img 标签插入到网页中
  6074. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), imanhuaw_getIMG());
  6075. addHistory(pageElems);
  6076. pageNum.now = pageNum._now + 1
  6077. }
  6078.  
  6079.  
  6080. // [漫画 DB] 初始化(将本话其余图片插入网页中)
  6081. function manhuadb_init() {
  6082. let _img = '', data = getCSS('.vg-r-data'), imgDate;
  6083. if (!data) return
  6084. getAllCSS(curSite.pager.pageE.replace('', '')).forEach(function (one) {
  6085. if (one.tagName === 'SCRIPT' && one.textContent.indexOf('var img_data =') > -1) {
  6086. let json = JSON.parse(window.atob(one.textContent.split("'")[1]));
  6087. if (json) {
  6088. let _img = '';
  6089. for (let i = 0; i < json.length; i++) {_img += `<img class="img-fluid show-pic" src="${data.dataset.host + data.dataset.img_pre + json[i].img}">`;}
  6090. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  6091. }
  6092. }
  6093. })
  6094. }
  6095. // [漫画 DB] 获取下一页地址
  6096. function manhuadb_nextL() {
  6097. let nextArr = getAllCSS('a.fixed-a-es'), next;
  6098. var url = '';
  6099. if (nextArr.length == 0) return
  6100. for (let i = 0; i < nextArr.length; i++) {
  6101. if (nextArr[i].className.indexOf('active') > -1) {
  6102. if (nextArr[i+1]) url = nextArr[i+1].href;
  6103. break;
  6104. }
  6105. }
  6106. if (url === curSite.pageUrl) return
  6107. curSite.pageUrl = url
  6108. getPageElems_(curSite.pageUrl);
  6109. }
  6110. // [漫画 DB] 插入数据
  6111. function manhuadb_insertE(pageElems, type) {
  6112. if (!pageElems) return
  6113. if (replaceElems(pageElems, curSite.pager.pageE, curSite.pager.pageE)) {
  6114. addHistory(pageElems);
  6115. pageNum.now = pageNum._now + 1
  6116. manhuadb_init(); // 将刚刚替换的图片插入网页中
  6117. }
  6118. }
  6119.  
  6120.  
  6121. // [HiComic(嗨漫画)] 初始化(将本话其余图片插入网页中)
  6122. function hicomic_init() {
  6123. let _img = '';
  6124. getAllCSS('.chapter > section:not(:first-child) > section[val]').forEach(function (one) {
  6125. let src = one.getAttribute('val');
  6126. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h'
  6127. _img += `<img src="${src}">`
  6128. })
  6129. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  6130. window.document.title = window.document.title.replace(/(\(第.+\))? - HiComic/, `(${getCSS('.chapter_name').textContent}) - HiComic`); // 修改网页标题(加上 第 X 话)
  6131. }
  6132. // [HiComic(嗨漫画)] 获取下一页地址
  6133. function hicomic_nextL() {
  6134. let nextId;
  6135. nextId = getCSS('.next_chapter:not(.end)')
  6136. if (nextId && nextId.id && nextId.id != 'None') {
  6137. curSite.pageUrl = location.href;
  6138. getPageElems_(`https://www.hicomic.net/api/web/chapter/${nextId.id}/contents`, 'json');
  6139. }
  6140. }
  6141. // [HiComic(嗨漫画)] 插入数据
  6142. function hicomic_insertE(pageElems, type) {
  6143. if (!pageElems || pageElems.code != 200) return
  6144. if (pageElems.results.chapter.next) { // 写入下一页的 UUID
  6145. getCSS('.next_chapter').id = pageElems.results.chapter.next;
  6146. } else {
  6147. getCSS('.next_chapter').id = 'None';
  6148. getCSS('.next_chapter').classList.add('end');
  6149. }
  6150. curSite.pageUrl =`https://www.hicomic.net/chapters/${pageElems.results.chapter.uuid}/contents`
  6151. getCSS('.chapter_name').textContent = pageElems.results.chapter.name; // 修改漫画标题
  6152. addHistory(pageElems, window.document.title.replace(/(\(第.+\))? - HiComic/, `(${pageElems.results.chapter.name}) - HiComic`));
  6153. let _img = '';
  6154. for (let i = 0; i < pageElems.results.chapter.contents.length; i++) { // 遍历图片文件名数组,组合为 img 标签
  6155. let src = pageElems.results.chapter.contents[i].url;
  6156. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h';
  6157. _img += `<img src="${src}">`
  6158. }
  6159. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  6160. pageNum.now = pageNum._now + 1
  6161. }
  6162.  
  6163.  
  6164. // [动漫之家] 初始化(调整本话其余图片)
  6165. function dmzj_init(css) {
  6166. let _img = '';
  6167. getAllCSS(css).forEach(function (one) {_img += `<img src="${one.dataset.original}">`;})
  6168. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  6169. }
  6170. // [动漫之家] 插入数据
  6171. function dmzj_insertE(pageElems, type) {
  6172. if (!pageElems) return
  6173. // 插入并运行 <script>
  6174. insScript('head > script[type]:not([src])', document.body, pageElems);
  6175.  
  6176. // 插入图片
  6177. let _img = '', _img_arr;
  6178. if (pages.indexOf('|') === -1) {
  6179. _img_arr = JSON.parse(pages.replace(/\r\n/g,'|')).page_url.split('|');
  6180. } else {
  6181. _img_arr = JSON.parse(pages).page_url.split('|');
  6182. }
  6183. for (let now of _img_arr) {
  6184. _img += `<img src="${img_prefix}${now}">`;
  6185. }
  6186. if (_img) {
  6187. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  6188. addHistory(pageElems);
  6189. if (replaceElems(pageElems)) pageNum.now = pageNum._now + 1
  6190. }
  6191. }
  6192. // [动漫之家-漫画] 插入数据
  6193. function dmzj_manhua_insertE(pageElems, type) {
  6194. if (!pageElems) return
  6195. // 插入并运行 <script>
  6196. insScript('head > script[type]:not([src])', document.body, pageElems);
  6197.  
  6198. // 插入图片
  6199. let _img = '';
  6200. for (let now of arr_pages) {
  6201. _img += `<img src="${img_prefix}${now}">`;
  6202. }
  6203. if (_img) {
  6204. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  6205. addHistory(pageElems);
  6206. if (replaceElems(pageElems)) pageNum.now = pageNum._now + 1
  6207. }
  6208. }
  6209.  
  6210.  
  6211. // [优酷漫画] 初始化(调整本话其余图片)
  6212. function ykmh_init(css) {
  6213. let host = SinMH.getChapterImage(1).split('/')[0] + '//' + SinMH.getChapterImage(1).split('/')[2];
  6214. if (!host) return
  6215. let _img = '';
  6216. for (let one of chapterImages) {_img += `<img src="${host}${one}">`;}
  6217. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  6218. }
  6219. // [优酷漫画] 获取下一页地址
  6220. function ykmh_nextL() {
  6221. let url = comicUrl + nextChapterData.id + '.html'
  6222. if (url && url != '.html' && url != curSite.pageUrl) {
  6223. curSite.pageUrl = url;
  6224. getPageElems_(curSite.pageUrl);
  6225. }
  6226. }
  6227. // [优酷漫画] 插入数据
  6228. function ykmh_insertE(pageElems, type) {
  6229. //console.log(pageElems)
  6230. if (!pageElems) return
  6231. // 插入并运行 <script>
  6232. insScript('//script[contains(text(),"chapterImages")]', document.body, pageElems);
  6233.  
  6234. let host = SinMH.getChapterImage(1).split('/')[0] + '//' + SinMH.getChapterImage(1).split('/')[2];
  6235. if (!host) host = document.querySelector(curSite.pager.insertP[0]).src.split('/')[0] + '//' + document.querySelector(curSite.pager.insertP[0]).src.split('/')[2]
  6236. // 插入图片
  6237. let _img = '';
  6238. for (let one of chapterImages) {_img += `<img src="${host}${one}">`;}
  6239. if (_img) {
  6240. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  6241. addHistory(pageElems);
  6242. if (replaceElems(pageElems)) pageNum.now = pageNum._now + 1
  6243. }
  6244. }
  6245.  
  6246.  
  6247. // [动漫戏说] 插入后函数(加载图片)
  6248. function acgn_aF() {
  6249. let old = getAllCSS('.pic[_src][id]'), _img = '';
  6250. if (old.length > 0) {
  6251. for (let now of old) {now.outerHTML = `<div class="pic" _src="${now.getAttribute('_src')}"><img src="${now.getAttribute('_src')}" class="img1"></div>`;}
  6252. }
  6253. }
  6254.  
  6255.  
  6256. // [漫画星球] 插入数据
  6257. function mhxqiu_insertE(pageElems, type) {
  6258. if (!pageElems) return
  6259. // 插入并运行 <script>
  6260. insScript('//script[contains(text(), "eval") and contains(text(), "newImgs")]', document.body, pageElems);
  6261.  
  6262. // 插入图片
  6263. let _img = '';
  6264. for (let now of newImgs) {_img += `<li><div style="display: inline-block;zoom: 1;"><img src="${now}" class="loaded lazy" style="opacity: 1;box-shadow:none;"></div></li>`;}
  6265. if (_img) {
  6266. // 将 img 标签插入到网页中
  6267. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  6268. addHistory(pageElems);
  6269. pageNum.now = pageNum._now + 1
  6270. replaceElems(pageElems)
  6271. }
  6272. }
  6273.  
  6274.  
  6275. // [风之动漫] 插入数据
  6276. function fffdm_insertE(pageElems, type) {
  6277. if (!pageElems) return
  6278. // 插入并运行 <script>
  6279. let scriptElems = getXpath('id("main")/script[contains(text(), "mhpicurl")][1]', pageElems, pageElems);
  6280. if (scriptElems) {
  6281. document.body.appendChild(document.createElement('script')).textContent = scriptElems.textContent.replace(/document\.write.+/, '');
  6282.  
  6283. // 插入图片
  6284. setTimeout(function() {
  6285. getOne(curSite.pager.insertP[0]).appendChild(document.createElement('img')).src = mhpicurl;
  6286. addHistory(pageElems);
  6287. pageNum.now = pageNum._now + 1
  6288. replaceElems(pageElems)
  6289. }, 100)
  6290. }
  6291. }
  6292.  
  6293.  
  6294. // [乐语漫画] 初始化(调整本话其余图片)
  6295. function leyuman_init() {
  6296. let _img = '';
  6297. for (let one of JSON.parse(z_img)) {
  6298. if (one.slice(0,4) === 'http') {
  6299. _img += `<img src="${one}">`;
  6300. } else {
  6301. _img += `<img src="https://img.shishi-life.com/${one}">`;
  6302. }
  6303. }
  6304. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  6305.  
  6306. }
  6307. // [乐语漫画] 插入数据
  6308. function leyuman_insertE(pageElems, type) {
  6309. if (!pageElems) return
  6310. // 插入并运行 <script>
  6311. insScript('//body//script[not(@src)][contains(text(), "z_img=")]', document.body, pageElems);
  6312.  
  6313. // 插入图片
  6314. let _img = '';
  6315. for (let one of JSON.parse(z_img)) {
  6316. if (one.slice(0,4) === 'http') {
  6317. _img += `<img src="${one}">`;
  6318. } else {
  6319. _img += `<img src="https://img.shishi-life.com/${one}">`;
  6320. }
  6321. }
  6322. if (_img) {
  6323. // 将 img 标签插入到网页中
  6324. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  6325. addHistory(pageElems);
  6326. pageNum.now = pageNum._now + 1
  6327. replaceElems(pageElems)
  6328. }
  6329. }
  6330.  
  6331.  
  6332. // [新新漫画] 初始化(调整本话其余图片)
  6333. function _77mh_init() {
  6334. let _img = '';
  6335. for (let one of arr) {_img += `<img src="${img_qianz}${one}">`;}
  6336. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  6337. }
  6338. // [新新漫画] 获取下一页地址
  6339. function _77mh_nextL() {
  6340. let next = nextLink_b
  6341. if (next && next != curSite.pageUrl) {
  6342. curSite.pageUrl = next;
  6343. getPageElems_(curSite.pageUrl);
  6344. }
  6345. }
  6346. // [新新漫画] 插入数据
  6347. function _77mh_insertE(pageElems, type) {
  6348. if (!pageElems) return
  6349. // 插入并运行 <script>
  6350. insScript('//script[not(@src)][contains(text(), "eval(")]', document.body, pageElems);
  6351.  
  6352. // 插入图片
  6353. let _img = '';
  6354. for (let one of msg.split('|')) {_img += `<img src="${img_qianz}${one}.webp">`;}
  6355. if (_img) {
  6356. // 将 img 标签插入到网页中
  6357. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  6358. addHistory(pageElems);
  6359. pageNum.now = pageNum._now + 1
  6360. }
  6361. }
  6362.  
  6363.  
  6364. // [古风漫画网] 获取下一页地址
  6365. function gufengmh_nextL() {
  6366. let pageElems = getOne(curSite.pager.pageE); // 寻找数据所在元素
  6367. if (pageElems) {
  6368. let comicUrl, nextId;
  6369. var url = '';
  6370. pageElems.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  6371. //console.log(one)
  6372. if (one.indexOf('comicUrl') > -1) { // 下一页 URL 前半部分
  6373. comicUrl = one.split('"')[1];
  6374. } else if (one.indexOf('nextChapterData') > -1) { // 下一页 URL 的后半部分 ID
  6375. nextId = one.split('"id":')[1].split(',')[0];
  6376. }
  6377. })
  6378. if (comicUrl && nextId && nextId != 'null') { // 组合到一起就是下一页 URL
  6379. url = comicUrl + nextId + '.html'
  6380. if (url === curSite.pageUrl) return
  6381. curSite.pageUrl = url
  6382. getPageElems_(curSite.pageUrl); // 访问下一页 URL 获取
  6383. }
  6384. }
  6385. }
  6386. // [古风漫画网] 插入数据
  6387. function gufengmh_insertE(pageElems, type) {
  6388. if (pageElems) {
  6389. let url = curSite.pageUrl;
  6390. pageElems = getOne(curSite.pager.pageE, pageElems, pageElems);
  6391. let chapterImages, chapterPath;
  6392. getOne(curSite.pager.pageE).innerText = pageElems.textContent; // 将当前网页内的数据所在元素内容改为刚刚获取的下一页数据内容,以便循环获取下一页 URL
  6393. pageElems.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  6394. //console.log(one)
  6395. if (one.indexOf('chapterImages') > -1) { // 图片文件名数组
  6396. chapterImages = one.replace(/^.+\[/, '').replace(']', '').replaceAll('"', '').split(',')
  6397. } else if (one.indexOf('chapterPath') > -1) { // 图片文件路径
  6398. chapterPath = one.split('"')[1];
  6399. } else if (one.indexOf('pageTitle') > -1) { // 网页标题
  6400. addHistory(pageElems, one.split('"')[1]);
  6401. }
  6402. })
  6403. if (chapterImages && chapterPath) {
  6404. let _img = '';
  6405. chapterImages.forEach(function (one2){_img += '<img src="https://res.xiaoqinre.com/' + chapterPath + one2 + '" data-index="0" style="display: inline-block;">';})
  6406. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  6407. pageNum.now = pageNum._now + 1
  6408. }
  6409. }
  6410. }
  6411.  
  6412.  
  6413. // [Mangabz 漫画] 初始化(调整本话图片)
  6414. function mangabz_init() {
  6415. let showimage = getCSS('#showimage'),
  6416. cp_img = getCSS('#cp_img'),
  6417. cp_image = getCSS('#cp_image');
  6418. if (showimage) {showimage.removeAttribute('oncontextmenu');}
  6419. if (cp_img) {cp_img.removeAttribute('oncontextmenu');}
  6420. if (cp_image) {
  6421. cp_image.removeAttribute('oncontextmenu');
  6422. cp_image.removeAttribute('id');
  6423. cp_image.removeAttribute('style');
  6424. }
  6425. }
  6426. // [Mangabz 漫画] 获取下一页地址
  6427. function mangabz_nextL() {
  6428. var url = '';
  6429. if (MANGABZ_PAGE === MANGABZ_IMAGE_COUNT) { // 下一话
  6430. if (getNextE('//a[./img[contains(@src, "icon_xiayizhang")]]')) getPageElems_(curSite.pageUrl); // 访问下一话 URL 获取
  6431. } else { // 下一页
  6432. if (!mkey) var mkey = '';
  6433. 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}`
  6434. if (url === curSite.pageUrl) return
  6435. curSite.pageUrl = url
  6436. //console.log(curSite.pageUrl)
  6437. getPageElems_(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
  6438. }
  6439. }
  6440. // [Mangabz 漫画] 插入数据
  6441. function mangabz_insertE(pageElems, type) {
  6442. if (pageElems) {
  6443. if (type === 'Next') { // 下一页
  6444. let imgArr = eval(pageElems),
  6445. _img = '';
  6446. for (let now of imgArr) {_img += `<img src="${now}">`;}
  6447. if (_img) {
  6448. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  6449. MANGABZ_PAGE += imgArr.length;
  6450. addHistory(pageElems, document.title, location.origin + MANGABZ_CURL.substring(0, MANGABZ_CURL.length - 1) + '-p' + MANGABZ_PAGE + '/');
  6451. }
  6452. } else { // 下一话
  6453. // 插入 <script> 标签
  6454. insScript('html:not([dir]) > head > script:not([src])', document.body, pageElems);
  6455. addHistory(pageElems);
  6456. pageNum.now = pageNum._now + 1
  6457. replaceElems(pageElems)
  6458. MANGABZ_PAGE = 0;
  6459. mangabz_nextL();
  6460. }
  6461. }
  6462. }
  6463.  
  6464.  
  6465. // [动漫屋] 获取下一页地址
  6466. function dm5_nextL() {
  6467. var url = '';
  6468. if (DM5_PAGE === DM5_IMAGE_COUNT) { // 下一话
  6469. if (getNextE('//div[@class="view-paging"]//a[text()="下一章"]')) getPageElems_(curSite.pageUrl); // 访问下一话 URL 获取
  6470. } else { // 下一页
  6471. if (!mkey) var mkey = '';
  6472. url = location.origin + location.pathname + 'chapterfun.ashx' + `?cid=${DM5_CID}&page=${DM5_PAGE + 1}&key=${(mkey)}&language=1&gtk=6&_cid=${DM5_CID}&_mid=${DM5_MID}&_dt=${DM5_VIEWSIGN_DT}&_sign=${DM5_VIEWSIGN}`
  6473. if (url === curSite.pageUrl) return
  6474. curSite.pageUrl = url
  6475. //console.log(curSite.pageUrl)
  6476. getPageElems_(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
  6477. }
  6478. }
  6479. // [动漫屋] 插入数据
  6480. function dm5_insertE(pageElems, type) {
  6481. if (pageElems) {
  6482. if (type === 'Next') { // 下一页
  6483. let imgArr = eval(pageElems),
  6484. _img = '';
  6485. for (let now of imgArr) {_img += `<img src="${now}">`;}
  6486. if (_img) {
  6487. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  6488. DM5_PAGE += imgArr.length;
  6489. addHistory(pageElems, document.title, location.origin + DM5_CURL.substring(0, DM5_CURL.length - 1) + '-p' + DM5_PAGE + '/');
  6490. }
  6491. } else { // 下一话
  6492. // 插入 <script> 标签
  6493. insScript('html:not([dir]) > head > script:not([src])', document.body, pageElems);
  6494. addHistory(pageElems);
  6495. pageNum.now = pageNum._now + 1
  6496. replaceElems(pageElems)
  6497. DM5_PAGE = 0;
  6498. dm5_nextL();
  6499. }
  6500. }
  6501. }
  6502.  
  6503.  
  6504. // [Xmanhua 漫画] 获取下一页地址
  6505. function xmanhua_nextL() {
  6506. var url = '';
  6507. if (XMANHUA_PAGE === XMANHUA_IMAGE_COUNT) { // 下一话
  6508. if (getNextE('//a[./img[contains(@src, "reader-bottom-right-2.png")]]')) getPageElems_(curSite.pageUrl); // 访问下一话 URL 获取
  6509. } else { // 下一页
  6510. if (!mkey) var mkey = '';
  6511. url = location.origin + location.pathname + 'chapterimage.ashx' + `?cid=${XMANHUA_CID}&page=${XMANHUA_PAGE + 1}&key=${(mkey)}&_cid=${XMANHUA_CID}&_mid=${XMANHUA_MID}&_dt=${XMANHUA_VIEWSIGN_DT}&_sign=${XMANHUA_VIEWSIGN}`
  6512. if (url === curSite.pageUrl) return
  6513. curSite.pageUrl = url
  6514. //console.log(curSite.pageUrl)
  6515. getPageElems_(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
  6516. }
  6517. }
  6518. // [Xmanhua 漫画] 插入数据
  6519. function xmanhua_insertE(pageElems, type) {
  6520. if (pageElems) {
  6521. if (type === 'Next') { // 下一页
  6522. let imgArr = eval(pageElems),
  6523. _img = '';
  6524. for (let now of imgArr) {_img += `<img src="${now}">`;}
  6525. if (_img) {
  6526. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  6527. XMANHUA_PAGE += imgArr.length;
  6528. addHistory(pageElems, document.title, location.origin + XMANHUA_CURL.substring(0, XMANHUA_CURL.length - 1) + '-p' + XMANHUA_PAGE + '/');
  6529. }
  6530. } else { // 下一话
  6531. // 插入 <script> 标签
  6532. insScript('html:not([dir]) > head > script:not([src])', document.body, pageElems);
  6533. addHistory(pageElems);
  6534. pageNum.now = pageNum._now + 1
  6535. replaceElems(pageElems)
  6536. XMANHUA_PAGE = 0;
  6537. xmanhua_nextL();
  6538. }
  6539. }
  6540. }
  6541.  
  6542.  
  6543. // [COCOMANGA 漫画] 初始化(调整本话图片)
  6544. function cocomanga_init() {
  6545. let last = getCSS('.mh_comicpic:last-of-type');
  6546. if (last && last.getAttribute('p')) {
  6547. getOne(curSite.pager.insertP[0]).innerHTML = ''; // 删除旧图片元素
  6548. cocomanga_img(parseInt(last.getAttribute('p'))) // 插入新图片元素
  6549. }
  6550. }
  6551. // [COCOMANGA 漫画] 生成图片元素并插入网页
  6552. function cocomanga_img(totalImageCount) {
  6553. if (totalImageCount < 1) return
  6554. let _img = '';
  6555. for (let i=1; i<=totalImageCount; i++) {_img += `<div class="mh_comicpic" p="${i}"><img src="${__cr.getPicUrl(i)}"></div>`;}
  6556. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  6557. }
  6558. // [COCOMANGA 漫画] 插入数据
  6559. function cocomanga_insertE(pageElems, type) {
  6560. if (pageElems) {
  6561. // 插入 <script> 标签
  6562. insScript('head > script:not([src]), script[src*="custom.js"], script[src*="dynamicjs.js"]', document.body, pageElems);
  6563.  
  6564. // 插入新图片元素
  6565. setTimeout(function() {
  6566. let totalImageCount = __cdecrypt('fw122587mkertyui', CryptoJS.enc.Base64.parse(mh_info.enc_code1).toString(CryptoJS.enc.Utf8));
  6567. if (!totalImageCount) totalImageCount = __cdecrypt('fw12558899ertyui', CryptoJS.enc.Base64.parse(mh_info.enc_code1).toString(CryptoJS.enc.Utf8));
  6568. cocomanga_img(parseInt(totalImageCount));
  6569. }, 100)
  6570. addHistory(pageElems);
  6571. pageNum.now = pageNum._now + 1
  6572. replaceElems(pageElems)
  6573. }
  6574. }
  6575.  
  6576.  
  6577. // [国家自然科学基金] 获取下一页地址
  6578. function nsfc_nextL() {
  6579. let id = decodeURIComponent(document.location.href.split('/')[document.location.href.split('/').length - 1]), data
  6580. if (!document.nowPageNum) document.nowPageNum = 2
  6581. data = `id=${id}&index=${document.nowPageNum}`
  6582. if (data === curSite.pageUrl) return
  6583. curSite.pageUrl = data
  6584. getPageElems_(location.origin + '/baseQuery/data/completeProjectReport', 'json', 'POST', data); // 访问下一页 URL 获取
  6585. }
  6586. // [国家自然科学基金] 插入数据
  6587. function nsfc_insertE(pageElems, type) {
  6588. if (!pageElems || pageElems.code != 200) {curSite.SiteTypeID = 0; return}
  6589. if (!pageElems.data.hasnext) {curSite.SiteTypeID = 0} else {document.nowPageNum++}
  6590. pageNum.now = pageNum._now + 1
  6591. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), `<img style="width: 100%;" data-magnify="gallery" data-src="${pageElems.data.url}" src="${pageElems.data.url}">`);
  6592. }
  6593.  
  6594.  
  6595.  
  6596. // [酷科研] 获取下一页地址
  6597. function coolkeyan_nextL() {
  6598. if (!getCSS('.q-img__image')) return
  6599. let id = getCSS('.q-breadcrumbs--last > span.q-breadcrumbs__el'), data
  6600. if (id && id.textContent) {id=parseInt(id.textContent)} else {return}
  6601. if (!document.nowPageNum) document.nowPageNum = 2
  6602. data = `ratify_no=${id}&index=${document.nowPageNum}`
  6603. if (data === curSite.pageUrl) return
  6604. curSite.pageUrl = data
  6605. getPageElems_(location.origin + '/api/funds/nsfc/creport?' + data, 'json', 'GET'); // 访问下一页 URL 获取
  6606. }
  6607. // [酷科研] 插入数据
  6608. function coolkeyan_insertE(pageElems, type) {
  6609. if (!pageElems || pageElems == {}) {curSite.SiteTypeID = 0; return}
  6610. if (!pageElems.url) {curSite.SiteTypeID = 0; return} else {document.nowPageNum++}
  6611. pageNum.now = pageNum._now + 1
  6612. getCSS('.q-img>div[style*="padding-bottom"]').style.paddingBottom = `${(document.nowPageNum * 1000) - 1000}px`
  6613. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), `<div class="q-img__image absolute-full" style="background-size: contain; background-position: 50% 50%; background-image: url('${pageElems.url}'); top: ${(document.nowPageNum * 1000) - 2000}px"></div>`);
  6614. }
  6615.  
  6616.  
  6617. // --------------------------------------------------------
  6618.  
  6619.  
  6620. // 自动无缝翻页
  6621. function pageLoading() {
  6622. if (curSite.SiteTypeID == 0) return
  6623. windowScroll(function (direction, e) {
  6624. // 下滑 且 未暂停翻页 且 SiteTypeID > 0 时,才准备翻页
  6625. if (direction != 'down' || !pausePage || curSite.SiteTypeID == 0) return
  6626. if (!curSite.pager.type) curSite.pager.type = 1; // 默认翻页模式 1
  6627. if (!curSite.pager.scrollD) curSite.pager.scrollD = 1500; // 默认翻页触发线 1500
  6628. // 翻页模式 5 且为框架内时,要判断顶层是否通过页码暂停翻页了
  6629. if (curSite.pager.type == 5 && self != top && window.top.document.xiu_pausePage == false) return
  6630.  
  6631. let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop,
  6632. scrollHeight = window.innerHeight || document.documentElement.clientHeight,
  6633. scrollD = curSite.pager.scrollD;
  6634. // <<<<< 翻页类型 3(依靠 [基准元素] 与 [浏览器可视区域底部] 之间的距离缩小来触发翻页)>>>>>
  6635. if (curSite.pager.type === 3) {
  6636. if (!curSite.pager.scrollE) curSite.pager.scrollE = curSite.pager.replaceE; // 默认基准元素是页码
  6637. let scrollE = getOne(curSite.pager.scrollE);
  6638. //console.log(scrollE.offsetTop, scrollE.offsetTop - (scrollTop + scrollHeight), scrollD, scrollTop + scrollHeight, curSite.SiteTypeID)
  6639. if (scrollE.offsetTop - (scrollTop + scrollHeight) <= scrollD) {intervalPause(); checkURL(getPageElems);}
  6640.  
  6641. } else if (document.documentElement.scrollHeight <= scrollHeight + scrollTop + scrollD) {
  6642. // <<<<< 翻页类型 1(由脚本实现自动无缝翻页)>>>>>
  6643. if (curSite.pager.type === 1) {
  6644. intervalPause(); checkURL(getPageElems);
  6645.  
  6646. // <<<<< 翻页类型 2(网站自带了自动无缝翻页功能,只需要点击下一页按钮即可)>>>>>
  6647. } else if (curSite.pager.type === 2) {
  6648. let autopbn = getOne(curSite.pager.nextL);
  6649. if (!autopbn) return
  6650. if (curSite.pager.isHidden && isHidden(autopbn)) return // 如果 isHidden = true,那么需要判断元素是否隐藏
  6651. if (curSite.pager.nextText) {
  6652. // 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页
  6653. if (autopbn.innerText === curSite.pager.nextText) {autopbn.click(); pageNum.now = pageNum._now + 1;}
  6654. } else if (curSite.pager.nextTextOf) {
  6655. // 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页
  6656. if (autopbn.innerText.indexOf(curSite.pager.nextTextOf) > -1) {autopbn.click(); pageNum.now = pageNum._now + 1;}
  6657. } else if (curSite.pager.nextHTML) {
  6658. // 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页
  6659. if (autopbn.innerHTML === curSite.pager.nextHTML) {autopbn.click(); pageNum.now = pageNum._now + 1;}
  6660. } else {
  6661. // 对于没有按钮文字变化的按钮,可以指定间隔时间(默认 300ms)
  6662. if (!curSite.pager.interval) curSite.pager.interval = 300;
  6663. intervalPause();
  6664. // 如果没有指定按钮文字就直接点击
  6665. autopbn.click(); pageNum.now = pageNum._now + 1;
  6666. }
  6667.  
  6668. // <<<<< 翻页类型 4(部分简单的动态加载类网站)>>>>>
  6669. } else if (curSite.pager.type === 4) {
  6670. // 为百度贴吧的发帖考虑,预留底部一小部分...
  6671. if (!(curSite.SiteTypeID === SiteType.BAIDU_TIEBA && document.documentElement.scrollHeight <= scrollHeight + scrollTop + 200)) {
  6672. intervalPause(); if (typeof curSite.pager.nextL == 'function') {curSite.pager.nextL();} else if (getNextE(curSite.pager.nextL)) {getPageElems_(curSite.pageUrl);}
  6673. }
  6674.  
  6675. // <<<<< 翻页类型 5(插入 iframe 方式来加载下一页)>>>>>
  6676. } else if (curSite.pager.type === 5) {
  6677. checkURL(insIframe);
  6678.  
  6679. // <<<<< 翻页类型 6(通过 iframe 获取下一页动态加载内容)>>>>>
  6680. } else if (curSite.pager.type === 6) {checkURL(insIframe_);}
  6681. }
  6682. });
  6683.  
  6684. function intervalPause() {
  6685. if (curSite.pager.interval) {
  6686. pausePage = false
  6687. setTimeout(function(){pausePage = true;}, curSite.pager.interval)
  6688. }
  6689. }
  6690. }
  6691.  
  6692. // 翻页类型 1/3
  6693. function getPageElems(url) {
  6694. GM_xmlhttpRequest({
  6695. url: url,
  6696. method: 'GET',
  6697. overrideMimeType: 'text/html; charset=' + document.charset,
  6698. headers: {
  6699. 'Referer': location.href,
  6700. 'User-Agent': navigator.userAgent
  6701. },
  6702. timeout: 10000,
  6703. onload: function (response) {
  6704. try {
  6705. //console.log('URL:' + url, '最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  6706. processElems(createDocumentByString(response.responseText));
  6707. } catch (e) {
  6708. console.log(e);
  6709. }
  6710. }
  6711. });
  6712. }
  6713. // 翻页类型 4
  6714. function getPageElems_(url, type = '', method = 'GET', data = '', type2) {
  6715. let mimeType;
  6716. switch (type) {
  6717. case 'json':
  6718. mimeType = 'application/json; charset=' + document.charset; break;
  6719. case 'text':
  6720. mimeType = 'text/plain; charset=' + document.charset; break;
  6721. default:
  6722. mimeType = 'text/html; charset=' + document.charset;
  6723. }
  6724.  
  6725. GM_xmlhttpRequest({
  6726. url: url,
  6727. method: method,
  6728. data: data,
  6729. responseType: type,
  6730. overrideMimeType: mimeType,
  6731. headers: {
  6732. 'Referer': location.href,
  6733. 'Content-Type': (method === 'POST') ? 'application/x-www-form-urlencoded':'',
  6734. 'User-Agent': navigator.userAgent
  6735. },
  6736. timeout: 10000,
  6737. onload: function (response) {
  6738. try {
  6739. //console.log('最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  6740. switch (type) {
  6741. case 'json':
  6742. curSite.pager.insertE(response.response, type2);
  6743. break;
  6744. case 'text':
  6745. curSite.pager.insertE(response.responseText, type2)
  6746. break;
  6747. default:
  6748. curSite.pager.insertE(createDocumentByString(response.responseText), type2)
  6749. }
  6750. } catch (e) {
  6751. console.log(e);
  6752. }
  6753. }
  6754. });
  6755. }
  6756. // 翻页类型 5(插入 iframe 方式加载下一页,无限套娃)
  6757. function insIframe(src) {
  6758. // 停用当前页面翻页
  6759. if (curSite.SiteTypeID == 0) return
  6760. curSite.SiteTypeID = 0;
  6761.  
  6762. // 创建 iframe
  6763. let iframe = document.createElement('iframe');
  6764. iframe.style = 'position: absolute; width: 100%; height: 100%; border: none;';
  6765. iframe.id = 'xiu_iframe';
  6766. iframe.src = src;
  6767.  
  6768. var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop
  6769. // 当滚动条到底部时(即完全显示 iframe 框架),隐藏当前页面的滚动条
  6770. window.addEventListener('scroll', function () {
  6771. let scrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  6772. clientHeight = document.documentElement.clientHeight || document.body.clientHeight,
  6773. scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight,
  6774. afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  6775. delta = afterScrollTop - beforeScrollTop;
  6776. if (delta == 0) return false;
  6777. beforeScrollTop = afterScrollTop;
  6778.  
  6779. //console.log(delta, (scrollTop + clientHeight + 10), scrollHeight, '1111')
  6780. if (delta > 0 && scrollTop + clientHeight + 10 >= scrollHeight && !getCSS('#xiu-scroll')) {
  6781. let newStyle = document.createElement('style'); newStyle.id = 'xiu-scroll';
  6782. newStyle.textContent = 'html::-webkit-scrollbar, body::-webkit-scrollbar {width: 0 !important;height: 0 !important;} html, body {scrollbar-width: none !important;}';
  6783. if (curSite.pager.style) newStyle.textContent += curSite.pager.style;
  6784. document.documentElement.appendChild(newStyle);
  6785. iframe.focus();
  6786. iframe.document.body.focus();
  6787. //iframe.document.body.click();
  6788. } else if (delta < 0 && getCSS('#xiu-scroll')) {
  6789. getCSS('#xiu-scroll').remove();
  6790. }
  6791. }, false);
  6792.  
  6793. // 加载完成后才继续
  6794. iframe.onload = function() {
  6795. // 添加历史记录
  6796. if (curSite.history !== false) addHistory(iframe.contentWindow.document, iframe.contentWindow.document.title);
  6797. // 当前页码 + 1
  6798. if (!curSite.hiddenPN) {
  6799. let autopageNumber = getCSS('#Autopage_number', window.top.document)
  6800. if (autopageNumber) {autopageNumber.textContent = parseInt(autopageNumber.textContent) + 1;}
  6801. }
  6802. }
  6803.  
  6804. // 插入 iframe
  6805. document.documentElement.appendChild(iframe);
  6806. }
  6807. // 翻页类型 6(通过 iframe 获取下一页动态加载内容,只有一个娃)
  6808. function insIframe_(src) {
  6809. // 暂停翻页
  6810. if (!pausePage) return
  6811. pausePage = false
  6812. //console.log(src)
  6813. // 如果不存在,则创建一个 iframe
  6814. let iframe = document.getElementById('xiu_iframe');
  6815. if (!iframe) {
  6816. iframe = document.createElement('iframe');
  6817. iframe.style = 'position: absolute; top: -9999px; left: -9999px; width: 100%; height: 100%; border: none; z-index: -999; /*visibility: hidden;*/';
  6818. iframe.id = 'xiu_iframe';
  6819. iframe.src = src;
  6820. }
  6821.  
  6822. // 加载完成后才继续
  6823. iframe.onload = function() {
  6824. //iframe.contentWindow.scrollTo(0, 999999); // 滚动到底部,以触发网页的滚动条相关加载事件
  6825. //iframe.contentWindow.scrollTo({top: 9999999, behavior: 'smooth'});
  6826. if (!curSite.pager.loadTime) curSite.pager.loadTime = 100; // 默认 100ms
  6827. //console.log(curSite.pager.loadTime, curSite.pager.loadTime/30)
  6828. //console.time('sort');
  6829. let time1 = 0 ,time2 = setInterval(function(){
  6830. let scrollHeight = (iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight)/10
  6831. iframe.contentWindow.scrollTo(0, 999999);
  6832. iframe.contentWindow.scrollTo(0, scrollHeight*time1);
  6833. //console.log(time1, iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight)
  6834. if (++time1 == 10) {
  6835. //console.timeEnd('sort');
  6836. clearInterval(time2);
  6837. processElems(iframe.contentWindow.document); // 插入/替换元素等
  6838. //console.log(iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight)
  6839. pausePage = true; // 恢复翻页
  6840. }
  6841. }, curSite.pager.loadTime/10)
  6842. }
  6843.  
  6844. // 插入 iframe(如果已存在则直接改 src)
  6845. if (document.getElementById('xiu_iframe')) {
  6846. iframe.src = src;
  6847. } else {
  6848. document.documentElement.appendChild(iframe);
  6849. }
  6850. }
  6851.  
  6852.  
  6853. // XHR 后处理结果,插入、替换元素等(适用于翻页类型 1/3/6)
  6854. function processElems(response) {
  6855. if (!curSite.pager.insertP) {curSite.pager.insertP = [curSite.pager.pageE, 5]}
  6856. let pageElems = getAll(curSite.pager.pageE, response, response), toElement;
  6857. if (curSite.pager.insertP[1] === 5) { // 插入 pageE 列表最后一个元素的后面
  6858. toElement = getAll(curSite.pager.insertP[0]).pop();
  6859. } else {
  6860. toElement = getOne(curSite.pager.insertP[0]);
  6861. }
  6862. //console.log(curSite.pager.pageE, pageElems, curSite.pager.insertP, toElement)
  6863.  
  6864. if (pageElems.length > 0 && toElement) {
  6865. // 如果有插入前函数就执行函数
  6866. if (curSite.function && curSite.function.bF) {
  6867. if (curSite.function.bFp) { // 如果指定了参数
  6868. if (typeof(curSite.function.bF) == 'string') { // 如果是字符串,说明是自定义规则
  6869. //console.log(curSite.function.bF, curSite.function.bFp)
  6870. pageElems = window.autoPage[curSite.function.bF](pageElems, curSite.function.bFp);
  6871. } else {
  6872. pageElems = curSite.function.bF(pageElems, curSite.function.bFp);
  6873. }
  6874. } else {
  6875. //console.log(curSite.function.bF)
  6876. if (typeof(curSite.function.bF) == 'string') { // 如果是字符串,说明是自定义规则
  6877. pageElems = window.autoPage[curSite.function.bF](pageElems);
  6878. } else {
  6879. pageElems = curSite.function.bF(pageElems);
  6880. }
  6881. }
  6882. }
  6883.  
  6884. // 插入位置
  6885. let addTo = getAddTo(curSite.pager.insertP[1]);
  6886.  
  6887. // 插入新页面元素
  6888. if (curSite.pager.insertP[1] === 6) { // 插入到目标内部末尾(针对文本,比如小说网页)
  6889. let afterend = '';
  6890. if (curSite.pager.insertP6Br) afterend += '<br/><br/>'
  6891. pageElems.forEach(function (one) {afterend += one.innerHTML;});
  6892. toElement.insertAdjacentHTML(addTo, afterend);
  6893. } else {
  6894. if (curSite.pager.insertP[1] === 2 || curSite.pager.insertP[1] === 4 || curSite.pager.insertP[1] === 5) pageElems.reverse(); // 插入到 [元素内头部]、[目标本身后面] 时,需要反转顺序
  6895. pageElems.forEach(function (one) {toElement.insertAdjacentElement(addTo, one);});
  6896. }
  6897.  
  6898. // 当前页码 + 1
  6899. pageNum.now = pageNum._now + 1
  6900.  
  6901. // 添加历史记录
  6902. if (curSite.history !== false) addHistory(response);
  6903.  
  6904. // 替换待替换元素
  6905. if (curSite.pager.replaceE) replaceElems(response);
  6906.  
  6907. // 插入 <script> 标签
  6908. if (curSite.pager.scriptT || curSite.pager.scriptT == 0) {
  6909. switch (curSite.pager.scriptT) {
  6910. case 0: // 下一页的所有 <script> 标签
  6911. insScript('script', toElement, response); break;
  6912. case 1: // 下一页的所有 <script> 标签(不包括 src 链接)
  6913. insScript('script:not([src])', toElement, response); break;
  6914. case 2: // 下一页主体元素 (pageE) 的同级 <script> 标签
  6915. insScript(null, toElement, pageElems); break;
  6916. case 3: // 下一页主体元素 (pageE) 的子元素 <script> 标签
  6917. insScript('script:not([src])', toElement, pageElems); break;
  6918. }
  6919. }
  6920.  
  6921. // 如果有插入后函数就执行函数
  6922. if (curSite.function && curSite.function.aF) {
  6923. if (curSite.function.aFp) { // 如果指定了参数
  6924. curSite.function.aF(curSite.function.aFp);
  6925. } else {
  6926. if (typeof(curSite.function.aF) == 'string') { // 如果是字符串,说明是自定义规则
  6927. //console.log(curSite.function.aF)
  6928. if (window.autoPage[curSite.function.aF]) {
  6929. window.autoPage[curSite.function.aF]();
  6930. } else {
  6931. new Function (curSite.function.aF)();
  6932. }
  6933. } else {
  6934. curSite.function.aF();
  6935. }
  6936. }
  6937. }
  6938. } else { // 获取主体元素失败后,尝试重新获取
  6939. console.log(curSite.pager.pageE, pageElems, curSite.pager.insertP, toElement)
  6940. if (curSite.retry) {
  6941. console.warn('[自动无缝翻页] 获取主体元素失败,尝试重新获取...')
  6942. setTimeout(function(){curSite.pageUrl = '';}, curSite.retry)
  6943. } else { // 尝试替换元素看能不能继续翻页下去
  6944. if (curSite.pager.replaceE) {
  6945. if (replaceElems(response)) { // 如果替换成功
  6946. console.log('[自动无缝翻页] 获取主体元素失败,尝试替换元素成功!')
  6947. pageNum.now = pageNum._now + 1; // 当前页码 + 1
  6948. if (curSite.history !== false) addHistory(response); // 添加历史记录
  6949. } else {console.error('[自动无缝翻页] 获取主体元素失败,尝试替换元素失败...')}
  6950. }
  6951. }
  6952. }
  6953. }
  6954. // 通用型插入前函数(加载图片)
  6955. function src_bF(pageElems, css) {
  6956. pageElems.forEach(function (one) {
  6957. if (css[0] == 0) { // src 图片
  6958. if (one.tagName == 'IMG' && one.getAttribute(css[2])) one.src = one.getAttribute(css[2]);
  6959. one.querySelectorAll(css[1]).forEach(function (now) {
  6960. now.src = now.getAttribute(css[2]);
  6961. });
  6962. } else if (css[0] == 1) { // 背景图片
  6963. if (one.tagName == 'IMG' && one.getAttribute(css[2])) one.style.backgroundImage = 'url("' + one.getAttribute(css[2]) + '")';
  6964. one.querySelectorAll(css[1]).forEach(function (now) {
  6965. now.style.backgroundImage = 'url("' + now.getAttribute(css[2]) + '")';
  6966. });
  6967. }
  6968. });
  6969. return pageElems
  6970. }
  6971. // 文字型插入前函数(正则过滤)
  6972. function xs_bF(pageElems, reg) {
  6973. pageElems.forEach(function (one) {
  6974. one.innerHTML = one.innerHTML.replace(reg[0], reg[1])
  6975. });
  6976. return pageElems
  6977. }
  6978.  
  6979. // 通用型获取下一页地址(从 元素 中获取页码)
  6980. function getNextE(css) {
  6981. if (!css) css = curSite.pager.nextL;
  6982. let next = getOne(css);
  6983. if (next && next.nodeType === 1 && next.href && next.href.slice(0,4) === 'http' && next.href != curSite.pageUrl) {
  6984. if (curSite.pager.forceHTTPS && location.protocol === 'https:') {
  6985. curSite.pageUrl = next.href.replace(/^http:/,'https:');
  6986. } else {
  6987. curSite.pageUrl = next.href;
  6988. }
  6989. //console.log(curSite.pageUrl)
  6990. return true
  6991. }
  6992. return false
  6993. }
  6994. // 通用型获取下一页地址(从 元素 中获取页码,URL 替换 page= 参数)
  6995. function getNextEP(css, pf, reg) {
  6996. let nextNum = getOne(css), url = '';
  6997. if (nextNum && nextNum.textContent) {
  6998. nextNum = nextNum.textContent.replaceAll(' ','');
  6999. if (location.search) {
  7000. if (indexOF(pf, 's')) {
  7001. url = location.search.replace(reg, pf + nextNum);
  7002. } else {
  7003. url = location.search + '&' + pf + nextNum;
  7004. }
  7005. } else {
  7006. url = '?' + pf + nextNum;
  7007. }
  7008. url = location.origin + location.pathname + url;
  7009. }
  7010. return url
  7011. }
  7012. // 通用型获取下一页地址(从 元素 中获取页码,URL 替换 pathname 路径)
  7013. function getNextEPN(css, reg, a, b = '') {
  7014. let nextNum = getOne(css), url = '';
  7015. if (nextNum && nextNum.textContent) {
  7016. nextNum = nextNum.textContent.replaceAll(' ','');
  7017. if (location.pathname) {
  7018. if (indexOF(reg)) {
  7019. url = location.pathname.replace(reg, a + nextNum + b);
  7020. } else {
  7021. url = location.pathname + a + nextNum + b;
  7022. }
  7023. } else {
  7024. url = location.pathname + a + nextNum + b;
  7025. }
  7026. url = location.origin + url;
  7027. }
  7028. return url
  7029. }
  7030. // 通用型获取下一页地址(从 URL 中获取页码,URL 替换 pathname 路径)
  7031. function getNextUPN(reg1, reg, a, b = '', initP = '2', endP) {
  7032. let nextNum = reg1.exec(location.pathname);
  7033. if (nextNum) {
  7034. nextNum = String(parseInt(nextNum[0])+1);
  7035. if (endP && (parseInt(nextNum[0]) > parseInt(endP))) return ''
  7036. } else {
  7037. nextNum = initP;
  7038. if (endP && (parseInt(nextNum[0]) >= parseInt(endP))) return ''
  7039. }
  7040. let url = '';
  7041. if (location.pathname) {
  7042. if (indexOF(reg)) {
  7043. url = location.pathname.replace(reg, a + nextNum + b);
  7044. } else {
  7045. url = location.pathname + a + nextNum + b;
  7046. }
  7047. } else {
  7048. url = location.pathname + a + nextNum + b;
  7049. }
  7050. url = location.origin + url;
  7051. return url
  7052. }
  7053. // 通用型获取下一页地址(从 URL 中获取页码,URL 替换 page= 参数)
  7054. function getNextUP(pf, reg, lp = location.pathname, initP = '2', endP) {
  7055. let nextNum = getSearch(pf.replace('=',''));
  7056. if (nextNum) {
  7057. nextNum = String(parseInt(nextNum)+1);
  7058. if (endP && (parseInt(nextNum) > parseInt(endP))) return ''
  7059. } else {
  7060. nextNum = initP;
  7061. if (endP && (parseInt(nextNum) >= parseInt(endP))) return ''
  7062. }
  7063. let url = '';
  7064. if (location.search) {
  7065. if (indexOF(pf, 's')) {
  7066. url = location.search.replace(reg, pf + nextNum);
  7067. } else {
  7068. url = location.search + '&' + pf + nextNum;
  7069. }
  7070. } else {
  7071. url = '?' + pf + nextNum;
  7072. }
  7073. url = location.origin + lp + url;
  7074. return url
  7075. }
  7076. // 通用型获取下一页地址(从 form input 中获取,返回 GET URL)
  7077. function getNextF(css) {
  7078. let form = getOne(css), value = '';
  7079. if (form) {
  7080. form.querySelectorAll('input[name]').forEach(function(input) {value += input.name + '=' + input.value + '&';}) // 生成表单参数
  7081. value = encodeURI(value.replace(/&$/,'')); // 清理最后一个 & 符号
  7082. if (form.action && value) return (form.action + '?' + value)
  7083. }
  7084. return '';
  7085. }
  7086.  
  7087.  
  7088. // 检查 URL
  7089. function checkURL(func) {
  7090. if (typeof curSite.pager.nextL == 'function') {
  7091. let tempUrl = curSite.pager.nextL();
  7092. if (!tempUrl || (tempUrl && tempUrl.slice(0,4) != 'http') || tempUrl === curSite.pageUrl ) return;
  7093. curSite.pageUrl = tempUrl;
  7094. func(curSite.pageUrl);
  7095. } else if (curSite.pager.nextL && curSite.pager.nextL.search(/^js;/i) === 0) { // 自定义翻页规则中执行 JavaScript 代码的
  7096. let tempUrl = new Function (curSite.pager.nextL.slice(3))();
  7097. if (!tempUrl || (tempUrl && tempUrl.slice(0,4) != 'http') || tempUrl === curSite.pageUrl ) return;
  7098. curSite.pageUrl = tempUrl;
  7099. func(curSite.pageUrl);
  7100. } else if (getNextE()) {
  7101. func(curSite.pageUrl);
  7102. }
  7103. //console.log(curSite.pageUrl);
  7104. }
  7105. // 替换元素
  7106. function replaceElems(pageElems, o = curSite.pager.replaceE, r = curSite.pager.replaceE) {
  7107. let oriE = getAll(o),
  7108. repE = getAll(r, pageElems, pageElems);
  7109. //console.log(oriE, repE)
  7110. if (oriE.length != 0 && repE.length != 0 && oriE.length === repE.length) {
  7111. for (let i = 0; i < oriE.length; i++) {
  7112. oriE[i].outerHTML = repE[i].outerHTML;
  7113. }
  7114. return true
  7115. }
  7116. return false
  7117. }
  7118. // 添加历史记录
  7119. function addHistory(pageElems, title, url) {
  7120. if (!curSite.pageUrl) return
  7121. // 对于自带类似功能 或者 覆盖了 history 原生函数的网站,则跳过不再添加历史记录
  7122. if (window.top.history.toString() !== '[object History]') return
  7123.  
  7124. //console.log(pageElems.querySelector('title'), curSite.pageUrl)
  7125. title = title || pageElems.querySelector('title').textContent || window.top.document.title;
  7126. url = url || curSite.pageUrl;
  7127. window.top.document.title = title;
  7128. window.top.document.xiu_nowUrl = curSite.pageUrl;
  7129. window.top.history.pushState('xiu_history', title, url);
  7130. }
  7131. // 插入 <Script>
  7132. function insScript(selector, toElement = document.body, contextNode = document) {
  7133. let scriptElems = contextNode;
  7134. if (selector) {
  7135. if (contextNode instanceof Array) {
  7136. scriptElems = []; contextNode.forEach(function (one) {scriptElems = scriptElems.concat(getAll(selector, one, one));})
  7137. } else {
  7138. scriptElems = getAll(selector, contextNode, contextNode);
  7139. }
  7140. }
  7141. scriptElems.forEach(function (one) {
  7142. if (one.tagName === 'SCRIPT') {
  7143. if (one.src) {
  7144. toElement.appendChild(document.createElement('script')).src = one.src;
  7145. } else {
  7146. toElement.appendChild(document.createElement('script')).textContent = one.textContent;
  7147. }
  7148. }
  7149. });
  7150. }
  7151. // 插入 <Style>
  7152. function insStyle(style) {
  7153. document.documentElement.appendChild(document.createElement('style')).textContent = style;
  7154. }
  7155.  
  7156.  
  7157. // 获取元素(CSS/Xpath)来自:https://github.com/machsix/Super-preloader
  7158. function getCSS(css, contextNode = document) {
  7159. return contextNode.querySelector(css);
  7160. }
  7161. function getAllCSS(css, contextNode = document) {
  7162. return [].slice.call(contextNode.querySelectorAll(css));
  7163. }
  7164. function getXpath(xpath, contextNode, doc = document) {
  7165. contextNode = contextNode || doc;
  7166. try {
  7167. const result = doc.evaluate(xpath, contextNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  7168. // 应该总是返回一个元素节点
  7169. return result.singleNodeValue && result.singleNodeValue.nodeType === 1 && result.singleNodeValue;
  7170. } catch (err) {
  7171. throw new Error(`无效 Xpath: ${xpath}`);
  7172. }
  7173. }
  7174. function getAllXpath(xpath, contextNode, doc = document) {
  7175. contextNode = contextNode || doc;
  7176. const result = [];
  7177. try {
  7178. const query = doc.evaluate(xpath, contextNode, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  7179. for (let i = 0; i < query.snapshotLength; i++) {
  7180. const node = query.snapshotItem(i);
  7181. // 如果是 Element 节点
  7182. if (node.nodeType === 1) result.push(node);
  7183. }
  7184. } catch (err) {
  7185. throw new Error(`无效 Xpath: ${xpath}`);
  7186. }
  7187. return result;
  7188. }
  7189. function getOne(selector, contextNode = undefined, doc = document) {
  7190. if (!selector) return;
  7191. contextNode = contextNode || doc;
  7192. if (selector.slice(0,1) === '/' || selector.slice(0,2) === './' || selector.slice(0,3) === 'id(') {
  7193. return getXpath(selector, contextNode, doc);
  7194. } else {
  7195. return getCSS(selector, contextNode);
  7196. }
  7197. }
  7198. function getAll(selector, contextNode = undefined, doc = document) {
  7199. if (!selector) return [];
  7200. contextNode = contextNode || doc;
  7201. if (selector.slice(0,1) === '/' || selector.slice(0,2) === './' || selector.slice(0,3) === 'id(') {
  7202. return getAllXpath(selector, contextNode, doc);
  7203. } else {
  7204. return getAllCSS(selector, contextNode);
  7205. }
  7206. }
  7207. function createDocumentByString(e) {
  7208. if (e) {
  7209. if ('HTML' !== document.documentElement.nodeName) return (new DOMParser).parseFromString(e, 'application/xhtml+xml');
  7210. var t;
  7211. try { t = (new DOMParser).parseFromString(e, 'text/html');} catch (e) {}
  7212. if (t) return t;
  7213. if (document.implementation.createHTMLDocument) {
  7214. t = document.implementation.createHTMLDocument('ADocument');
  7215. } else {
  7216. 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) {}
  7217. }
  7218. if (t) {
  7219. var r = document.createRange(),
  7220. n = r.createContextualFragment(e);
  7221. r.selectNodeContents(document.body);
  7222. t.body.appendChild(n);
  7223. 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);
  7224. return t;
  7225. }
  7226. } else console.error('没有找到要转成 DOM 的字符串');
  7227. }
  7228.  
  7229.  
  7230. // 强制新标签页打开链接(翻页模式 5/6)
  7231. function forceTarget() {
  7232. document.body.addEventListener('click', function(e) {
  7233. if (e.target.tagName === 'A') {
  7234. forceTarget_(e.target, e);
  7235. } else {
  7236. let path = e.path || e.composedPath();
  7237. for (let i = 1; i < path.length - 3; i++) {
  7238. //console.log(path[i])
  7239. if (path[i].tagName === 'A') {
  7240. forceTarget_(path[i], e);
  7241. break;
  7242. }
  7243. }
  7244. }
  7245. });
  7246.  
  7247. function forceTarget_(target, e){
  7248. if (target.href && target.target != '_blank' && !(target.getAttribute('onclick')) && target.href.slice(0,4) == 'http' && target.getAttribute('href').slice(0,1) != '#') {
  7249. e.preventDefault(); // 阻止默认打开链接事件
  7250. //console.log(target.href);
  7251. //window.top.location.href = target.href;
  7252. window.GM_openInTab(target.href, {active: true,insert: true,setParent: true});
  7253. }
  7254. }
  7255. //document.head.appendChild(document.createElement('base')).target = '_top';
  7256. }
  7257. // 判断元素是否隐藏(隐藏返回 true)
  7258. function isHidden(el){
  7259. return (el.offsetParent === null);
  7260. }
  7261. // 判断是否为手机版(是则返回 true)
  7262. function isMobile(){
  7263. return (/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|MicroMessenger|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(navigator.userAgent) || (window.screen.width < 500 && window.screen.height < 800));
  7264. }
  7265. // 判断 URL 是否存在指定文本
  7266. function indexOF(e, l = 'p', low = false){
  7267. switch (l) {
  7268. case 'h':
  7269. l = location.href; break;
  7270. case 'p':
  7271. l = location.pathname; break;
  7272. case 's':
  7273. l = location.search; break;
  7274. }
  7275. //console.log(l,e,l.indexOf(e))
  7276. if (low) {e = e.toLowerCase(); l = l.toLowerCase();} // 全部转为小写
  7277. if (e instanceof RegExp) {
  7278. if (e.test(l)) return true
  7279. } else {
  7280. if (l.indexOf(e) > -1) return true
  7281. }
  7282. return false
  7283. }
  7284. // 获取 Search 指定参数
  7285. function getSearch(variable) {
  7286. let query = window.location.search.substring(1),
  7287. vars = query.split('&');
  7288. for (var i=0;i<vars.length;i++) {
  7289. var pair = vars[i].split('=');
  7290. if(pair[0] == variable){return pair[1];}
  7291. }
  7292. return '';
  7293. }
  7294. // 启用/禁用 (当前网站)
  7295. function menu_disable(type) {
  7296. switch(type) {
  7297. case 'check':
  7298. return check(); break;
  7299. case 'add':
  7300. add(); break;
  7301. case 'del':
  7302. del(); break;
  7303. }
  7304.  
  7305. function check() { // 存在返回真,不存在返回假
  7306. if (GM_getValue('menu_disable').indexOf(location.hostname) == -1) return false // 不存在返回假
  7307. return true
  7308. }
  7309.  
  7310. function add() {
  7311. if (check()) return
  7312. let list = GM_getValue('menu_disable'); // 读取网站列表
  7313. list.push(location.hostname); // 追加网站域名
  7314. GM_setValue('menu_disable', list); // 写入配置
  7315. location.reload(); // 刷新网页
  7316. }
  7317.  
  7318. function del() {
  7319. if (!check()) return
  7320. let list = GM_getValue('menu_disable'), // 读取网站列表
  7321. index = list.indexOf(location.hostname);
  7322. list.splice(index, 1); // 删除网站域名
  7323. GM_setValue('menu_disable', list); // 写入配置
  7324. location.reload(); // 刷新网页
  7325. }
  7326. }
  7327. // 左键双击网页空白处暂停翻页
  7328. function pausePageEvent() {
  7329. if (!GM_getValue('menu_pause_page')) return
  7330. if (curSite.SiteTypeID === 0) return
  7331. if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
  7332. document.body.addEventListener('dblclick', function () {
  7333. if (pausePage) {GM_notification({text: `❌ 已暂停本页 [自动无缝翻页]\n (再次双击可恢复)`, timeout: 2000});} else {GM_notification({text: `✅ 已恢复本页 [自动无缝翻页]\n (再次双击可暂停)`, timeout: 2000});}
  7334. pausePage = !pausePage;
  7335. if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
  7336. });
  7337. }
  7338. // 自定义翻页规则
  7339. function customRules() {
  7340. if (getCSS('#Autopage_customRules')) return
  7341.  
  7342. let customRules = JSON.stringify(GM_getValue('menu_customRules', {}), null, '\t').replaceAll('functionS', 'url').replaceAll('css;', ''); // 改名过渡,过段时间将其移除
  7343. if (customRules == '{}') customRules = '{\n\t\n}'; // 引导用户插入位置
  7344. let _html = `<div id="Autopage_customRules" style="left: 0 !important; right: 0 !important; top: 0 !important; bottom: 0 !important; width: 100% !important; height: 100% !important; margin: auto !important; padding: 25px 10px 10px 10px !important; position: fixed !important; opacity: 0.95 !important; z-index: 99999 !important; background-color: #eee !important; color: #222 !important; font-size: 14px !important; overflow: scroll !important; text-align: left !important;">
  7345. <h3 style="font-size: 24px !important;"><strong># 自定义翻页规则(优先于脚本内置规则)-【将规则插入默认的 <code>{ }</code> 中间】</strong></h3>
  7346. <details>
  7347. <summary><kbd><strong>「 点击展开 查看示例 」(我把常用规则都塞进去了,方便需要的时候可直接复制一份修改使用)</strong></kbd></summary>
  7348. <ul style="list-style: disc !important; margin-left: 35px !important;">
  7349. <li>翻页规则为 JSON 格式,因此大家需要多少<strong>了解一点 JSON 的基本格式</strong>(主要就是逗号)。</li>
  7350. <li>具体的翻页规则说明、示例、NSFW 等网站规则,为了方便更新及补充,我都写到 <strong><a href="https://github.com/XIU2/UserScript/issues/176" target="_blank">Github</a> 及 <a href="https://greasyfork.org/scripts/419215" target="_blank">Greasyfork</a></strong> 里面了。</li>
  7351. <li>脚本会自动格式化规则,因此<strong>无需手动缩进、换行</strong>,只需把规则<strong>插入默认的 { } 中间</strong>即可。</li>
  7352. <li style="color: #ff3535 !important;">注意:不要完全照搬脚本内置规则,因为和标准 JSON 格式等有所差别,具体请对比下面示例规则。</li>
  7353. </ul>
  7354. <pre>
  7355. // 大多数网站一般都只需要像第一个 "aaa" 这样的规则(注意,不要连带着复制这几行注释说明)
  7356. // 其中 "scrollD" 是用来控制翻页敏感度的(越大就越早触发翻页,访问速度慢的网站需要调大,可省略(注意逗号),默认 1500)
  7357. // 每个规则第一行的规则名(即 "aaa": { )是唯一的,不能重复(包括与脚本内置规则),否则会被覆盖,支持中文
  7358. {
  7359. "aaa": {
  7360. "host": "aaa.com",
  7361. "url": "/xxx/",
  7362. "pager": {
  7363. "nextL": "xxx",
  7364. "pageE": "xxx",
  7365. "replaceE": "xxx",
  7366. "scrollD": 1000
  7367. }
  7368. },
  7369. "bbb": {
  7370. "host": ["bbb1.com", "bbb2.com"],
  7371. "url": "/^\\/s$/",
  7372. "style": ".aaaa {display: none !important;}",
  7373. "pager": {
  7374. "type": 1,
  7375. "nextL": "id('page')//a[contains(text(),'下一页') or text()='下一页']",
  7376. "pageE": "aaa",
  7377. "insertP": [".bbb",3],
  7378. "replaceE": ".page",
  7379. "scriptT": 1,
  7380. "interval": 500,
  7381. "scrollD": 1500
  7382. },
  7383. "function": {
  7384. "bF": "src_bF",
  7385. "bFp": [0,"img[data-src]","data-src"],
  7386. "aF": "document.body.appendChild(document.createElement('script')).textContent = 'xxx'"
  7387. }
  7388. },
  7389. "这里也可以用中文": {
  7390. "host": "/\\.ccc\\.com/",
  7391. "url": "return (location.pathname.indexOf('/s') > -1)",
  7392. "pager": {
  7393. "type": 2,
  7394. "nextL": "#autopbn",
  7395. "nextText": "下一页",
  7396. "nextTextOf": "下一页",
  7397. "interval": 1000,
  7398. "scrollD": 1500
  7399. }
  7400. }
  7401. }
  7402. </pre>
  7403. </details>
  7404.  
  7405. <textarea id="Autopage_customRules_textarea" style="min-width:95% !important; min-height:70% !important; display: block !important; margin: 10px 0 10px 0; white-space:nowrap !important; overflow:scroll !important; resize: auto !important; text-transform: initial !important;" placeholder="留空等于默认的 {},请把规则插入 {} 之间">${customRules}</textarea>
  7406. <button id="Autopage_customRules_save" style="margin-right: 20px !important;">保存并刷新</button><button id="Autopage_customRules_cancel">取消修改</button>
  7407. </div>`
  7408. document.documentElement.insertAdjacentHTML('beforeend', _html);
  7409. document.documentElement.style.overflow = document.body.style.overflow = 'hidden';
  7410. // 点击事件
  7411. getCSS('#Autopage_customRules_save').onclick = function () {
  7412. customRules = getCSS('#Autopage_customRules_textarea').value.replaceAll('functionS', 'url').replaceAll('css;', ''); // 改名过渡,过段时间将其移除
  7413. //console.log(customRules)
  7414. if (!customRules) customRules = '{}'
  7415. try {
  7416. customRules = JSON.parse(customRules)
  7417. //console.log(customRules)
  7418. GM_setValue('menu_customRules', customRules)
  7419. location.reload();
  7420. } catch (e) {
  7421. console.error('自定义规则存在格式错误:\n' + e + '\n\n注意事项:\n规则中冒号 : 左右的内容都需要加上双引号 " 而不能用单引号 \',如果内容中含有双引号则需要对双引号转义(即 \" 这样)或者改用单引号')
  7422. window.alert('自定义规则存在格式错误:\n' + e + '\n\n注意事项:\n规则中冒号 : 左右的内容都需要加上双引号 " 而不能用单引号 \',如果内容中含有双引号则需要对双引号转义(即 \" 这样)或者改用单引号');
  7423. }
  7424. }
  7425. getCSS('#Autopage_customRules_cancel').onclick = function () {document.documentElement.style.overflow = document.body.style.overflow = ''; getCSS('#Autopage_customRules').remove();}
  7426. }
  7427. // 显示页码
  7428. function pageNumber(type) {
  7429. if (curSite.SiteTypeID === 0 || curSite.hiddenPN || (curSite.pager && curSite.pager.type == 5 && self != top)) {if (getCSS('#Autopage_number')) {getCSS('#Autopage_number').style.display = 'none';}; return}
  7430. let status = getCSS('#Autopage_number');
  7431. switch (type) {
  7432. case 'add':
  7433. add(); break;
  7434. case 'del':
  7435. del(); break;
  7436. case 'set':
  7437. set(); break;
  7438. }
  7439.  
  7440. function add(){
  7441. if (status) {
  7442. if (status.style.display === 'none') {status.style.display = 'flex';}
  7443. return
  7444. }
  7445. // 插入网页
  7446. let _style = `<style>#Autopage_number {top: calc(75vh) !important;left: 0 !important;width: 32px;height: 32px;padding: 6px !important;display: flex;position: fixed !important;opacity: 0.3;transition: .2s;z-index: 9999 !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;font-size: medium;} #Autopage_number:hover {opacity: 0.8;transform: translateX(0);}</style>`,
  7447. _html = `<div id="Autopage_number" title="1. 此处数字为 [当前页码] (可在脚本菜单中关闭)&#10;&#10;2. 鼠标左键点击此处可 [临时暂停翻页](再次点击可恢复)">${pageNum._now}</div>`
  7448. document.documentElement.insertAdjacentHTML('beforeend', _style + _html);
  7449. // 解决 远景论坛 会清理掉前面插入的 CSS 样式的问题
  7450. if (location.hostname === 'bbs.pcbeta.com') {setTimeout(function(){document.documentElement.insertAdjacentHTML('beforeend', _style);}, 500);}
  7451. if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
  7452. // 点击事件(临时暂停翻页)
  7453. getCSS('#Autopage_number').onclick = function () {
  7454. if (pausePage) {this.style = 'color: #FF5722 !important; font-style: italic !important;';} else {this.style = '';}
  7455. pausePage = !pausePage;
  7456. if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
  7457. };
  7458. status = getCSS('#Autopage_number');
  7459. set();
  7460. }
  7461. // 监听储存当前页码的对象值的变化
  7462. function set(){
  7463. Object.defineProperty(pageNum, 'now', {
  7464. set: function(value) {
  7465. this._now = value;
  7466. if (status) status.textContent = value;
  7467. }
  7468. });
  7469. }
  7470. function del(){
  7471. if (!status) return
  7472. status.style.display = 'none';
  7473. }
  7474. }
  7475. // 菜单开关
  7476. function menu_switch(menu_status, Name, Tips) {
  7477. if (menu_status === true){
  7478. GM_setValue(Name, false);
  7479. } else {
  7480. GM_setValue(Name, true);
  7481. }
  7482. if (Name === 'menu_page_number') {
  7483. if (menu_status === true){pageNumber('del');} else {pageNumber('add');}
  7484. registerMenuCommand(); // 重新注册脚本菜单
  7485. } else {
  7486. location.reload();}
  7487. };
  7488. // 生成 SiteTypeID
  7489. function setSiteTypeID() {
  7490. let num = 0
  7491. for (let val in DBSite) {
  7492. DBSite[val].SiteTypeID = num = num + 1;
  7493. }
  7494. }
  7495. // 获取 Cookie
  7496. function getCookie(name) {
  7497. if (!name) return ''
  7498. let arr = document.cookie.split(';');
  7499. name += '='
  7500. for (let i=0; i<arr.length; i++) {
  7501. let now = arr[i].trim();
  7502. if (now.indexOf(name) == 0) return now.substring(name.length, now.length);
  7503. }
  7504. return '';
  7505. }
  7506. // 插入位置
  7507. function getAddTo(num) {
  7508. switch (num) {
  7509. case 1:
  7510. return 'beforebegin'; break;
  7511. case 2:
  7512. return 'afterbegin'; break;
  7513. case 3:
  7514. case 6:
  7515. return 'beforeend'; break;
  7516. case 4:
  7517. case 5:
  7518. return 'afterend'; break;
  7519. }
  7520. }
  7521. // 滚动条事件
  7522. function windowScroll(fn1) {
  7523. var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  7524. fn = fn1 || function () {};
  7525. setTimeout(function () { // 延时 1 秒执行,避免刚载入到页面就触发翻页事件
  7526. window.addEventListener('scroll', function (e) {
  7527. var afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  7528. delta = afterScrollTop - beforeScrollTop;
  7529. if (delta == 0) return false;
  7530. fn(delta > 0 ? 'down' : 'up', e);
  7531. beforeScrollTop = afterScrollTop;
  7532. }, false);
  7533. }, 1000)
  7534. }
  7535. // 自定义 urlchange 事件(用来监听 URL 变化)
  7536. function addUrlChangeEvent() {
  7537. history.pushState = ( f => function pushState(){
  7538. var ret = f.apply(this, arguments);
  7539. window.dispatchEvent(new Event('pushstate'));
  7540. window.dispatchEvent(new Event('urlchange'));
  7541. return ret;
  7542. })(history.pushState);
  7543.  
  7544. history.replaceState = ( f => function replaceState(){
  7545. var ret = f.apply(this, arguments);
  7546. window.dispatchEvent(new Event('replacestate'));
  7547. window.dispatchEvent(new Event('urlchange'));
  7548. return ret;
  7549. })(history.replaceState);
  7550.  
  7551. window.addEventListener('popstate',()=>{
  7552. window.dispatchEvent(new Event('urlchange'))
  7553. });
  7554. }
  7555. })();