自动无缝翻页

无缝拼接下一页内容(瀑布流),目前支持:【所有「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-03-02 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name 自动无缝翻页
  3. // @name:zh-CN 自动无缝翻页
  4. // @name:zh-TW 自動無縫翻頁
  5. // @name:en AutoPager
  6. // @version 5.1.0
  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', '自定义翻页规则 (beta)', '自定义翻页规则 (beta)', {}]
  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 = {lp: ()=>location.pathname, indexOF: indexOF, getAll: getAll, getOne: getOne, getAllXpath: getAllXpath, getXpath: getXpath, getAllCSS: getAllCSS, getCSS: getCSS, getNextE: getNextE, getNextEP: getNextEP, getNextEPN: getNextEPN, getNextUPN: getNextUPN, getNextUP: getNextUP, getNextF: getNextF, insStyle: insStyle, 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://gf.qytechs.cn/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});});
  71. menuId[1] = GM_registerMenuCommand('🔄 更新外置翻页规则', function(){getRulesUrl(true)});
  72. menuId[2] = GM_registerMenuCommand('#️⃣ 自定义翻页规则 (beta)', function(){customRules()});
  73. console.info('[自动无缝翻页] - 暂不支持当前网页 [ ' + location.href + ' ],欢迎申请支持: https://github.com/XIU2/UserScript / https://gf.qytechs.cn/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(){getRulesUrl(true)});
  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://gf.qytechs.cn/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('fun', DBSite[now].url)(window.autoPage) === 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('fun', DBSite[now].url)(window.autoPage) === 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: pageE => { // 插入前函数(过滤相关搜索)
  675. if (getXpath('//div[contains(@class,"-header") and string()="相关搜索"]', pageE[pageE.length - 1])) pageE[pageE.length - 1].style.display = 'none';
  676. return pageE
  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')) getPageE_(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: pageE => { // 插入前函数(修改当前网页中的 吐槽 等按钮,避免重复添加点击事件)
  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 pageE
  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: pageE => {
  1315. pageE.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 pageE
  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)/, 'bbs.imoutolove.me'],
  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: pageE => { // 插入前函数(移除下一页底部的 "更多相关内容请关注:xxx" 文字 + 加载图片)
  2172. pageE.forEach(function (one) {if (one.tagName === 'P' && one.textContent.indexOf('更多相关内容请关注') > -1) {one.style.display = 'none';}});
  2173. return src_bF(pageE, [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: pageE => { // 插入前函数(过滤置顶帖子)
  2258. for (let i = 0; i < pageE.length; i++) {if (pageE[i].textContent.replace(/\n| /g,'') === 'Topics') {pageE.splice(0,i+1); break;}}
  2259. return pageE
  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: pageE => { // 插入前函数(鼠标指向显示封面)
  2815. pageE.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 pageE
  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: 'webhd.cc',
  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: pageE => { // 插入前函数(隐藏底部元素)
  2881. pageE.forEach(function (one) {let now = one.querySelector('[id^="list_top"], [id^="list_bottom"]'); if (now) {one.hidden = true;};});
  2882. return pageE
  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. acs: {
  4050. host: ['pubs.acs.org','onlinelibrary.wiley.com'],
  4051. url: ()=> {if (indexOF('/doSearch')) {curSite = DBSite.acs;}},
  4052. pager: {
  4053. nextL: 'a.pagination__btn--next',
  4054. pageE: 'ul.items-results > *',
  4055. replaceE: '.pagination',
  4056. scrollD: 3000
  4057. }
  4058. }, // Wiley Online Library + ACS (Publications)
  4059. libgen: {
  4060. host: /libgen/,
  4061. url: ()=> {if (lp == '/search.php') {curSite = DBSite.libgen;}},
  4062. pager: {
  4063. nextL: '//font/a[contains(text(), "►")]',
  4064. pageE: 'table[rules="rows"] > tbody > tr:nth-of-type(n+2), .paginator+script:not([src])',
  4065. insertP: ['table[rules="rows"] > tbody', 3],
  4066. replaceE: '//td[./font/a[contains(text(), "►")]]',
  4067. scriptT: 2,
  4068. scrollD: 2000
  4069. }
  4070. }, // Library Genesis
  4071. sciencedirect: {
  4072. host: 'www.sciencedirect.com',
  4073. url: ()=> {locationC = true; if (lp == '/search') {curSite = DBSite.sciencedirect; setTimeout(function(){insStyle('html, body {height: ' + (document.documentElement.scrollHeight || document.body.scrollHeight) + 'px;}')}, 2000)}},
  4074. style: 'footer {display: none !important;}',
  4075. iframe: true,
  4076. pager: {
  4077. type: 5,
  4078. nextL: 'a[data-aa-name="srp-next-page"]',
  4079. scrollD: 2000
  4080. }
  4081. }, // ScienceDirect
  4082. Z_Library: {
  4083. host: /(\dlib|b-ok\d?|booksc|z-lib)\./,
  4084. url: ()=> {if (indexOF('/s/')) {curSite = DBSite.Z_Library;}},
  4085. pager: {
  4086. nextL: '//div[@class="paginator"]//span/strong/parent::span/parent::td/following-sibling::td[1]//a',
  4087. pageE: 'id("searchResultBox")/div | //script[contains(string(), "pagerOptions")]',
  4088. insertP: ['#searchResultBox', 3],
  4089. replaceE: '.paginator',
  4090. scriptT: 2,
  4091. scrollD: 2000
  4092. },
  4093. function: {
  4094. bF: src_bF,
  4095. bFp: [0, 'img[data-src]', 'data-src']
  4096. }
  4097. }, // Z-Library
  4098. pubmed: {
  4099. host: 'pubmed.ncbi.nlm.nih.gov',
  4100. pager: {
  4101. type: 2,
  4102. nextL: 'button.load-button.next-page',
  4103. nextText: 'Show more results',
  4104. scrollD: 1500
  4105. }
  4106. }, // PubMed
  4107. x_mol: {
  4108. host: 'www.x-mol.com',
  4109. url: ()=> {if (indexOF('/search/q') || indexOF('/paper/')) {curSite = DBSite.x_mol;}},
  4110. pager: {
  4111. nextL: ()=> getNextEP('.pagination li.active+li > a', 'pageIndex=', /pageIndex=\d+/),
  4112. pageE: '.magazine-senior-search-results-list > ul > li, .magazine-model-content-new > ul > li',
  4113. insertP: ['.magazine-senior-search-results-list > ul, .magazine-model-content-new > ul', 3],
  4114. replaceE: '.pagination',
  4115. scrollD: 2000
  4116. }
  4117. }, // X-MOL
  4118. cqvip: {
  4119. host: 'www.cqvip.com',
  4120. url: ()=> {if (indexOF('/search')) {curSite = DBSite.cqvip;}},
  4121. pager: {
  4122. type: 6,
  4123. nextL: '//ul[@class="pagenum"]//a[text()="下一页"]',
  4124. pageE: 'ul.prolist:last-child > li',
  4125. replaceE: 'ul.pagenum',
  4126. loadTime: 1000,
  4127. scrollD: 2000
  4128. }
  4129. }, // 维普网
  4130. ablesci: {
  4131. host: 'www.ablesci.com',
  4132. url: ()=> {if (indexOF('/detail')) {curSite = DBSite.ablesci_p;} else if (getCSS('ul.fly-list')) {curSite = DBSite.ablesci;}},
  4133. pager: {
  4134. nextL: 'li.next > a',
  4135. pageE: 'ul.fly-list > li',
  4136. replaceE: '.pages',
  4137. scrollD: 2000
  4138. }
  4139. }, // 科研通
  4140. ablesci_p: {
  4141. thread: true,
  4142. pager: {
  4143. nextL: 'li.next > a',
  4144. pageE: 'ul#jieda > li',
  4145. replaceE: '.pages',
  4146. scrollD: 2000
  4147. }
  4148. }, // 科研通 - 帖子内
  4149. coolkeyan: {
  4150. host: 'www.coolkeyan.com',
  4151. url: ()=> {if (location.hash.indexOf('/project/') > -1) curSite = DBSite.coolkeyan;},
  4152. style: '.q-img {height: auto !important;} .q-img__image {max-height: 1000px !important;} .row.q-my-sm.q-gutter-sm {display: none !important;}',
  4153. pager: {
  4154. type: 4,
  4155. nextL: coolkeyan_nextL,
  4156. insertP: ['//div[contains(@class, "q-img__image")][last()]', 4],
  4157. insertE: coolkeyan_insertE,
  4158. scrollD: 1500
  4159. }
  4160. }, // 酷科研
  4161. muchong: {
  4162. host: 'muchong.com',
  4163. url: ()=> {if (indexOF('/f-') || indexOF('search.php')) {
  4164. curSite = DBSite.muchong;
  4165. } else if (indexOF('/t-')) {
  4166. curSite = DBSite.muchong; curSite.pager.pageE = '#maincontent > table > tbody:not(.header)'; curSite.pager.scrollD = 2000; curSite.thread = true;
  4167. }},
  4168. style: 'tr.forum_head {display: none !important;}',
  4169. pager: {
  4170. nextL: '//div[contains(@class, "xmc_Pages")]//a[text()="下一页"]',
  4171. pageE: '.forum_body table > tbody',
  4172. replaceE: '.xmc_Pages',
  4173. scrollD: 1500
  4174. }
  4175. }, // 小木虫
  4176. google_scholar: {
  4177. host: 'scholar.google.com',
  4178. url: ()=> {if (lp == '/scholar') {curSite = DBSite.google_scholar;}},
  4179. pager: {
  4180. nextL: '//a[./span[contains(@class, "next")]]',
  4181. pageE: '#gs_res_ccl_mid > *',
  4182. insertP: ['#gs_res_ccl_mid', 3],
  4183. replaceE: '#gs_n',
  4184. scriptT: 1,
  4185. scrollD: 2000
  4186. }
  4187. }, // 谷歌学术
  4188. google_scholar_: {
  4189. host: 'sc.panda321.com',
  4190. pager: {
  4191. nextL: '//a[./span[contains(@class, "next")]]',
  4192. pageE: '#gs_res_ccl_mid > *',
  4193. insertP: ['#gs_res_ccl_mid', 3],
  4194. replaceE: '#gs_n',
  4195. scriptT: 1,
  4196. scrollD: 2000
  4197. },
  4198. function: {
  4199. bF: pageE => {
  4200. getCSS('#gs_n').remove();
  4201. return pageE
  4202. }
  4203. }
  4204. }, // 谷歌学术 - 其他镜像站
  4205. bing_academic: {
  4206. style: 'li.aca_algo_count {display: none !important;}',
  4207. pager: {
  4208. nextL: 'a.sb_pagN',
  4209. pageE: '#b_results > li.aca_algo',
  4210. replaceE: '#b_results .b_pag',
  4211. scrollD: 1000
  4212. }
  4213. }, // 必应学术
  4214. baidu_xueshu: {
  4215. host: 'xueshu.baidu.com',
  4216. url: ()=> {if (lp == '/s') {
  4217. curSite = DBSite.baidu_xueshu;
  4218. } else if (indexOF('journal/navigation')) {
  4219. curSite = DBSite.baidu_xueshu_journal;
  4220. } else if (indexOF('paper/show')) {
  4221. curSite = DBSite.baidu_xueshu_paper;
  4222. }},
  4223. pager: {
  4224. nextL: 'id("page")/a[./i[@class="c-icon-pager-next"]]',
  4225. pageE: '#bdxs_result_lists > div.result',
  4226. replaceE: '#page',
  4227. scrollD: 1000
  4228. }
  4229. }, // 百度学术
  4230. baidu_xueshu_journal: {
  4231. pager: {
  4232. nextL: 'a.res-page-next',
  4233. pageE: '#journaldetail > div',
  4234. replaceE: '.res-page',
  4235. scrollD: 1000
  4236. }
  4237. }, // 百度学术
  4238. baidu_xueshu_paper: {
  4239. pager: {
  4240. type: 2,
  4241. nextL: 'div:not([style*="display: none"]) > .more_btn',
  4242. nextText: '加载更多',
  4243. scrollD: 1000
  4244. }
  4245. }, // 百度学术
  4246. so_xueshu: {
  4247. host: 'xueshu.so.com',
  4248. url: ()=> {if (lp == '/s') {curSite = DBSite.so_xueshu;}},
  4249. pager: {
  4250. nextL: 'a#snext',
  4251. pageE: 'ul.list > li',
  4252. replaceE: '#page',
  4253. scrollD: 1000
  4254. }
  4255. }, // 360 学术
  4256. wanfangdata: {
  4257. host: 's.wanfangdata.com.cn',
  4258. url: ()=> {locationC = true; curSite = DBSite.wanfangdata;},
  4259. style: '#zkFooter {display: none !important;}',
  4260. iframe: true,
  4261. pager: {
  4262. type: 5,
  4263. nextL: ()=> getNextEP('.pager.active+span.pager', 'p=', /p=\d+/),
  4264. scrollD: 2000
  4265. }
  4266. }, // 万方数据知识服务
  4267. nsfc: {
  4268. host: ['output.nsfc.gov.cn', 'kd.nsfc.gov.cn'],
  4269. url: ()=> {if (indexOF('/conclusionProject/')) curSite = DBSite.nsfc;},
  4270. style: '#pageNoUl {display: none !important;}',
  4271. pager: {
  4272. type: 4,
  4273. nextL: nsfc_nextL,
  4274. insertP: ['#pageNoUl', 1],
  4275. insertE: nsfc_insertE,
  4276. scrollD: 1500
  4277. }
  4278. }, // 国家自然科学基金
  4279. stackoverflow: {
  4280. host: 'stackoverflow.com',
  4281. url: ()=> {if (indexOF('/questions') && !indexOF(/\/questions\/\d+\//)) {
  4282. curSite = DBSite.stackoverflow;
  4283. } else if (lp == '/search') {
  4284. curSite = DBSite.stackoverflow_search;
  4285. } else if (lp == '/tags') {
  4286. curSite = DBSite.stackoverflow_tags;
  4287. } else if (lp == '/users') {
  4288. curSite = DBSite.stackoverflow_users;
  4289. }},
  4290. pager: {
  4291. nextL: 'a[rel="next"]',
  4292. pageE: '#questions > div',
  4293. replaceE: '.pager',
  4294. scrollD: 2000
  4295. }
  4296. }, // StackOverflow - Questions
  4297. stackoverflow_tags: {
  4298. pager: {
  4299. nextL: 'a[rel="next"]',
  4300. pageE: '#tags-browser > div',
  4301. replaceE: '.pager',
  4302. scrollD: 2000
  4303. }
  4304. }, // StackOverflow - Tags
  4305. stackoverflow_users: {
  4306. pager: {
  4307. nextL: 'a[rel="next"]',
  4308. pageE: '#user-browser > div:first-child > div',
  4309. replaceE: '.pager',
  4310. scrollD: 2000
  4311. }
  4312. }, // StackOverflow - Users
  4313. stackoverflow_search: {
  4314. pager: {
  4315. nextL: 'a[rel="next"]',
  4316. pageE: '.js-search-results > div:first-child > div',
  4317. replaceE: '.pager',
  4318. scrollD: 2000
  4319. }
  4320. }, // StackOverflow - Search
  4321. segmentfault: {
  4322. host: 'segmentfault.com',
  4323. url: ()=> {locationC = true;
  4324. if (indexOF('/questions')) {
  4325. curSite = DBSite.segmentfault;
  4326. } else if (lp == '/search') {
  4327. curSite = DBSite.segmentfault_search;
  4328. }},
  4329. pager: {
  4330. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  4331. pageE: 'ul.list-group > li',
  4332. replaceE: 'ul.pagination',
  4333. scrollD: 1000
  4334. }
  4335. }, // SegmentFault - Questions
  4336. segmentfault_search: {
  4337. pager: {
  4338. nextL: 'a[rel="next"]',
  4339. pageE: '.search-result > section',
  4340. replaceE: 'ul.pagination',
  4341. scrollD: 1000
  4342. }
  4343. }, // SegmentFault - Search
  4344. w3school_com_cn: {
  4345. host: 'www.w3school.com.cn',
  4346. url: ()=> {if (location.pathname.split('/').length > 2) {curSite = DBSite.w3school_com_cn;}},
  4347. style: '#maincontent h1:not(:nth-of-type(1)) {margin-top: 30px;}',
  4348. pager: {
  4349. type: 3,
  4350. nextL: ()=> { // 过滤部分非本页的参考手册
  4351. let next = getCSS('li.next > a[href]')
  4352. if (next && next.href.indexOf('/index.') === -1) return next.href;
  4353. curSite = {SiteTypeID: 0}; return ''
  4354. },
  4355. pageE: '#maincontent > *:not([class*="prenextnav"]):not(#bpn):not(#tpn)',
  4356. insertP: ['id("bpn") | //div[contains(@class, "prenextnav")][last()]', 1],
  4357. replaceE: 'ul.prenext, #navsecond',
  4358. scrollE: 'id("bpn") | //div[contains(@class, "prenextnav")][last()]',
  4359. forceHTTPS: true,
  4360. scrollD: 600
  4361. }
  4362. }, // W3school
  4363. w3cschool_cn: {
  4364. host: 'www.w3cschool.cn',
  4365. url: ()=> {if (location.pathname.split('/').length > 2) {curSite = DBSite.w3cschool_cn;}},
  4366. style: '.widget-body, #rfbanner {display: none !important;}',
  4367. pager: {
  4368. nextL: '.next-link > a',
  4369. pageE: '#pro-mian-header, .content-bg',
  4370. replaceE: '.content-links, .splitter-sidebar',
  4371. scrollD: 1500
  4372. }
  4373. }, // W3Cschool
  4374. runoob: {
  4375. host: 'www.runoob.com',
  4376. url: ()=> {if (location.pathname.split('/').length > 2 && getCSS('#leftcolumn')) {curSite = DBSite.runoob;}},
  4377. style: '#comments, #postcomments, #respond, #footer {display: none !important;} .article-intro h1:not(:nth-of-type(1)) {margin: 30px 0 10px 0;}',
  4378. pager: {
  4379. nextL: ()=> { // 过滤部分非本页的参考手册
  4380. let next = getCSS('#leftcolumn > a[style]~a[href]')
  4381. if (next && next.href.split('/').length === location.href.split('/').length && next.href.split('/')[3] === location.href.split('/')[3]) return next.href;
  4382. next.href = location.href; curSite = {SiteTypeID: 0}; return ''
  4383. },
  4384. pageE: '#content > *, script[src*="assets/js/main.min.js"]',
  4385. insertP: ['#content', 3],
  4386. replaceE: '.previous-next-links, #leftcolumn',
  4387. scriptT: 2,
  4388. forceHTTPS: true,
  4389. scrollD: 1000
  4390. }
  4391. }, // 菜鸟教程
  4392. cnblogs: {
  4393. host: ['www.cnblogs.com', 'zzk.cnblogs.com'],
  4394. url: ()=> {
  4395. if (location.hostname === 'zzk.cnblogs.com') {
  4396. curSite = DBSite.cnblogs_search;
  4397. } else if (getCSS('#post_list')) {
  4398. curSite = DBSite.cnblogs_list;
  4399. } else if (location.pathname.split('/').length === 3 && getCSS('.topicListFooter')) {
  4400. curSite = DBSite.cnblogs;
  4401. if (!getCSS('#homepage_top_pager')) {
  4402. getCSS('.forFlow').insertAdjacentHTML(getAddTo(2), '<div id="homepage_top_pager" class="topicListFooter"></div>');
  4403. getCSS('.forFlow').insertAdjacentHTML(getAddTo(3), '<div id="homepage_bottom_pager" class="topicListFooter"></div>');
  4404. }
  4405. }
  4406. },
  4407. pager: {
  4408. nextL: '//div[@class="topicListFooter"]//a[contains(text(), "下一页")]',
  4409. pageE: 'div.day',
  4410. replaceE: '.topicListFooter',
  4411. scrollD: 1000
  4412. }
  4413. }, // 博客园 - 文章列表(个人)
  4414. cnblogs_list: {
  4415. pager: {
  4416. nextL: '//div[@class="pager"]//a[contains(text(), ">")]',
  4417. pageE: '#post_list > article',
  4418. replaceE: '.pager',
  4419. scrollD: 1000
  4420. }
  4421. }, // 博客园 - 文章列表
  4422. cnblogs_search: {
  4423. pager: {
  4424. nextL: '//div[@class="pager"]//a[contains(text(), ">")]',
  4425. pageE: 'div.searchItem',
  4426. replaceE: '.pager',
  4427. scrollD: 1000
  4428. }
  4429. }, // 博客园 - 搜索页
  4430. gitee: {
  4431. host: 'gitee.com',
  4432. url: ()=> {
  4433. if (indexOF('/explore/')) {
  4434. curSite = DBSite.gitee;
  4435. } else if (indexOF(/\/issues$/)) {
  4436. curSite = DBSite.gitee_issues;
  4437. } else if (indexOF(/\/releases/)) {
  4438. curSite = DBSite.gitee_releases;
  4439. } else if (indexOF(/\/tags/)) {
  4440. curSite = DBSite.gitee_tags;
  4441. }
  4442. if (curSite.SiteTypeID > 0 && !curSite.pager.nextL) {
  4443. curSite.pager.type = 1;
  4444. curSite.pager.nextL = 'a[rel="next"]';
  4445. curSite.pager.replaceE = '.pagination';
  4446. curSite.pager.scrollD = 2500;
  4447. }
  4448. },
  4449. pager: {
  4450. pageE: '.items > .item',
  4451. }
  4452. }, // Gitee - Explore 列表
  4453. gitee_issues: {
  4454. pager: {
  4455. pageE: '.issue-wrapper',
  4456. }
  4457. }, // Gitee - Issues 列表
  4458. gitee_releases: {
  4459. pager: {
  4460. pageE: '.release-tag-item',
  4461. }
  4462. }, // Gitee - Releases 列表
  4463. gitee_tags: {
  4464. pager: {
  4465. pageE: '.tag-item',
  4466. }
  4467. }, // Gitee - Tags 列表
  4468. gitee_search: {
  4469. host: 'search.gitee.com',
  4470. url: ()=> {if (location.search) curSite = DBSite.gitee_search;},
  4471. pager: {
  4472. nextL: 'li.next:not(.disabled) > a',
  4473. pageE: '#hits-list > div',
  4474. replaceE: 'ul.pagination',
  4475. scrollD: 1000
  4476. }
  4477. }, // Gitee - Search 列表
  4478. github: {
  4479. host: ['github.com', 'hub.fastgit.org'],
  4480. url: ()=> {locationC = true;
  4481. if (lp == '/') {
  4482. curSite = DBSite.github;
  4483. } else if (indexOF('tab=stars', 's')) {
  4484. curSite = DBSite.github_star;
  4485. } else if (indexOF('tab=repositories', 's')) {
  4486. curSite = DBSite.github_repositories;
  4487. } else if (indexOF(/\/issues$/) || indexOF(/\/pulls$/)) {
  4488. curSite = DBSite.github_issues;
  4489. } else if (indexOF(/\/discussions$/) || indexOF('/discussions/categories')) {
  4490. curSite = DBSite.github_discussions;
  4491. } else if (indexOF(/\/releases$/)) {
  4492. curSite = DBSite.github_releases;
  4493. } else if (indexOF(/\/tags$/)) {
  4494. curSite = DBSite.github_tags;
  4495. } else if (indexOF('/commits')) {
  4496. curSite = DBSite.github_commits;
  4497. } else if (indexOF('/notifications')) {
  4498. curSite = DBSite.github_notifications;
  4499. } else if (indexOF('/search')) {
  4500. if (!location.search) return
  4501. if (!indexOF('type=', 's')) {
  4502. if (lp == '/search') {
  4503. curSite = DBSite.github_search_repositories;
  4504. } else {
  4505. curSite = DBSite.github_search_code;
  4506. }
  4507. } else {
  4508. curSite = DBSite['github_search_' + /type=[a-z]+/.exec(location.search.toLowerCase())[0].replace('type=','')];
  4509. }
  4510. if (curSite.SiteTypeID > 0 && !curSite.pager.nextL) {
  4511. curSite.pager.type = 1;
  4512. curSite.pager.nextL = 'a.next_page';
  4513. curSite.pager.replaceE = '.pagination';
  4514. curSite.pager.scrollD = 3000;
  4515. }
  4516. }},
  4517. pager: {
  4518. type: 2,
  4519. nextL: '.ajax-pagination-btn',
  4520. nextText: 'More',
  4521. scrollD: 2500
  4522. }
  4523. }, // Github - 首页
  4524. github_star: {
  4525. pager: {
  4526. nextL: '//div[@class="paginate-container"]//a[contains(text(), "Next")]',
  4527. pageE: '#js-pjax-container .position-relative div[class^="col-lg-"] > div:not(.position-relative):not(.paginate-container)',
  4528. insertP: ['.paginate-container', 1],
  4529. replaceE: '.paginate-container',
  4530. scrollD: 3000
  4531. }
  4532. }, // Github - 用户 Star 列表
  4533. github_repositories: {
  4534. pager: {
  4535. nextL: '//div[@class="paginate-container"]//a[contains(text(), "Next")]',
  4536. pageE: '#user-repositories-list > ul > li',
  4537. replaceE: '.paginate-container',
  4538. scrollD: 3000
  4539. }
  4540. }, // Github - 用户 项目 列表
  4541. github_issues: {
  4542. pager: {
  4543. nextL: 'a.next_page',
  4544. pageE: '.js-navigation-container.js-active-navigation-container > div[id^="issue_"]',
  4545. replaceE: '.pagination',
  4546. scrollD: 3000
  4547. }
  4548. }, // Github - Issues 列表 / PR 列表
  4549. github_discussions: {
  4550. pager: {
  4551. nextL: 'a.next_page',
  4552. pageE: 'ul[aria-labelledby="discussions-list"] > li',
  4553. replaceE: '.pagination',
  4554. scrollD: 3000
  4555. }
  4556. }, // Github - Discussions 列表
  4557. github_releases: {
  4558. pager: {
  4559. nextL: 'a.next_page',
  4560. pageE: '#repo-content-pjax-container > div[data-pjax] > div:not(.paginate-container)',
  4561. replaceE: '.pagination',
  4562. scrollD: 3000
  4563. }
  4564. }, // Github - Releases 列表
  4565. github_tags: {
  4566. pager: {
  4567. nextL: '//div[@class="pagination"]/a[contains(text(), "Next")]',
  4568. pageE: '.Box-body > div.Box-row',
  4569. replaceE: '.pagination',
  4570. scrollD: 3000
  4571. }
  4572. }, // Github - Tags 列表
  4573. github_commits: {
  4574. pager: {
  4575. nextL: '//div[@class="paginate-container"]//a[contains(text(), "Older")]',
  4576. pageE: 'div.js-navigation-container > div',
  4577. replaceE: '.paginate-container',
  4578. scrollD: 3000
  4579. }
  4580. }, // Github - Commits 列表
  4581. github_notifications: {
  4582. pager: {
  4583. nextL: 'nav.paginate-container > a[aria-label="Next"]',
  4584. pageE: 'li.notifications-list-item',
  4585. replaceE: 'nav.paginate-container, .js-notifications-list-paginator-counts',
  4586. scrollD: 3000
  4587. }
  4588. }, // Github - Notifications 列表
  4589. github_search_repositories: {
  4590. pager: {
  4591. pageE: 'ul.repo-list > li',
  4592. }
  4593. }, //Github - Search 列表
  4594. github_search_code: {
  4595. pager: {
  4596. pageE: '.code-list-item',
  4597. }
  4598. }, // Github - Search 列表 - Code
  4599. github_search_commits: {
  4600. pager: {
  4601. pageE: '#commit_search_results > div',
  4602. }
  4603. }, // Github - Search 列表 - Commit
  4604. github_search_issues: {
  4605. pager: {
  4606. pageE: '.issue-list-item',
  4607. }
  4608. }, // Github - Search 列表 - Issues
  4609. github_search_discussions: {
  4610. pager: {
  4611. pageE: '.discussion-list-item',
  4612. }
  4613. }, // Github - Search 列表 - Discussions
  4614. github_search_registrypackages: {
  4615. pager: {
  4616. pageE: '#package_search_results > div',
  4617. }
  4618. }, // Github - Search 列表 - Package
  4619. github_search_marketplace: {
  4620. pager: {
  4621. pageE: '#marketplace_search_results > div:first-child > div',
  4622. }
  4623. }, // Github - Search 列表 - Marketplace
  4624. github_search_topics: {
  4625. pager: {
  4626. pageE: '.topic-list-item',
  4627. }
  4628. }, // Github - Search 列表 - Topics
  4629. github_search_wikis: {
  4630. pager: {
  4631. pageE: '#wiki_search_results > div:first-child > div',
  4632. }
  4633. }, // Github - Search 列表 - wiki
  4634. github_search_users: {
  4635. pager: {
  4636. pageE: '#user_search_results > div:first-child > div',
  4637. }
  4638. } // Github - Search 列表 - user
  4639. };
  4640. // 向后兼容一段时间就移除
  4641. /*if (JSON.stringify(GM_getValue('menu_customRules', {})).indexOf('functionS') > -1 || JSON.stringify(GM_getValue('menu_customRules', {})).indexOf('css;') > -1) { // 改名过渡,过段时间将其移除
  4642. GM_setValue('menu_customRules', JSON.parse(JSON.stringify(GM_getValue('menu_customRules', {})).replaceAll('functionS', 'url').replaceAll('css;', '')))
  4643. }*/
  4644. //console.log(GM_getValue('menu_customRules'), GM_getValue('menu_rules'))
  4645. // 合并 自定义规则、外置规则、内置规则
  4646. DBSite = Object.assign(GM_getValue('menu_customRules', {}), GM_getValue('menu_rules', {}), DBSite)
  4647. // 生成 SiteTypeID
  4648. setSiteTypeID();
  4649. //console.log(DBSite)
  4650. // 用于脚本判断(针对部分特殊的网站)
  4651. SiteType = {
  4652. BAIDU_TIEBA: DBSite.baidu_tieba.SiteTypeID
  4653. };
  4654. }
  4655. // 获取外置翻页规则
  4656. function getRulesUrl(update = false) {
  4657. if (GM_getValue('menu_ruleUpdateTime') == null) update = true
  4658. if (update) GM_setValue('menu_ruleUpdateTime', '1970/1/1');
  4659. //console.log(new Date().getTime());
  4660. let timeNow = new Date().getFullYear() + '/' + (new Date().getMonth() + 1) + '/' + new Date().getDate(),
  4661. timeOld = GM_getValue('menu_ruleUpdateTime');
  4662. if (!timeOld || timeOld != timeNow) { // 是新的一天
  4663. GM_setValue('menu_ruleUpdateTime', timeNow); // 写入时间以供后续比较
  4664.  
  4665. GM_xmlhttpRequest({
  4666. url: 'https://userscript.xiu2.xyz/other/Autopage/rules.json',
  4667. method: 'GET',
  4668. responseType: 'json',
  4669. overrideMimeType: 'application/json; charset=utf-8',
  4670. timeout: 5000,
  4671. onload: function (response) {
  4672. try {
  4673. //console.log('最终 URL:' + response.finalUrl, '返回内容:',response.response)
  4674. if (response.response) {
  4675. GM_setValue('menu_rules', response.response);
  4676. if (update) {
  4677. curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  4678. registerMenuCommand(); // 重新判断规则
  4679. //console.log(new Date().getTime());
  4680. //console.log(curSite);
  4681. if (curSite.style) {insStyle(curSite.style)} // 插入 Style CSS 样式
  4682. curSite.pageUrl = ''; // 下一页URL
  4683. pageLoading(); // 自动无缝翻页
  4684.  
  4685. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  4686. pausePageEvent(); // 左键双击网页空白处暂停翻页
  4687. GM_notification({text: '✅ 已更新外置翻页规则!如果依然无法翻页,则说明还不支持,欢迎提交申请~', timeout: 5000});
  4688. }
  4689. } else {
  4690. GM_notification({text: '❌ 更新失败,请联系作者解决...', timeout: 5000});
  4691. }
  4692. } catch (e) {
  4693. console.log(e);
  4694. GM_notification({text: '❌ 更新失败,请联系作者解决...', timeout: 5000});
  4695. }
  4696. }
  4697. })
  4698. }
  4699. }
  4700.  
  4701.  
  4702. // --------------------------------------------------------
  4703.  
  4704.  
  4705. // 判断网站类型
  4706. webTypeIf();
  4707.  
  4708. // 帖子内自动翻页判断
  4709. if (!GM_getValue('menu_thread')) {
  4710. if (curSite.thread) {curSite = {SiteTypeID: 0}; pageNum.now = 1;}
  4711. }
  4712.  
  4713. //console.log(curSite)
  4714. // 显示页码
  4715. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');}
  4716. // 左键双击网页空白处暂停翻页
  4717. pausePageEvent();
  4718. // 强制新标签页打开链接(翻页模式 5/6)
  4719. if (curSite.forceTarget) forceTarget();
  4720.  
  4721. // 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则
  4722. if (locationC) {
  4723. nowLocation = location.href
  4724. if (window.onurlchange === undefined) {addUrlChangeEvent();} // Tampermonkey v4.11 版本添加的 onurlchange 事件 grant,可以监控 pjax 等网页的 URL 变化
  4725. if (webType === 1) {
  4726. window.addEventListener('urlchange', function(){
  4727. lp = location.pathname;
  4728. //console.log(nowLocation, location.href)
  4729. if (curSite.history !== false && window.top.document.xiu_nowUrl === location.href) {nowLocation = location.href; return}
  4730. if (nowLocation == location.href) return
  4731. if (curSite.pager && curSite.pager.type == 5) {
  4732. if (self != top) {window.top.location.href = location.href;} else {if (getCSS('iframe#xiu_iframe')) {getCSS('iframe#xiu_iframe').remove();}}
  4733. pausePage = true;
  4734. } // 对于翻页模式 5,如果是 iframe 框架内 URL 变动,则升级为顶级页面,如果是顶级页面的 URL 变动,则清理 iframe 框架
  4735. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  4736. registerMenuCommand(); // 重新判断规则
  4737. //console.log(curSite);
  4738. if (curSite.style) {insStyle(curSite.style)} // 插入 Style CSS 样式
  4739. // 帖子内自动翻页判断
  4740. if (!GM_getValue('menu_thread')) {
  4741. if (curSite.thread) {curSite = {SiteTypeID: 0}; pageNum.now = 1;}
  4742. }
  4743. curSite.pageUrl = ''; // 下一页URL
  4744. pageLoading(); // 自动无缝翻页
  4745.  
  4746. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  4747. pausePageEvent(); // 左键双击网页空白处暂停翻页
  4748. })
  4749. } else if (webType === 2) {
  4750. window.addEventListener('urlchange', function(){
  4751. lp = location.pathname;
  4752. //console.log(nowLocation, location.href)
  4753. if (nowLocation == location.href) return
  4754. setTimeout(function(){
  4755. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  4756. discuz_(); // 重新判断规则
  4757.  
  4758. // 帖子内自动翻页判断
  4759. if (!GM_getValue('menu_thread')) {
  4760. if (curSite.thread) {curSite = {SiteTypeID: 0}; pageNum.now = 1;}
  4761. }
  4762.  
  4763. if (curSite.style) {insStyle(curSite.style)} // 插入 Style CSS 样式
  4764. curSite.pageUrl = ''; // 下一页URL
  4765. pageLoading(); // 自动无缝翻页
  4766.  
  4767. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  4768. pausePageEvent(); // 左键双击网页空白处暂停翻页
  4769. }, 500)
  4770. })
  4771. } else if (webType === 3) {
  4772. window.addEventListener('urlchange', function(){
  4773. lp = location.pathname;
  4774. if (nowLocation == location.href) return
  4775. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  4776. DBSite.flarum.url(); // 重新判断规则
  4777. if (curSite.style) {insStyle(curSite.style)} // 插入 Style CSS 样式
  4778. pageLoading(); // 自动无缝翻页
  4779.  
  4780. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  4781. pausePageEvent(); // 左键双击网页空白处暂停翻页
  4782. })
  4783. }
  4784. }
  4785. // 插入 Style CSS 样式
  4786. if (curSite.style) insStyle(curSite.style)
  4787.  
  4788. // 对翻页模式 5 的子 iframe 添加一个跟随滚动的事件
  4789. if (curSite.pager && curSite.pager.type === 5 && self != top) {
  4790. var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop
  4791. window.addEventListener('scroll', function (e) {
  4792. let scrollTop = window.parent.document.documentElement.scrollTop || window.parent.document.body.scrollTop,
  4793. clientHeight = window.parent.document.documentElement.clientHeight || window.parent.document.body.clientHeight,
  4794. scrollHeight = window.parent.document.documentElement.scrollHeight || window.parent.document.body.scrollHeight,
  4795. afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  4796. delta = afterScrollTop - beforeScrollTop;
  4797. if (delta == 0) return false;
  4798. beforeScrollTop = afterScrollTop;
  4799. //console.log(delta, scrollHeight - (scrollTop + clientHeight), '2222')
  4800. if (delta > 0 && scrollTop + clientHeight < scrollHeight) {
  4801. window.parent.scrollBy(0, delta*2);
  4802. }
  4803. }, false);
  4804. }
  4805.  
  4806. // 下一页URL
  4807. curSite.pageUrl = '';
  4808. // 自动无缝翻页
  4809. pageLoading();
  4810.  
  4811.  
  4812. // --------------------------------------------------------
  4813.  
  4814.  
  4815. // [Discuz! 论坛] 判断各版块帖子列表类型
  4816. function discuzForum(m) {
  4817. if (m == 'm') { // 手机版页面
  4818. if (getCSS('a.loadmore')) {
  4819. curSite = DBSite.discuz_m_forum;
  4820. } else if (getCSS('.threadlist')) {
  4821. curSite = DBSite.discuz_m; curSite.pager.pageE = '.threadlist > ul > li';
  4822. } else if (getCSS('[id^="normalthread_"]')) {
  4823. curSite = DBSite.discuz_m; curSite.pager.pageE = '[id^="normalthread_"]:not(.ZDlist)';
  4824. }
  4825. if (curSite.SiteTypeID !== 0 && location.hostname === 'keylol.com') {curSite.history = false; locationC = true;}
  4826. } else {
  4827. if (getCSS('#autopbn')) { // 判断是否有 [下一页] 按钮
  4828. curSite = DBSite.discuz_forum;
  4829. } else if (getCSS('#waterfall')) { // 判断是否为图片模式
  4830. if (!getCSS('#pgbtn, .pgbtn')) { // 如果各版块帖子列表已存在这个元素,说明自带了无缝翻页
  4831. curSite = DBSite.discuz_waterfall; waterfallStyle(); // 图片模式列表样式预处理
  4832. }
  4833. } else {
  4834. curSite = DBSite.discuz_guide;
  4835. }
  4836. }
  4837. }
  4838. // [Discuz! 论坛] 判断手机版帖子内
  4839. function discuzThreadM() {
  4840. if (getCSS('[id^="pid"]')) {
  4841. curSite = DBSite.discuz_m; curSite.pager.pageE = '[id^="pid"], [id^="pid"]+div:not([id="post_new"])'
  4842. } else if (getCSS('[id^="post_"]')) {
  4843. curSite = DBSite.discuz_m; curSite.pager.pageE = '[id^="post_"]';
  4844. }
  4845. if (curSite.SiteTypeID !== 0 && location.hostname === 'keylol.com') {curSite.history = false; locationC = true;}
  4846. }
  4847. function discuz_() {
  4848. if (getCSS('body[id="nv_forum"][class^="pg_"][onkeydown*="27"]')) {
  4849. switch (getCSS('body[id="nv_forum"][class^="pg_"][onkeydown*="27"]').className) {
  4850. case 'pg_forumdisplay': // < 各版块帖子列表 >
  4851. discuzForum(); break;
  4852. case 'pg_viewthread': // < 帖子内 >
  4853. curSite = DBSite.discuz_thread; break;
  4854. case 'pg_guide': // < 导读帖子列表等 >
  4855. curSite = DBSite.discuz_guide; break;
  4856. case 'pg_collection': // < 淘贴列表 >
  4857. curSite = DBSite.discuz_collection; break;
  4858. }
  4859. }
  4860. // 如果上面没有匹配的则继续 < 搜索结果 >
  4861. if (curSite.SiteTypeID === 0) {
  4862. if (indexOF('search') || getCSS('body[id="nv_search"][onkeydown*="27"]')) {
  4863. if (indexOF('mobile=2', 's')) { // 手机版页面
  4864. curSite = DBSite.discuz_m; curSite.pager.pageE = '.threadlist > ul > li'; locationC = true;
  4865. } else {
  4866. curSite = DBSite.discuz_search;
  4867. }
  4868. }
  4869. }
  4870. // 如果上面没有匹配的则继续
  4871. if (curSite.SiteTypeID === 0) {
  4872. if (indexOF('.html')) { // 判断是不是静态网页(.html 结尾)
  4873. if (indexOF('/forum-')) { // < 各版块帖子列表 >
  4874. if (getXpath('//head/meta[@name="applicable-device" and @content="mobile"] | //head/title[contains(text(), "手机版")] | //head/link[contains(@href, "/mobile/")] | //head/script[contains(@src, "/mobile/")]')) { // 手机版页面
  4875. discuzForum('m');
  4876. } else {
  4877. discuzForum();
  4878. }
  4879. } else if (indexOF('/thread-')) { // < 帖子内 >
  4880. if (getXpath('//head/meta[@name="applicable-device" and @content="mobile"] | //head/title[contains(text(), "手机版")] | //head/link[contains(@href, "/mobile/")] | //head/script[contains(@src, "/mobile/")]')) { // 手机版页面
  4881. discuzThreadM();
  4882. } else {
  4883. curSite = DBSite.discuz_thread;
  4884. }
  4885. }
  4886. }
  4887. }
  4888. // 如果上面没有匹配的则继续
  4889. if (curSite.SiteTypeID === 0) {
  4890. if (indexOF('mod=forumdisplay', 's') || indexOF('forumdisplay.php')) { // < 各版块帖子列表 >
  4891. 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/")]')) { // 手机版页面
  4892. discuzForum('m');
  4893. } else {
  4894. discuzForum();
  4895. }
  4896. } else if (indexOF('mod=viewthread', 's') || indexOF('viewthread.php')) { // < 帖子内 >
  4897. 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/")]')) { // 手机版页面
  4898. discuzThreadM();
  4899. } else {
  4900. curSite = DBSite.discuz_thread;
  4901. }
  4902. } else if (indexOF('mod=guide', 's')) { // < 导读帖子列表 >
  4903. curSite = DBSite.discuz_guide;
  4904. } else if(indexOF('mod=space', 's') && indexOF('do=thread', 's')) { // 别人的主题/回复
  4905. curSite = DBSite.discuz_youspace;
  4906. } else if (indexOF('mod=collection', 's')) { // < 淘贴列表 >
  4907. curSite = DBSite.discuz_collection;
  4908. } else if (getCSS('#threadlist')) { // < 部分论坛的各板块 URL 是自定义的 >
  4909. discuzForum();
  4910. } else if (getCSS('#postlist')) { // < 部分论坛的帖子内 URL 是自定义的 >
  4911. curSite = DBSite.discuz_thread;
  4912. } else { // 手机版判断
  4913. discuzForum('m');
  4914. if (curSite.SiteTypeID === 0) discuzThreadM();
  4915. }
  4916. }
  4917. }
  4918. // [Discuz! 论坛] 图片模式列表样式预处理
  4919. function waterfallStyle() {
  4920. let width = getCSS('#waterfall > li:first-child').style.width;
  4921. 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;}`);
  4922. }
  4923.  
  4924.  
  4925. // [谷歌搜索] 的插入前函数(加载视频图片)
  4926. function google_bF(pageE) {
  4927. if (!indexOF('tbm=nws', 's')){
  4928. pageE.forEach(function (one) {
  4929. getAllCSS('a[aria-label][href*="https://www.youtube.com/watch?v="]').forEach(function (one1) {
  4930. let img = getCSS('img', one1)
  4931. if (img) img.src = `https://i.ytimg.com/vi/${one1.href.split('?v=')[1]}/mqdefault.jpg`
  4932. })
  4933. });
  4934. }
  4935. return pageE
  4936. }
  4937.  
  4938.  
  4939. // [必应搜索] 的插入前函数(加载网站图标)
  4940. function bing_bF(pageE) {
  4941. if (!getCSS('.b_title > a.sh_favicon')) {
  4942. insStyle('.b_title > a.sh_favicon {display: none !important;}');
  4943. delete curSite.function
  4944. //console.log(curSite)
  4945. return pageE
  4946. }
  4947. pageE.forEach(function (one) {
  4948. getAllCSS('div.rms_iac[data-src]').forEach(function (one1) {
  4949. one1.outerHTML = `<img src="${one1.dataset.src}" height="16" width="16" alt="全球 Web 图标" role="presentation" class="rms_img">`;
  4950. })
  4951. });
  4952. return pageE
  4953. }
  4954.  
  4955.  
  4956. // [百度贴吧](发帖按钮点击事件)
  4957. function baidu_tieba_1() {
  4958. let button = getCSS('.tbui_aside_fbar_button.tbui_fbar_post > a');
  4959. if (button) {
  4960. button.remove();
  4961. 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>')
  4962. button = getCSS('.tbui_aside_fbar_button.tbui_fbar_post > a');
  4963. if (button) {
  4964. button.onclick = function(){
  4965. let button2 = getCSS('div.edui-btn.edui-btn-fullscreen.edui-btn-name-portrait');
  4966. if (button2) {button2.click();} else {alert('提示:登录(不可用)后才能发帖!');}
  4967. return false;
  4968. }
  4969. }
  4970. }
  4971. }
  4972. // [百度贴吧] 插入数据
  4973. function baidu_tieba_insertE(pageE, type) {
  4974. if (!pageE) return
  4975. // 获取 <script> 内容
  4976. const scriptElems = getXpath(`//script[contains(text(), 'Bigpipe.register("frs-list/pagelet/thread_list", ')]`, pageE, pageE);
  4977. if (scriptElems) {
  4978. // 从 <script> 中提取帖子列表字符串
  4979. let scriptText = scriptElems.textContent.replace('Bigpipe.register("frs-list/pagelet/thread_list", ','');
  4980. scriptText = scriptText.slice(0, scriptText.indexOf(').'));
  4981. // 字符串转 Element 元素
  4982. let temp_baidu_tieba = document.createElement('div'); temp_baidu_tieba.innerHTML = JSON.parse(scriptText).content;
  4983. processElems(temp_baidu_tieba);
  4984. }
  4985. }
  4986.  
  4987.  
  4988. // [V2EX] 的插入后函数(新标签页打开链接)
  4989. function v2ex_aF(css) {
  4990. let links = getAllCSS(css);if (!links) return
  4991. links.forEach(function (_this) {_this.target = '_blank';});
  4992. }
  4993.  
  4994.  
  4995. // [NexusMods] 获取下一页地址
  4996. function nexusmods_nextL() {
  4997. if (getCSS('.nexus-ui-blocker')) return
  4998. let modList;
  4999. if (indexOF('/news')) {modList = RH_NewsTabContent;} else {modList = RH_ModList;}
  5000. if (!modList) return
  5001. let out_items = JSON.stringify(modList.out_items).replace(/{|}|"/g,''),
  5002. nextNum = getXpath('//div[contains(@class, "pagenav")][1]//a[contains(@class, "page-selected")]/parent::li/following-sibling::li/a'),
  5003. categories = modList.out_items.categories, categoriesUrl = '';
  5004. var url = '';
  5005. if (nextNum && nextNum.innerText) {
  5006. nextNum = nextNum.innerText;
  5007. if (out_items.indexOf('page:') > -1) {
  5008. out_items = out_items.replace(/page:\d+/, `page:${nextNum}`)
  5009. } else {
  5010. out_items += `,page:${nextNum}`;
  5011. }
  5012. if (categories && categories != []) {
  5013. for (let i = 0; i < categories.length; i++) {
  5014. categoriesUrl += `,categories[]:${categories[i]}`
  5015. }
  5016. categoriesUrl = categoriesUrl.replace(/,/,'');
  5017. if (out_items.indexOf('categories:') > -1) {
  5018. out_items = out_items.replace(/categories:\[.*\]/, categoriesUrl)
  5019. }
  5020. }
  5021. return `https://www.nexusmods.com${modList.uri}?RH_${modList.id}=${out_items}`
  5022. }
  5023. return ''
  5024. }
  5025. // [NexusMods] 的插入前函数(隐藏底部元素)
  5026. function nexusmods_bF(pageE) {
  5027. pageE.forEach(function (one) {
  5028. let now = one.querySelector('.mod-tile-left');
  5029. if (now) {
  5030. let downloadCount = now.querySelector('.downloadcount > span.flex-label');
  5031. if (downloadCount) {
  5032. if (GlobalModStats[now.dataset.gameId] && GlobalModStats[now.dataset.gameId][now.dataset.modId]) {
  5033. downloadCount.textContent = shortFormat(parseInt(GlobalModStats[now.dataset.gameId][now.dataset.modId].total));
  5034. }
  5035. }
  5036. }
  5037. });
  5038. return pageE
  5039. }
  5040.  
  5041.  
  5042. // [bilibili_search] 获取下一页地址
  5043. function bilibili_search_nextL() {
  5044. if (!location.search) return
  5045. let pageActive = 1, pageLast = parseInt(getXpath('//ul[@class="pages"]/li[contains(@class, "page-item")][not(contains(@class, "next") or contains(@class, "prev"))][last()]').innerText);
  5046. if (!pageLast) return
  5047. if (indexOF(/page=\d+/, 's')) {
  5048. pageActive = parseInt(/page=\d+/.exec(location.search)[0].replace('page=',''))
  5049. }
  5050. if (pageActive < pageLast) {
  5051. if (indexOF(/page=\d+/, 's')) {
  5052. return (location.origin + location.pathname + location.search.replace(/page=\d+/,`page=${pageActive+1}`))
  5053. } else {
  5054. return (location.origin + location.pathname + location.search + `&page=${pageActive+1}`)
  5055. }
  5056. }
  5057. }
  5058. // [bilibili_search] 插入前函数(加载图片)
  5059. function bilibili_search_bF(pageE) {
  5060. pageE.forEach(function (one) {
  5061. let img = getCSS('.img > .lazy-img > img[src=""]', one)
  5062. if (img) {
  5063. img.setAttribute('data-srclz', 'lazy')
  5064. }
  5065. });
  5066. return pageE
  5067. }
  5068. // [bilibili_search] 插入后函数(加载图片)
  5069. function bilibili_search_aF() {
  5070. let result = __INITIAL_STATE__.flow[__INITIAL_STATE__.flow.fields[0]].result;
  5071. if (result.length > 0) {
  5072. let imgArr = getAllCSS('.img > .lazy-img > img[data-srclz]');
  5073. if (imgArr.length > 0) {
  5074. for (let i = 0; i < imgArr.length; i++) {
  5075. imgArr[i].src = result[i].pic;
  5076. imgArr[i].removeAttribute('data-srclz');
  5077. }
  5078. }
  5079. }
  5080. }
  5081.  
  5082.  
  5083. // [漫画狂] 获取下一页地址
  5084. function cartoonmad_nextL() {
  5085. let url = getXpath('//a[@class="pages"][contains(text(),"下一頁")]');
  5086. if (url) {
  5087. if (url.getAttribute('href') === 'thend.asp') {
  5088. url = getXpath('//a[@class="pages"][contains(string(),"下一話")]')
  5089. if (url) return url.href;
  5090. pausePage = false;
  5091. GM_notification({text: `注意:该网站早期漫画(如海贼王、柯南)因为网站自身问题而无法翻至下一话(仅限于显示为 [第 X 卷]/[下一卷] 的)。\n因此需要手动去 [目录页] 进入下一卷!`, timeout: 10000});
  5092. } else {
  5093. return url.href;
  5094. }
  5095. }
  5096. return '';
  5097. }
  5098.  
  5099.  
  5100. // [漫画猫] 初始化(显示本话所以图片)
  5101. function manhuacat_init() {
  5102. let _img = '';
  5103. for (let now of img_data_arr) {_img += `<img src="${asset_domain}${img_pre}${now}">`;}
  5104. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  5105.  
  5106. }
  5107. // [漫画猫] 获取下一页地址
  5108. function manhuacat_nextL(pageE, type) {
  5109. if (type === 'url') {
  5110. if(pageE.code == '0000') {
  5111. if (pageE.url === curSite.pageUrl) return
  5112. curSite.pageUrl = pageE.url;
  5113. getPageE_(curSite.pageUrl); // 真正的下一页链接
  5114. }
  5115. } else {
  5116. let vg_r_data = getCSS('.vg-r-data');
  5117. if (vg_r_data) {
  5118. getPageE_(`${location.origin}/chapter_num?chapter_id=${vg_r_data.dataset.chapter_num}&ctype=1&type=${vg_r_data.dataset.chapterType};`, 'json', 'GET', '', 'url');
  5119. }
  5120. }
  5121. }
  5122. // [漫画猫] 插入数据
  5123. function manhuacat_insertE(pageE, type) {
  5124. if (!pageE) return
  5125. if (type === 'url') { // 获取下一页链接
  5126. manhuacat_nextL(pageE, type); return
  5127. }
  5128. addHistory(pageE);
  5129. replaceElems(pageE);
  5130.  
  5131. // 插入图片
  5132. 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');;
  5133. for (let now of _img_arr) {_img += `<img src="${vg_r_data.dataset.chapterDomain}${img_pre}${now}">`;}
  5134. if (_img) {
  5135. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5136. pageNum.now = pageNum._now + 1
  5137. }
  5138. }
  5139.  
  5140.  
  5141. // [漫画柜] 初始化(将本话其余图片插入网页中)
  5142. function manhuagui_init() {
  5143. // hook imgDate 代码
  5144. SMH.imgData = function(n) {window['imgDate'] = n;return{preInit:function(){}}}
  5145. // 重新执行本页的 imgDate 代码
  5146. insScript(curSite.pager.pageE);
  5147. let _img = '', imgPath = `${location.protocol}//i.hamreus.com${window['imgDate'].path}`;
  5148. //console.log(imgPath, window['imgDate'])
  5149. if (!(window['imgDate']) || !(imgPath)) return
  5150. // 遍历图片文件名数组,组合为 img 标签
  5151. 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}">`;}
  5152. // 插入并覆盖原来的一个图片
  5153. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  5154. pausePage = true;
  5155. }
  5156. // [漫画柜] 获取下一页地址
  5157. function manhuagui_nextL() {
  5158. if (window['imgDate'].nextId == 0) return
  5159. var url = location.origin + location.pathname.replace(window['imgDate'].cid.toString(), window['imgDate'].nextId.toString())
  5160. if (url === curSite.pageUrl) return
  5161. curSite.pageUrl = url
  5162. getPageE_(curSite.pageUrl);
  5163. }
  5164. // [漫画柜] 插入数据
  5165. function manhuagui_insertE(pageE, type) {
  5166. if (!pageE) return
  5167. // 重新执行本页的 imgDate 代码
  5168. insScript(curSite.pager.pageE, document.body, pageE);
  5169. let _img = '', imgPath = `${location.protocol}//i.hamreus.com${window['imgDate'].path}`;
  5170. //console.log(imgPath, window['imgDate'])
  5171. if (!(window['imgDate']) || !(imgPath)) return
  5172. // 遍历图片文件名数组,组合为 img 标签
  5173. 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}">`;}
  5174. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  5175. addHistory(pageE);
  5176. pageNum.now = pageNum._now + 1
  5177. }
  5178.  
  5179.  
  5180. // [36漫画] 初始化(将本话其余图片插入网页中)
  5181. function _36manga_init() {
  5182. let _img = '', imgPath = `${SinConf.resHost[0].domain[0]}${chapterPath}`;
  5183. if (!(chapterImages) || !(imgPath)) return
  5184. // 遍历图片文件名数组,组合为 img 标签
  5185. for (let i = 0; i < chapterImages.length; i++) {_img += `<img src="${imgPath}${chapterImages[i]}">`;}
  5186. // 插入并覆盖原来的一个图片
  5187. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  5188. pausePage = true;
  5189. }
  5190. // [36漫画] 获取下一页地址
  5191. function _36manga_nextL() {
  5192. if (!nextChapterData.id) return
  5193. var url = comicUrl + nextChapterData.id + '.html'
  5194. if (url === curSite.pageUrl) return
  5195. curSite.pageUrl = url
  5196. getPageE_(curSite.pageUrl);
  5197. }
  5198. // [36漫画] 插入数据
  5199. function _36manga_insertE(pageE, type) {
  5200. if (!pageE) return
  5201. // 插入并执行数据代码
  5202. insScript(curSite.pager.pageE, document.body, pageE);
  5203. let _img = '', imgPath = `${SinConf.resHost[0].domain[0]}${chapterPath}`;
  5204. if (!(chapterImages) || !(imgPath)) return
  5205. // 遍历图片文件名数组,组合为 img 标签
  5206. for (let i = 0; i < chapterImages.length; i++) {_img += `<img src="${imgPath}${chapterImages[i]}">`;}
  5207. // 插入并覆盖原来的一个图片
  5208. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  5209. addHistory(pageE);
  5210. pageNum.now = pageNum._now + 1
  5211. }
  5212.  
  5213.  
  5214. // [爱漫画] 获取全部图片
  5215. function imanhuaw_getIMG() {
  5216. let _img = '', _imgUrl;
  5217. for (let one of base64_decode(qTcms_S_m_murl_e).split("$qingtiandy$")) {
  5218. _imgUrl = one;
  5219. if (one.substring(0,1) == '/') {
  5220. _imgUrl = qTcms_m_weburl + _imgUrl;
  5221. } else {
  5222. if (qTcms_Pic_m_if != '2') {
  5223. one = one.replace(/\?/gi, 'a1a1');
  5224. one = one.replace(/&/gi, 'b1b1');
  5225. one = one.replace(/%/gi, 'c1c1');
  5226. let m_httpurl = '';
  5227. if (typeof(qTcms_S_m_mhttpurl) != 'undefined') m_httpurl = base64_decode(qTcms_S_m_mhttpurl);
  5228. if (location.hostname == 'www.ccshwy.com') qTcms_m_indexurl = 'http://h.ccshwy.com/';
  5229. _imgUrl = qTcms_m_indexurl + 'statics/pic/?p=' + escape(one) + '&picid=' + qTcms_S_m_id + '&m_httpurl=' + escape(m_httpurl);
  5230. } else {
  5231. _imgUrl = _imgUrl.replace('http:', '') ;
  5232. _imgUrl = _imgUrl.replace('https:', '');
  5233. }
  5234. }
  5235. _img += `<img src="${_imgUrl}">`;
  5236. }
  5237. return _img;
  5238. }
  5239. // [爱漫画] 初始化(调整本话其余图片)
  5240. function imanhuaw_init() {
  5241. getOne(curSite.pager.insertP[0]).outerHTML = imanhuaw_getIMG();
  5242. document.oncontextmenu = function(){}
  5243. }
  5244. // [爱漫画] 获取下一页地址
  5245. function imanhuaw_nextL() {
  5246. let next = location.origin + qTcms_Pic_nextArr
  5247. if (next && next != location.origin && next != curSite.pageUrl) {
  5248. curSite.pageUrl = next;
  5249. getPageE_(curSite.pageUrl);
  5250. }
  5251. }
  5252. // [爱漫画] 插入数据
  5253. function imanhuaw_insertE(pageE, type) {
  5254. if (!pageE) return
  5255. // 插入并运行 <script>
  5256. insScript('//head/script[not(@src)][contains(text(), "qTcms_S_m_murl_e")]', document.body, pageE);
  5257. // 将 img 标签插入到网页中
  5258. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), imanhuaw_getIMG());
  5259. addHistory(pageE);
  5260. pageNum.now = pageNum._now + 1
  5261. }
  5262.  
  5263.  
  5264. // [漫画 DB] 初始化(将本话其余图片插入网页中)
  5265. function manhuadb_init() {
  5266. let _img = '', data = getCSS('.vg-r-data'), imgDate;
  5267. if (!data) return
  5268. getAllCSS(curSite.pager.pageE.replace('', '')).forEach(function (one) {
  5269. if (one.tagName === 'SCRIPT' && one.textContent.indexOf('var img_data =') > -1) {
  5270. let json = JSON.parse(window.atob(one.textContent.split("'")[1]));
  5271. if (json) {
  5272. let _img = '';
  5273. 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}">`;}
  5274. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5275. }
  5276. }
  5277. })
  5278. }
  5279. // [漫画 DB] 获取下一页地址
  5280. function manhuadb_nextL() {
  5281. let nextArr = getAllCSS('a.fixed-a-es'), next;
  5282. var url = '';
  5283. if (nextArr.length == 0) return
  5284. for (let i = 0; i < nextArr.length; i++) {
  5285. if (nextArr[i].className.indexOf('active') > -1) {
  5286. if (nextArr[i+1]) url = nextArr[i+1].href;
  5287. break;
  5288. }
  5289. }
  5290. if (url === curSite.pageUrl) return
  5291. curSite.pageUrl = url
  5292. getPageE_(curSite.pageUrl);
  5293. }
  5294. // [漫画 DB] 插入数据
  5295. function manhuadb_insertE(pageE, type) {
  5296. if (!pageE) return
  5297. if (replaceElems(pageE, curSite.pager.pageE, curSite.pager.pageE)) {
  5298. addHistory(pageE);
  5299. pageNum.now = pageNum._now + 1
  5300. manhuadb_init(); // 将刚刚替换的图片插入网页中
  5301. }
  5302. }
  5303.  
  5304.  
  5305. // [HiComic(嗨漫画)] 初始化(将本话其余图片插入网页中)
  5306. function hicomic_init() {
  5307. let _img = '';
  5308. getAllCSS('.chapter > section:not(:first-child) > section[val]').forEach(function (one) {
  5309. let src = one.getAttribute('val');
  5310. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h'
  5311. _img += `<img src="${src}">`
  5312. })
  5313. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5314. window.document.title = window.document.title.replace(/(\(第.+\))? - HiComic/, `(${getCSS('.chapter_name').textContent}) - HiComic`); // 修改网页标题(加上 第 X 话)
  5315. }
  5316. // [HiComic(嗨漫画)] 获取下一页地址
  5317. function hicomic_nextL() {
  5318. let nextId;
  5319. nextId = getCSS('.next_chapter:not(.end)')
  5320. if (nextId && nextId.id && nextId.id != 'None') {
  5321. curSite.pageUrl = location.href;
  5322. getPageE_(`https://www.hicomic.net/api/web/chapter/${nextId.id}/contents`, 'json');
  5323. }
  5324. }
  5325. // [HiComic(嗨漫画)] 插入数据
  5326. function hicomic_insertE(pageE, type) {
  5327. if (!pageE || pageE.code != 200) return
  5328. if (pageE.results.chapter.next) { // 写入下一页的 UUID
  5329. getCSS('.next_chapter').id = pageE.results.chapter.next;
  5330. } else {
  5331. getCSS('.next_chapter').id = 'None';
  5332. getCSS('.next_chapter').classList.add('end');
  5333. }
  5334. curSite.pageUrl =`https://www.hicomic.net/chapters/${pageE.results.chapter.uuid}/contents`
  5335. getCSS('.chapter_name').textContent = pageE.results.chapter.name; // 修改漫画标题
  5336. addHistory(pageE, window.document.title.replace(/(\(第.+\))? - HiComic/, `(${pageE.results.chapter.name}) - HiComic`));
  5337. let _img = '';
  5338. for (let i = 0; i < pageE.results.chapter.contents.length; i++) { // 遍历图片文件名数组,组合为 img 标签
  5339. let src = pageE.results.chapter.contents[i].url;
  5340. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h';
  5341. _img += `<img src="${src}">`
  5342. }
  5343. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5344. pageNum.now = pageNum._now + 1
  5345. }
  5346.  
  5347.  
  5348. // [动漫之家] 初始化(调整本话其余图片)
  5349. function dmzj_init(css) {
  5350. let _img = '';
  5351. getAllCSS(css).forEach(function (one) {_img += `<img src="${one.dataset.original}">`;})
  5352. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  5353. }
  5354. // [动漫之家] 插入数据
  5355. function dmzj_insertE(pageE, type) {
  5356. if (!pageE) return
  5357. // 插入并运行 <script>
  5358. insScript('head > script[type]:not([src])', document.body, pageE);
  5359.  
  5360. // 插入图片
  5361. let _img = '', _img_arr;
  5362. if (pages.indexOf('|') === -1) {
  5363. _img_arr = JSON.parse(pages.replace(/\r\n/g,'|')).page_url.split('|');
  5364. } else {
  5365. _img_arr = JSON.parse(pages).page_url.split('|');
  5366. }
  5367. for (let now of _img_arr) {
  5368. _img += `<img src="${img_prefix}${now}">`;
  5369. }
  5370. if (_img) {
  5371. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5372. addHistory(pageE);
  5373. if (replaceElems(pageE)) pageNum.now = pageNum._now + 1
  5374. }
  5375. }
  5376. // [动漫之家-漫画] 插入数据
  5377. function dmzj_manhua_insertE(pageE, type) {
  5378. if (!pageE) return
  5379. // 插入并运行 <script>
  5380. insScript('head > script[type]:not([src])', document.body, pageE);
  5381.  
  5382. // 插入图片
  5383. let _img = '';
  5384. for (let now of arr_pages) {
  5385. _img += `<img src="${img_prefix}${now}">`;
  5386. }
  5387. if (_img) {
  5388. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5389. addHistory(pageE);
  5390. if (replaceElems(pageE)) pageNum.now = pageNum._now + 1
  5391. }
  5392. }
  5393.  
  5394.  
  5395. // [优酷漫画] 初始化(调整本话其余图片)
  5396. function ykmh_init(css) {
  5397. let host = SinMH.getChapterImage(1).split('/')[0] + '//' + SinMH.getChapterImage(1).split('/')[2];
  5398. if (!host) return
  5399. let _img = '';
  5400. for (let one of chapterImages) {_img += `<img src="${host}${one}">`;}
  5401. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  5402. }
  5403. // [优酷漫画] 获取下一页地址
  5404. function ykmh_nextL() {
  5405. let url = comicUrl + nextChapterData.id + '.html'
  5406. if (url && url != '.html' && url != curSite.pageUrl) {
  5407. curSite.pageUrl = url;
  5408. getPageE_(curSite.pageUrl);
  5409. }
  5410. }
  5411. // [优酷漫画] 插入数据
  5412. function ykmh_insertE(pageE, type) {
  5413. //console.log(pageE)
  5414. if (!pageE) return
  5415. // 插入并运行 <script>
  5416. insScript('//script[contains(text(),"chapterImages")]', document.body, pageE);
  5417.  
  5418. let host = SinMH.getChapterImage(1).split('/')[0] + '//' + SinMH.getChapterImage(1).split('/')[2];
  5419. if (!host) host = document.querySelector(curSite.pager.insertP[0]).src.split('/')[0] + '//' + document.querySelector(curSite.pager.insertP[0]).src.split('/')[2]
  5420. // 插入图片
  5421. let _img = '';
  5422. for (let one of chapterImages) {_img += `<img src="${host}${one}">`;}
  5423. if (_img) {
  5424. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5425. addHistory(pageE);
  5426. if (replaceElems(pageE)) pageNum.now = pageNum._now + 1
  5427. }
  5428. }
  5429.  
  5430.  
  5431. // [动漫戏说] 插入后函数(加载图片)
  5432. function acgn_aF() {
  5433. let old = getAllCSS('.pic[_src][id]'), _img = '';
  5434. if (old.length > 0) {
  5435. for (let now of old) {now.outerHTML = `<div class="pic" _src="${now.getAttribute('_src')}"><img src="${now.getAttribute('_src')}" class="img1"></div>`;}
  5436. }
  5437. }
  5438.  
  5439.  
  5440. // [漫画星球] 插入数据
  5441. function mhxqiu_insertE(pageE, type) {
  5442. if (!pageE) return
  5443. // 插入并运行 <script>
  5444. insScript('//script[contains(text(), "eval") and contains(text(), "newImgs")]', document.body, pageE);
  5445.  
  5446. // 插入图片
  5447. let _img = '';
  5448. 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>`;}
  5449. if (_img) {
  5450. // 将 img 标签插入到网页中
  5451. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  5452. addHistory(pageE);
  5453. pageNum.now = pageNum._now + 1
  5454. replaceElems(pageE)
  5455. }
  5456. }
  5457.  
  5458.  
  5459. // [风之动漫] 插入数据
  5460. function fffdm_insertE(pageE, type) {
  5461. if (!pageE) return
  5462. // 插入并运行 <script>
  5463. let scriptElems = getXpath('id("main")/script[contains(text(), "mhpicurl")][1]', pageE, pageE);
  5464. if (scriptElems) {
  5465. document.body.appendChild(document.createElement('script')).textContent = scriptElems.textContent.replace(/document\.write.+/, '');
  5466.  
  5467. // 插入图片
  5468. setTimeout(function() {
  5469. getOne(curSite.pager.insertP[0]).appendChild(document.createElement('img')).src = mhpicurl;
  5470. addHistory(pageE);
  5471. pageNum.now = pageNum._now + 1
  5472. replaceElems(pageE)
  5473. }, 100)
  5474. }
  5475. }
  5476.  
  5477.  
  5478. // [乐语漫画] 初始化(调整本话其余图片)
  5479. function leyuman_init() {
  5480. let _img = '';
  5481. for (let one of JSON.parse(z_img)) {
  5482. if (one.slice(0,4) === 'http') {
  5483. _img += `<img src="${one}">`;
  5484. } else {
  5485. _img += `<img src="https://img.shishi-life.com/${one}">`;
  5486. }
  5487. }
  5488. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  5489.  
  5490. }
  5491. // [乐语漫画] 插入数据
  5492. function leyuman_insertE(pageE, type) {
  5493. if (!pageE) return
  5494. // 插入并运行 <script>
  5495. insScript('//body//script[not(@src)][contains(text(), "z_img=")]', document.body, pageE);
  5496.  
  5497. // 插入图片
  5498. let _img = '';
  5499. for (let one of JSON.parse(z_img)) {
  5500. if (one.slice(0,4) === 'http') {
  5501. _img += `<img src="${one}">`;
  5502. } else {
  5503. _img += `<img src="https://img.shishi-life.com/${one}">`;
  5504. }
  5505. }
  5506. if (_img) {
  5507. // 将 img 标签插入到网页中
  5508. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  5509. addHistory(pageE);
  5510. pageNum.now = pageNum._now + 1
  5511. replaceElems(pageE)
  5512. }
  5513. }
  5514.  
  5515.  
  5516. // [新新漫画] 初始化(调整本话其余图片)
  5517. function _77mh_init() {
  5518. let _img = '';
  5519. for (let one of arr) {_img += `<img src="${img_qianz}${one}">`;}
  5520. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  5521. }
  5522. // [新新漫画] 获取下一页地址
  5523. function _77mh_nextL() {
  5524. let next = nextLink_b
  5525. if (next && next != curSite.pageUrl) {
  5526. curSite.pageUrl = next;
  5527. getPageE_(curSite.pageUrl);
  5528. }
  5529. }
  5530. // [新新漫画] 插入数据
  5531. function _77mh_insertE(pageE, type) {
  5532. if (!pageE) return
  5533. // 插入并运行 <script>
  5534. insScript('//script[not(@src)][contains(text(), "eval(")]', document.body, pageE);
  5535.  
  5536. // 插入图片
  5537. let _img = '';
  5538. for (let one of msg.split('|')) {_img += `<img src="${img_qianz}${one}.webp">`;}
  5539. if (_img) {
  5540. // 将 img 标签插入到网页中
  5541. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  5542. addHistory(pageE);
  5543. pageNum.now = pageNum._now + 1
  5544. }
  5545. }
  5546.  
  5547.  
  5548. // [古风漫画网] 获取下一页地址
  5549. function gufengmh_nextL() {
  5550. let pageE = getOne(curSite.pager.pageE); // 寻找数据所在元素
  5551. if (pageE) {
  5552. let comicUrl, nextId;
  5553. var url = '';
  5554. pageE.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  5555. //console.log(one)
  5556. if (one.indexOf('comicUrl') > -1) { // 下一页 URL 前半部分
  5557. comicUrl = one.split('"')[1];
  5558. } else if (one.indexOf('nextChapterData') > -1) { // 下一页 URL 的后半部分 ID
  5559. nextId = one.split('"id":')[1].split(',')[0];
  5560. }
  5561. })
  5562. if (comicUrl && nextId && nextId != 'null') { // 组合到一起就是下一页 URL
  5563. url = comicUrl + nextId + '.html'
  5564. if (url === curSite.pageUrl) return
  5565. curSite.pageUrl = url
  5566. getPageE_(curSite.pageUrl); // 访问下一页 URL 获取
  5567. }
  5568. }
  5569. }
  5570. // [古风漫画网] 插入数据
  5571. function gufengmh_insertE(pageE, type) {
  5572. if (pageE) {
  5573. let url = curSite.pageUrl;
  5574. pageE = getOne(curSite.pager.pageE, pageE, pageE);
  5575. let chapterImages, chapterPath;
  5576. getOne(curSite.pager.pageE).innerText = pageE.textContent; // 将当前网页内的数据所在元素内容改为刚刚获取的下一页数据内容,以便循环获取下一页 URL
  5577. pageE.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  5578. //console.log(one)
  5579. if (one.indexOf('chapterImages') > -1) { // 图片文件名数组
  5580. chapterImages = one.replace(/^.+\[/, '').replace(']', '').replaceAll('"', '').split(',')
  5581. } else if (one.indexOf('chapterPath') > -1) { // 图片文件路径
  5582. chapterPath = one.split('"')[1];
  5583. } else if (one.indexOf('pageTitle') > -1) { // 网页标题
  5584. addHistory(pageE, one.split('"')[1]);
  5585. }
  5586. })
  5587. if (chapterImages && chapterPath) {
  5588. let _img = '';
  5589. chapterImages.forEach(function (one2){_img += '<img src="https://res.xiaoqinre.com/' + chapterPath + one2 + '" data-index="0" style="display: inline-block;">';})
  5590. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5591. pageNum.now = pageNum._now + 1
  5592. }
  5593. }
  5594. }
  5595.  
  5596.  
  5597. // [Mangabz 漫画] 初始化(调整本话图片)
  5598. function mangabz_init() {
  5599. let showimage = getCSS('#showimage'),
  5600. cp_img = getCSS('#cp_img'),
  5601. cp_image = getCSS('#cp_image');
  5602. if (showimage) {showimage.removeAttribute('oncontextmenu');}
  5603. if (cp_img) {cp_img.removeAttribute('oncontextmenu');}
  5604. if (cp_image) {
  5605. cp_image.removeAttribute('oncontextmenu');
  5606. cp_image.removeAttribute('id');
  5607. cp_image.removeAttribute('style');
  5608. }
  5609. }
  5610. // [Mangabz 漫画] 获取下一页地址
  5611. function mangabz_nextL() {
  5612. var url = '';
  5613. if (MANGABZ_PAGE === MANGABZ_IMAGE_COUNT) { // 下一话
  5614. if (getNextE('//a[./img[contains(@src, "icon_xiayizhang")]]')) getPageE_(curSite.pageUrl); // 访问下一话 URL 获取
  5615. } else { // 下一页
  5616. if (!mkey) var mkey = '';
  5617. 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}`
  5618. if (url === curSite.pageUrl) return
  5619. curSite.pageUrl = url
  5620. //console.log(curSite.pageUrl)
  5621. getPageE_(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
  5622. }
  5623. }
  5624. // [Mangabz 漫画] 插入数据
  5625. function mangabz_insertE(pageE, type) {
  5626. if (pageE) {
  5627. if (type === 'Next') { // 下一页
  5628. let imgArr = eval(pageE),
  5629. _img = '';
  5630. for (let now of imgArr) {_img += `<img src="${now}">`;}
  5631. if (_img) {
  5632. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5633. MANGABZ_PAGE += imgArr.length;
  5634. addHistory(pageE, document.title, location.origin + MANGABZ_CURL.substring(0, MANGABZ_CURL.length - 1) + '-p' + MANGABZ_PAGE + '/');
  5635. }
  5636. } else { // 下一话
  5637. // 插入 <script> 标签
  5638. insScript('html:not([dir]) > head > script:not([src])', document.body, pageE);
  5639. addHistory(pageE);
  5640. pageNum.now = pageNum._now + 1
  5641. replaceElems(pageE)
  5642. MANGABZ_PAGE = 0;
  5643. mangabz_nextL();
  5644. }
  5645. }
  5646. }
  5647.  
  5648.  
  5649. // [动漫屋] 获取下一页地址
  5650. function dm5_nextL() {
  5651. var url = '';
  5652. if (DM5_PAGE === DM5_IMAGE_COUNT) { // 下一话
  5653. if (getNextE('//div[@class="view-paging"]//a[text()="下一章"]')) getPageE_(curSite.pageUrl); // 访问下一话 URL 获取
  5654. } else { // 下一页
  5655. if (!mkey) var mkey = '';
  5656. 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}`
  5657. if (url === curSite.pageUrl) return
  5658. curSite.pageUrl = url
  5659. //console.log(curSite.pageUrl)
  5660. getPageE_(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
  5661. }
  5662. }
  5663. // [动漫屋] 插入数据
  5664. function dm5_insertE(pageE, type) {
  5665. if (pageE) {
  5666. if (type === 'Next') { // 下一页
  5667. let imgArr = eval(pageE),
  5668. _img = '';
  5669. for (let now of imgArr) {_img += `<img src="${now}">`;}
  5670. if (_img) {
  5671. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5672. DM5_PAGE += imgArr.length;
  5673. addHistory(pageE, document.title, location.origin + DM5_CURL.substring(0, DM5_CURL.length - 1) + '-p' + DM5_PAGE + '/');
  5674. }
  5675. } else { // 下一话
  5676. // 插入 <script> 标签
  5677. insScript('html:not([dir]) > head > script:not([src])', document.body, pageE);
  5678. addHistory(pageE);
  5679. pageNum.now = pageNum._now + 1
  5680. replaceElems(pageE)
  5681. DM5_PAGE = 0;
  5682. dm5_nextL();
  5683. }
  5684. }
  5685. }
  5686.  
  5687.  
  5688. // [Xmanhua 漫画] 获取下一页地址
  5689. function xmanhua_nextL() {
  5690. var url = '';
  5691. if (XMANHUA_PAGE === XMANHUA_IMAGE_COUNT) { // 下一话
  5692. if (getNextE('//a[./img[contains(@src, "reader-bottom-right-2.png")]]')) getPageE_(curSite.pageUrl); // 访问下一话 URL 获取
  5693. } else { // 下一页
  5694. if (!mkey) var mkey = '';
  5695. 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}`
  5696. if (url === curSite.pageUrl) return
  5697. curSite.pageUrl = url
  5698. //console.log(curSite.pageUrl)
  5699. getPageE_(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
  5700. }
  5701. }
  5702. // [Xmanhua 漫画] 插入数据
  5703. function xmanhua_insertE(pageE, type) {
  5704. if (pageE) {
  5705. if (type === 'Next') { // 下一页
  5706. let imgArr = eval(pageE),
  5707. _img = '';
  5708. for (let now of imgArr) {_img += `<img src="${now}">`;}
  5709. if (_img) {
  5710. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5711. XMANHUA_PAGE += imgArr.length;
  5712. addHistory(pageE, document.title, location.origin + XMANHUA_CURL.substring(0, XMANHUA_CURL.length - 1) + '-p' + XMANHUA_PAGE + '/');
  5713. }
  5714. } else { // 下一话
  5715. // 插入 <script> 标签
  5716. insScript('html:not([dir]) > head > script:not([src])', document.body, pageE);
  5717. addHistory(pageE);
  5718. pageNum.now = pageNum._now + 1
  5719. replaceElems(pageE)
  5720. XMANHUA_PAGE = 0;
  5721. xmanhua_nextL();
  5722. }
  5723. }
  5724. }
  5725.  
  5726.  
  5727. // [COCOMANGA 漫画] 初始化(调整本话图片)
  5728. function cocomanga_init() {
  5729. let last = getCSS('.mh_comicpic:last-of-type');
  5730. if (last && last.getAttribute('p')) {
  5731. getOne(curSite.pager.insertP[0]).innerHTML = ''; // 删除旧图片元素
  5732. cocomanga_img(parseInt(last.getAttribute('p'))) // 插入新图片元素
  5733. }
  5734. }
  5735. // [COCOMANGA 漫画] 生成图片元素并插入网页
  5736. function cocomanga_img(totalImageCount) {
  5737. if (totalImageCount < 1) return
  5738. let _img = '';
  5739. for (let i=1; i<=totalImageCount; i++) {_img += `<div class="mh_comicpic" p="${i}"><img src="${__cr.getPicUrl(i)}"></div>`;}
  5740. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  5741. }
  5742. // [COCOMANGA 漫画] 插入数据
  5743. function cocomanga_insertE(pageE, type) {
  5744. if (pageE) {
  5745. // 插入 <script> 标签
  5746. insScript('head > script:not([src]), script[src*="custom.js"], script[src*="dynamicjs.js"]', document.body, pageE);
  5747.  
  5748. // 插入新图片元素
  5749. setTimeout(function() {
  5750. let totalImageCount = __cdecrypt('fw122587mkertyui', CryptoJS.enc.Base64.parse(mh_info.enc_code1).toString(CryptoJS.enc.Utf8));
  5751. if (!totalImageCount) totalImageCount = __cdecrypt('fw12558899ertyui', CryptoJS.enc.Base64.parse(mh_info.enc_code1).toString(CryptoJS.enc.Utf8));
  5752. cocomanga_img(parseInt(totalImageCount));
  5753. }, 100)
  5754. addHistory(pageE);
  5755. pageNum.now = pageNum._now + 1
  5756. replaceElems(pageE)
  5757. }
  5758. }
  5759.  
  5760.  
  5761. // [国家自然科学基金] 获取下一页地址
  5762. function nsfc_nextL() {
  5763. let id = decodeURIComponent(document.location.href.split('/')[document.location.href.split('/').length - 1]), data
  5764. if (!document.nowPageNum) document.nowPageNum = 2
  5765. data = `id=${id}&index=${document.nowPageNum}`
  5766. if (data === curSite.pageUrl) return
  5767. curSite.pageUrl = data
  5768. getPageE_(location.origin + '/baseQuery/data/completeProjectReport', 'json', 'POST', data); // 访问下一页 URL 获取
  5769. }
  5770. // [国家自然科学基金] 插入数据
  5771. function nsfc_insertE(pageE, type) {
  5772. if (!pageE || pageE.code != 200) {curSite.SiteTypeID = 0; return}
  5773. if (!pageE.data.hasnext) {curSite.SiteTypeID = 0} else {document.nowPageNum++}
  5774. pageNum.now = pageNum._now + 1
  5775. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), `<img style="width: 100%;" data-magnify="gallery" data-src="${pageE.data.url}" src="${pageE.data.url}">`);
  5776. }
  5777.  
  5778.  
  5779.  
  5780. // [酷科研] 获取下一页地址
  5781. function coolkeyan_nextL() {
  5782. if (!getCSS('.q-img__image')) return
  5783. let id = getCSS('.q-breadcrumbs--last > span.q-breadcrumbs__el'), data
  5784. if (id && id.textContent) {id=parseInt(id.textContent)} else {return}
  5785. if (!document.nowPageNum) document.nowPageNum = 2
  5786. data = `ratify_no=${id}&index=${document.nowPageNum}`
  5787. if (data === curSite.pageUrl) return
  5788. curSite.pageUrl = data
  5789. getPageE_(location.origin + '/api/funds/nsfc/creport?' + data, 'json', 'GET'); // 访问下一页 URL 获取
  5790. }
  5791. // [酷科研] 插入数据
  5792. function coolkeyan_insertE(pageE, type) {
  5793. if (!pageE || pageE == {}) {curSite.SiteTypeID = 0; return}
  5794. if (!pageE.url) {curSite.SiteTypeID = 0; return} else {document.nowPageNum++}
  5795. pageNum.now = pageNum._now + 1
  5796. getCSS('.q-img>div[style*="padding-bottom"]').style.paddingBottom = `${(document.nowPageNum * 1000) - 1000}px`
  5797. 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('${pageE.url}'); top: ${(document.nowPageNum * 1000) - 2000}px"></div>`);
  5798. }
  5799.  
  5800.  
  5801. // --------------------------------------------------------
  5802.  
  5803.  
  5804. // 自动无缝翻页
  5805. function pageLoading() {
  5806. if (curSite.SiteTypeID == 0) return
  5807. windowScroll(function (direction, e) {
  5808. // 下滑 且 未暂停翻页 且 SiteTypeID > 0 时,才准备翻页
  5809. if (direction != 'down' || !pausePage || curSite.SiteTypeID == 0) return
  5810. if (!curSite.pager.type) curSite.pager.type = 1; // 默认翻页模式 1
  5811. if (!curSite.pager.scrollD) curSite.pager.scrollD = 1500; // 默认翻页触发线 1500
  5812. // 翻页模式 5 且为框架内时,要判断顶层是否通过页码暂停翻页了
  5813. if (curSite.pager.type == 5 && self != top && window.top.document.xiu_pausePage == false) return
  5814.  
  5815. let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop,
  5816. scrollHeight = window.innerHeight || document.documentElement.clientHeight,
  5817. scrollD = curSite.pager.scrollD;
  5818. // <<<<< 翻页类型 3(依靠 [基准元素] 与 [浏览器可视区域底部] 之间的距离缩小来触发翻页)>>>>>
  5819. if (curSite.pager.type === 3) {
  5820. if (!curSite.pager.scrollE) curSite.pager.scrollE = curSite.pager.replaceE; // 默认基准元素是页码
  5821. let scrollE = getOne(curSite.pager.scrollE);
  5822. //console.log(scrollE.offsetTop, scrollE.offsetTop - (scrollTop + scrollHeight), scrollD, scrollTop + scrollHeight, curSite.SiteTypeID)
  5823. if (scrollE.offsetTop - (scrollTop + scrollHeight) <= scrollD) {intervalPause(); checkURL(getPageE);}
  5824.  
  5825. } else if (document.documentElement.scrollHeight <= scrollHeight + scrollTop + scrollD) {
  5826. // <<<<< 翻页类型 1(由脚本实现自动无缝翻页)>>>>>
  5827. if (curSite.pager.type === 1) {
  5828. intervalPause(); checkURL(getPageE);
  5829.  
  5830. // <<<<< 翻页类型 2(网站自带了自动无缝翻页功能,只需要点击下一页按钮即可)>>>>>
  5831. } else if (curSite.pager.type === 2) {
  5832. let autopbn = getOne(curSite.pager.nextL);
  5833. if (!autopbn) return
  5834. if (curSite.pager.isHidden && isHidden(autopbn)) return // 如果 isHidden = true,那么需要判断元素是否隐藏
  5835. if (curSite.pager.nextText) {
  5836. // 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页
  5837. if (autopbn.innerText === curSite.pager.nextText) {autopbn.click(); pageNum.now = pageNum._now + 1;}
  5838. } else if (curSite.pager.nextTextOf) {
  5839. // 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页
  5840. if (autopbn.innerText.indexOf(curSite.pager.nextTextOf) > -1) {autopbn.click(); pageNum.now = pageNum._now + 1;}
  5841. } else if (curSite.pager.nextHTML) {
  5842. // 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页
  5843. if (autopbn.innerHTML === curSite.pager.nextHTML) {autopbn.click(); pageNum.now = pageNum._now + 1;}
  5844. } else {
  5845. // 对于没有按钮文字变化的按钮,可以指定间隔时间(默认 300ms)
  5846. if (!curSite.pager.interval) curSite.pager.interval = 300;
  5847. intervalPause();
  5848. // 如果没有指定按钮文字就直接点击
  5849. autopbn.click(); pageNum.now = pageNum._now + 1;
  5850. }
  5851.  
  5852. // <<<<< 翻页类型 4(部分简单的动态加载类网站)>>>>>
  5853. } else if (curSite.pager.type === 4) {
  5854. // 为百度贴吧的发帖考虑,预留底部一小部分...
  5855. if (!(curSite.SiteTypeID === SiteType.BAIDU_TIEBA && document.documentElement.scrollHeight <= scrollHeight + scrollTop + 200)) {
  5856. intervalPause(); if (typeof curSite.pager.nextL == 'function') {curSite.pager.nextL();} else if (getNextE(curSite.pager.nextL)) {getPageE_(curSite.pageUrl);}
  5857. }
  5858.  
  5859. // <<<<< 翻页类型 5(插入 iframe 方式来加载下一页)>>>>>
  5860. } else if (curSite.pager.type === 5) {
  5861. checkURL(insIframe);
  5862.  
  5863. // <<<<< 翻页类型 6(通过 iframe 获取下一页动态加载内容)>>>>>
  5864. } else if (curSite.pager.type === 6) {checkURL(insIframe_);}
  5865. }
  5866. });
  5867.  
  5868. function intervalPause() {
  5869. if (curSite.pager.interval) {
  5870. pausePage = false
  5871. setTimeout(function(){pausePage = true;}, curSite.pager.interval)
  5872. }
  5873. }
  5874. }
  5875.  
  5876. // 翻页类型 1/3
  5877. function getPageE(url) {
  5878. GM_xmlhttpRequest({
  5879. url: url,
  5880. method: 'GET',
  5881. overrideMimeType: 'text/html; charset=' + document.charset,
  5882. headers: {
  5883. 'Referer': location.href,
  5884. 'User-Agent': navigator.userAgent
  5885. },
  5886. timeout: 10000,
  5887. onload: function (response) {
  5888. try {
  5889. //console.log('URL:' + url, '最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  5890. processElems(createDocumentByString(response.responseText));
  5891. } catch (e) {
  5892. console.log(e);
  5893. }
  5894. }
  5895. });
  5896. }
  5897. // 翻页类型 4
  5898. function getPageE_(url, type = '', method = 'GET', data = '', type2) {
  5899. let mimeType;
  5900. switch (type) {
  5901. case 'json':
  5902. mimeType = 'application/json; charset=' + document.charset; break;
  5903. case 'text':
  5904. mimeType = 'text/plain; charset=' + document.charset; break;
  5905. default:
  5906. mimeType = 'text/html; charset=' + document.charset;
  5907. }
  5908.  
  5909. GM_xmlhttpRequest({
  5910. url: url,
  5911. method: method,
  5912. data: data,
  5913. responseType: type,
  5914. overrideMimeType: mimeType,
  5915. headers: {
  5916. 'Referer': location.href,
  5917. 'Content-Type': (method === 'POST') ? 'application/x-www-form-urlencoded':'',
  5918. 'User-Agent': navigator.userAgent
  5919. },
  5920. timeout: 10000,
  5921. onload: function (response) {
  5922. try {
  5923. //console.log('最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  5924. switch (type) {
  5925. case 'json':
  5926. curSite.pager.insertE(response.response, type2);
  5927. break;
  5928. case 'text':
  5929. curSite.pager.insertE(response.responseText, type2)
  5930. break;
  5931. default:
  5932. curSite.pager.insertE(createDocumentByString(response.responseText), type2)
  5933. }
  5934. } catch (e) {
  5935. console.log(e);
  5936. }
  5937. }
  5938. });
  5939. }
  5940. // 翻页类型 5(插入 iframe 方式加载下一页,无限套娃)
  5941. function insIframe(src) {
  5942. // 停用当前页面翻页
  5943. if (curSite.SiteTypeID == 0) return
  5944. curSite.SiteTypeID = 0;
  5945.  
  5946. // 创建 iframe
  5947. let iframe = document.createElement('iframe');
  5948. iframe.style = 'position: absolute; width: 100%; height: 100%; border: none;';
  5949. iframe.id = 'xiu_iframe';
  5950. iframe.src = src;
  5951.  
  5952. var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop
  5953. // 当滚动条到底部时(即完全显示 iframe 框架),隐藏当前页面的滚动条
  5954. window.addEventListener('scroll', function () {
  5955. let scrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  5956. clientHeight = document.documentElement.clientHeight || document.body.clientHeight,
  5957. scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight,
  5958. afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  5959. delta = afterScrollTop - beforeScrollTop;
  5960. if (delta == 0) return false;
  5961. beforeScrollTop = afterScrollTop;
  5962.  
  5963. //console.log(delta, (scrollTop + clientHeight + 10), scrollHeight, '1111')
  5964. if (delta > 0 && scrollTop + clientHeight + 10 >= scrollHeight && !getCSS('#xiu-scroll')) {
  5965. let newStyle = document.createElement('style'); newStyle.id = 'xiu-scroll';
  5966. newStyle.textContent = 'html::-webkit-scrollbar, body::-webkit-scrollbar {width: 0 !important;height: 0 !important;} html, body {scrollbar-width: none !important;}';
  5967. if (curSite.pager.style) newStyle.textContent += curSite.pager.style;
  5968. document.documentElement.appendChild(newStyle);
  5969. iframe.focus();
  5970. iframe.document.body.focus();
  5971. //iframe.document.body.click();
  5972. } else if (delta < 0 && getCSS('#xiu-scroll')) {
  5973. getCSS('#xiu-scroll').remove();
  5974. }
  5975. }, false);
  5976.  
  5977. // 加载完成后才继续
  5978. iframe.onload = function() {
  5979. // 添加历史记录
  5980. if (curSite.history !== false) addHistory(iframe.contentWindow.document, iframe.contentWindow.document.title);
  5981. // 当前页码 + 1
  5982. if (!curSite.hiddenPN) {
  5983. let autopageNumber = getCSS('#Autopage_number', window.top.document)
  5984. if (autopageNumber) {autopageNumber.textContent = parseInt(autopageNumber.textContent) + 1;}
  5985. }
  5986. }
  5987.  
  5988. // 插入 iframe
  5989. document.documentElement.appendChild(iframe);
  5990. }
  5991. // 翻页类型 6(通过 iframe 获取下一页动态加载内容,只有一个娃)
  5992. function insIframe_(src) {
  5993. // 暂停翻页
  5994. if (!pausePage) return
  5995. pausePage = false
  5996. //console.log(src)
  5997. // 如果不存在,则创建一个 iframe
  5998. let iframe = document.getElementById('xiu_iframe');
  5999. if (!iframe) {
  6000. iframe = document.createElement('iframe');
  6001. iframe.style = 'position: absolute; top: -9999px; left: -9999px; width: 100%; height: 100%; border: none; z-index: -999; /*visibility: hidden;*/';
  6002. iframe.id = 'xiu_iframe';
  6003. iframe.src = src;
  6004. }
  6005.  
  6006. // 加载完成后才继续
  6007. iframe.onload = function() {
  6008. //iframe.contentWindow.scrollTo(0, 999999); // 滚动到底部,以触发网页的滚动条相关加载事件
  6009. //iframe.contentWindow.scrollTo({top: 9999999, behavior: 'smooth'});
  6010. if (!curSite.pager.loadTime) curSite.pager.loadTime = 100; // 默认 100ms
  6011. //console.log(curSite.pager.loadTime, curSite.pager.loadTime/30)
  6012. //console.time('sort');
  6013. let time1 = 0 ,time2 = setInterval(function(){
  6014. let scrollHeight = (iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight)/10
  6015. iframe.contentWindow.scrollTo(0, 999999);
  6016. iframe.contentWindow.scrollTo(0, scrollHeight*time1);
  6017. //console.log(time1, iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight)
  6018. if (++time1 == 10) {
  6019. //console.timeEnd('sort');
  6020. clearInterval(time2);
  6021. processElems(iframe.contentWindow.document); // 插入/替换元素等
  6022. //console.log(iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight)
  6023. pausePage = true; // 恢复翻页
  6024. }
  6025. }, curSite.pager.loadTime/10)
  6026. }
  6027.  
  6028. // 插入 iframe(如果已存在则直接改 src)
  6029. if (document.getElementById('xiu_iframe')) {
  6030. iframe.src = src;
  6031. } else {
  6032. document.documentElement.appendChild(iframe);
  6033. }
  6034. }
  6035.  
  6036.  
  6037. // XHR 后处理结果,插入、替换元素等(适用于翻页类型 1/3/6)
  6038. function processElems(response) {
  6039. if (!curSite.pager.insertP) {curSite.pager.insertP = [curSite.pager.pageE, 5]}
  6040. let pageE = getAll(curSite.pager.pageE, response, response), toE;
  6041. if (curSite.pager.insertP[1] === 5) { // 插入 pageE 列表最后一个元素的后面
  6042. toE = getAll(curSite.pager.insertP[0]).pop();
  6043. } else {
  6044. toE = getOne(curSite.pager.insertP[0]);
  6045. }
  6046. //console.log(curSite.pager.pageE, pageE, curSite.pager.insertP, toE)
  6047.  
  6048. if (pageE.length > 0 && toE) {
  6049. // 如果有插入前函数就执行函数
  6050. if (curSite.function && curSite.function.bF) {
  6051. if (curSite.function.bFp) { // 如果指定了参数
  6052. if (typeof(curSite.function.bF) == 'string') { // 如果是字符串,说明是自定义规则
  6053. if (window.autoPage[curSite.function.bF]) {
  6054. pageE = window.autoPage[curSite.function.bF](pageE, curSite.function.bFp);
  6055. } else {
  6056. pageE = new Function('pageE', 'bFp', 'fun', curSite.function.bF)(pageE, curSite.function.bFp, window.autoPage)
  6057. }
  6058. } else {
  6059. pageE = curSite.function.bF(pageE, curSite.function.bFp);
  6060. }
  6061. } else {
  6062. if (typeof(curSite.function.bF) == 'string') { // 如果是字符串,说明是自定义规则
  6063. if (window.autoPage[curSite.function.bF]) {
  6064. pageE = window.autoPage[curSite.function.bF](pageE);
  6065. } else {
  6066. pageE = new Function('pageE', 'fun', curSite.function.bF)(pageE, window.autoPage)
  6067. }
  6068. } else {
  6069. pageE = curSite.function.bF(pageE);
  6070. }
  6071. }
  6072. }
  6073.  
  6074. // 插入位置
  6075. let addTo = getAddTo(curSite.pager.insertP[1]);
  6076.  
  6077. // 插入新页面元素
  6078. if (curSite.pager.insertP[1] === 6) { // 插入到目标内部末尾(针对文本,比如小说网页)
  6079. let afterend = '';
  6080. if (curSite.pager.insertP6Br) afterend += '<br/><br/>'
  6081. pageE.forEach(function (one) {afterend += one.innerHTML;});
  6082. toE.insertAdjacentHTML(addTo, afterend);
  6083. } else {
  6084. if (curSite.pager.insertP[1] === 2 || curSite.pager.insertP[1] === 4 || curSite.pager.insertP[1] === 5) pageE.reverse(); // 插入到 [元素内头部]、[目标本身后面] 时,需要反转顺序
  6085. pageE.forEach(function (one) {toE.insertAdjacentElement(addTo, one);});
  6086. }
  6087.  
  6088. // 当前页码 + 1
  6089. pageNum.now = pageNum._now + 1
  6090.  
  6091. // 添加历史记录
  6092. if (curSite.history !== false) addHistory(response);
  6093.  
  6094. // 替换待替换元素
  6095. if (curSite.pager.replaceE) replaceElems(response);
  6096.  
  6097. // 插入 <script> 标签
  6098. if (curSite.pager.scriptT || curSite.pager.scriptT == 0) {
  6099. switch (curSite.pager.scriptT) {
  6100. case 0: // 下一页的所有 <script> 标签
  6101. insScript('script', toE, response); break;
  6102. case 1: // 下一页的所有 <script> 标签(不包括 src 链接)
  6103. insScript('script:not([src])', toE, response); break;
  6104. case 2: // 下一页主体元素 (pageE) 的同级 <script> 标签
  6105. insScript(null, toE, pageE); break;
  6106. case 3: // 下一页主体元素 (pageE) 的子元素 <script> 标签
  6107. insScript('script:not([src])', toE, pageE); break;
  6108. }
  6109. }
  6110.  
  6111. // 如果有插入后函数就执行函数
  6112. if (curSite.function && curSite.function.aF) {
  6113. if (curSite.function.aFp) { // 如果指定了参数
  6114. if (typeof(curSite.function.aF) == 'string') { // 如果是字符串,说明是自定义规则
  6115. if (window.autoPage[curSite.function.aF]) {
  6116. window.autoPage[curSite.function.aF](curSite.function.aFp);
  6117. } else {
  6118. new Function('aFp', 'fun', curSite.function.aF)(curSite.function.aFp, window.autoPage)
  6119. }
  6120. } else {
  6121. curSite.function.aF(curSite.function.aFp);
  6122. }
  6123. } else {
  6124. if (typeof(curSite.function.aF) == 'string') { // 如果是字符串,说明是自定义规则
  6125. if (window.autoPage[curSite.function.aF]) {
  6126. window.autoPage[curSite.function.aF]();
  6127. } else {
  6128. new Function('fun', curSite.function.aF)(window.autoPage);
  6129. }
  6130. } else {
  6131. curSite.function.aF();
  6132. }
  6133. }
  6134. }
  6135. } else { // 获取主体元素失败后,尝试重新获取
  6136. console.log(curSite.pager.pageE, pageE, curSite.pager.insertP, toE)
  6137. if (curSite.retry) {
  6138. console.warn('[自动无缝翻页] 获取主体元素失败,尝试重新获取...')
  6139. setTimeout(function(){curSite.pageUrl = '';}, curSite.retry)
  6140. } else { // 尝试替换元素看能不能继续翻页下去
  6141. if (curSite.pager.replaceE) {
  6142. if (replaceElems(response)) { // 如果替换成功
  6143. console.log('[自动无缝翻页] 获取主体元素失败,尝试替换元素成功!')
  6144. pageNum.now = pageNum._now + 1; // 当前页码 + 1
  6145. if (curSite.history !== false) addHistory(response); // 添加历史记录
  6146. } else {console.error('[自动无缝翻页] 获取主体元素失败,尝试替换元素失败...')}
  6147. }
  6148. }
  6149. }
  6150. }
  6151. // 通用型插入前函数(加载图片)
  6152. function src_bF(pageE, css) {
  6153. pageE.forEach(function (one) {
  6154. if (css[0] == 0) { // src 图片
  6155. if (one.tagName == 'IMG' && one.getAttribute(css[2])) one.src = one.getAttribute(css[2]);
  6156. one.querySelectorAll(css[1]).forEach(function (now) {
  6157. now.src = now.getAttribute(css[2]);
  6158. });
  6159. } else if (css[0] == 1) { // 背景图片
  6160. if (one.tagName == 'IMG' && one.getAttribute(css[2])) one.style.backgroundImage = 'url("' + one.getAttribute(css[2]) + '")';
  6161. one.querySelectorAll(css[1]).forEach(function (now) {
  6162. now.style.backgroundImage = 'url("' + now.getAttribute(css[2]) + '")';
  6163. });
  6164. }
  6165. });
  6166. return pageE
  6167. }
  6168. // 文字型插入前函数(正则过滤)
  6169. function xs_bF(pageE, reg) {
  6170. if (typeof reg[0] === 'string' && reg[0].slice(0,1) === '/') reg[0] = new RegExp(reg[0].slice(1,reg[0].length-1), 'i')
  6171. pageE.forEach(function (one) {
  6172. one.innerHTML = one.innerHTML.replace(reg[0], reg[1])
  6173. });
  6174. return pageE
  6175. }
  6176.  
  6177. // 通用型获取下一页地址(从 元素 中获取页码)
  6178. function getNextE(css) {
  6179. if (!css) css = curSite.pager.nextL;
  6180. let next = getOne(css);
  6181. if (next && next.nodeType === 1 && next.href && next.href.slice(0,4) === 'http' && next.href != curSite.pageUrl) {
  6182. if (curSite.pager.forceHTTPS && location.protocol === 'https:') {
  6183. curSite.pageUrl = next.href.replace(/^http:/,'https:');
  6184. } else {
  6185. curSite.pageUrl = next.href;
  6186. }
  6187. //console.log(curSite.pageUrl)
  6188. return true
  6189. }
  6190. return false
  6191. }
  6192. // 通用型获取下一页地址(从 元素 中获取页码,URL 替换 page= 参数)
  6193. function getNextEP(css, pf, reg) {
  6194. let nextNum = getOne(css), url = '';
  6195. if (nextNum && nextNum.textContent) {
  6196. nextNum = nextNum.textContent.replaceAll(' ','');
  6197. if (location.search) {
  6198. if (indexOF(pf, 's')) {
  6199. url = location.search.replace(reg, pf + nextNum);
  6200. } else {
  6201. url = location.search + '&' + pf + nextNum;
  6202. }
  6203. } else {
  6204. url = '?' + pf + nextNum;
  6205. }
  6206. url = location.origin + location.pathname + url;
  6207. }
  6208. return url
  6209. }
  6210. // 通用型获取下一页地址(从 元素 中获取页码,URL 替换 pathname 路径)
  6211. function getNextEPN(css, reg, a, b = '') {
  6212. let nextNum = getOne(css), url = '';
  6213. if (nextNum && nextNum.textContent) {
  6214. nextNum = nextNum.textContent.replaceAll(' ','');
  6215. if (location.pathname) {
  6216. if (indexOF(reg)) {
  6217. url = location.pathname.replace(reg, a + nextNum + b);
  6218. } else {
  6219. url = location.pathname + a + nextNum + b;
  6220. }
  6221. } else {
  6222. url = location.pathname + a + nextNum + b;
  6223. }
  6224. url = location.origin + url;
  6225. }
  6226. return url
  6227. }
  6228. // 通用型获取下一页地址(从 URL 中获取页码,URL 替换 pathname 路径)
  6229. function getNextUPN(reg1, reg, a, b = '', initP = '2', endP) {
  6230. let nextNum = reg1.exec(location.pathname);
  6231. if (nextNum) {
  6232. nextNum = String(parseInt(nextNum[0])+1);
  6233. if (endP && (parseInt(nextNum[0]) > parseInt(endP))) return ''
  6234. } else {
  6235. nextNum = initP;
  6236. if (endP && (parseInt(nextNum[0]) >= parseInt(endP))) return ''
  6237. }
  6238. let url = '';
  6239. if (location.pathname) {
  6240. if (indexOF(reg)) {
  6241. url = location.pathname.replace(reg, a + nextNum + b);
  6242. } else {
  6243. url = location.pathname + a + nextNum + b;
  6244. }
  6245. } else {
  6246. url = location.pathname + a + nextNum + b;
  6247. }
  6248. url = location.origin + url;
  6249. return url
  6250. }
  6251. // 通用型获取下一页地址(从 URL 中获取页码,URL 替换 page= 参数)
  6252. function getNextUP(pf, reg, lp = location.pathname, initP = '2', endP) {
  6253. let nextNum = getSearch(pf.replace('=',''));
  6254. if (nextNum) {
  6255. nextNum = String(parseInt(nextNum)+1);
  6256. if (endP && (parseInt(nextNum) > parseInt(endP))) return ''
  6257. } else {
  6258. nextNum = initP;
  6259. if (endP && (parseInt(nextNum) >= parseInt(endP))) return ''
  6260. }
  6261. let url = '';
  6262. if (location.search) {
  6263. if (indexOF(pf, 's')) {
  6264. url = location.search.replace(reg, pf + nextNum);
  6265. } else {
  6266. url = location.search + '&' + pf + nextNum;
  6267. }
  6268. } else {
  6269. url = '?' + pf + nextNum;
  6270. }
  6271. url = location.origin + lp + url;
  6272. return url
  6273. }
  6274. // 通用型获取下一页地址(从 form input 中获取,返回 GET URL)
  6275. function getNextF(css) {
  6276. let form = getOne(css), value = '';
  6277. if (form) {
  6278. form.querySelectorAll('input[name]').forEach(function(input) {value += input.name + '=' + input.value + '&';}) // 生成表单参数
  6279. value = encodeURI(value.replace(/&$/,'')); // 清理最后一个 & 符号
  6280. if (form.action && value) return (form.action + '?' + value)
  6281. }
  6282. return '';
  6283. }
  6284.  
  6285.  
  6286. // 检查 URL
  6287. function checkURL(func) {
  6288. if (typeof curSite.pager.nextL == 'function') {
  6289. let tempUrl = curSite.pager.nextL();
  6290. if (!tempUrl || (tempUrl && tempUrl.slice(0,4) != 'http') || tempUrl === curSite.pageUrl ) return;
  6291. curSite.pageUrl = tempUrl;
  6292. func(curSite.pageUrl);
  6293. } else if (curSite.pager.nextL && curSite.pager.nextL.search(/^js;/i) === 0) { // 自定义翻页规则中执行 JavaScript 代码的
  6294. let tempUrl = new Function('fun', curSite.pager.nextL.slice(3))(window.autoPage);
  6295. if (!tempUrl || (tempUrl && tempUrl.slice(0,4) != 'http') || tempUrl === curSite.pageUrl ) return;
  6296. curSite.pageUrl = tempUrl;
  6297. func(curSite.pageUrl);
  6298. } else if (getNextE()) {
  6299. func(curSite.pageUrl);
  6300. }
  6301. //console.log(curSite.pageUrl);
  6302. }
  6303. // 替换元素
  6304. function replaceElems(pageE, o = curSite.pager.replaceE, r = curSite.pager.replaceE) {
  6305. let oE = getAll(o),
  6306. rE = getAll(r, pageE, pageE);
  6307. //console.log(oE, rE)
  6308. if (oE.length != 0 && rE.length != 0 && oE.length === rE.length) {
  6309. for (let i = 0; i < oE.length; i++) {
  6310. oE[i].outerHTML = rE[i].outerHTML;
  6311. }
  6312. return true
  6313. }
  6314. return false
  6315. }
  6316. // 添加历史记录
  6317. function addHistory(pageE, title, url) {
  6318. if (!curSite.pageUrl) return
  6319. // 对于自带类似功能 或者 覆盖了 history 原生函数的网站,则跳过不再添加历史记录
  6320. if (window.top.history.toString() !== '[object History]') return
  6321.  
  6322. //console.log(pageE.querySelector('title'), curSite.pageUrl)
  6323. title = title || pageE.querySelector('title').textContent || window.top.document.title;
  6324. url = url || curSite.pageUrl;
  6325. window.top.document.title = title;
  6326. window.top.document.xiu_nowUrl = curSite.pageUrl;
  6327. window.top.history.pushState('xiu_history', title, url);
  6328. }
  6329. // 插入 <Script>
  6330. function insScript(selector, toE = document.body, contextNode = document) {
  6331. let scriptElems = contextNode;
  6332. if (selector) {
  6333. if (contextNode instanceof Array) {
  6334. scriptElems = []; contextNode.forEach(function (one) {scriptElems = scriptElems.concat(getAll(selector, one, one));})
  6335. } else {
  6336. scriptElems = getAll(selector, contextNode, contextNode);
  6337. }
  6338. }
  6339. scriptElems.forEach(function (one) {
  6340. if (one.tagName === 'SCRIPT') {
  6341. if (one.src) {
  6342. toE.appendChild(document.createElement('script')).src = one.src;
  6343. } else {
  6344. toE.appendChild(document.createElement('script')).textContent = one.textContent;
  6345. }
  6346. }
  6347. });
  6348. }
  6349. // 插入 <Style>
  6350. function insStyle(style) {
  6351. document.documentElement.appendChild(document.createElement('style')).textContent = style;
  6352. }
  6353.  
  6354.  
  6355. // 获取元素(CSS/Xpath)来自:https://github.com/machsix/Super-preloader
  6356. function getCSS(css, contextNode = document) {
  6357. return contextNode.querySelector(css);
  6358. }
  6359. function getAllCSS(css, contextNode = document) {
  6360. return [].slice.call(contextNode.querySelectorAll(css));
  6361. }
  6362. function getXpath(xpath, contextNode, doc = document) {
  6363. contextNode = contextNode || doc;
  6364. try {
  6365. const result = doc.evaluate(xpath, contextNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  6366. // 应该总是返回一个元素节点
  6367. return result.singleNodeValue && result.singleNodeValue.nodeType === 1 && result.singleNodeValue;
  6368. } catch (err) {
  6369. throw new Error(`无效 Xpath: ${xpath}`);
  6370. }
  6371. }
  6372. function getAllXpath(xpath, contextNode, doc = document) {
  6373. contextNode = contextNode || doc;
  6374. const result = [];
  6375. try {
  6376. const query = doc.evaluate(xpath, contextNode, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  6377. for (let i = 0; i < query.snapshotLength; i++) {
  6378. const node = query.snapshotItem(i);
  6379. // 如果是 Element 节点
  6380. if (node.nodeType === 1) result.push(node);
  6381. }
  6382. } catch (err) {
  6383. throw new Error(`无效 Xpath: ${xpath}`);
  6384. }
  6385. return result;
  6386. }
  6387. function getOne(selector, contextNode = undefined, doc = document) {
  6388. if (!selector) return;
  6389. contextNode = contextNode || doc;
  6390. if (selector.slice(0,1) === '/' || selector.slice(0,2) === './' || selector.slice(0,3) === 'id(') {
  6391. return getXpath(selector, contextNode, doc);
  6392. } else {
  6393. return getCSS(selector, contextNode);
  6394. }
  6395. }
  6396. function getAll(selector, contextNode = undefined, doc = document) {
  6397. if (!selector) return [];
  6398. contextNode = contextNode || doc;
  6399. if (selector.slice(0,1) === '/' || selector.slice(0,2) === './' || selector.slice(0,3) === 'id(') {
  6400. return getAllXpath(selector, contextNode, doc);
  6401. } else {
  6402. return getAllCSS(selector, contextNode);
  6403. }
  6404. }
  6405. function createDocumentByString(e) {
  6406. if (e) {
  6407. if ('HTML' !== document.documentElement.nodeName) return (new DOMParser).parseFromString(e, 'application/xhtml+xml');
  6408. var t;
  6409. try { t = (new DOMParser).parseFromString(e, 'text/html');} catch (e) {}
  6410. if (t) return t;
  6411. if (document.implementation.createHTMLDocument) {
  6412. t = document.implementation.createHTMLDocument('ADocument');
  6413. } else {
  6414. 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) {}
  6415. }
  6416. if (t) {
  6417. var r = document.createRange(),
  6418. n = r.createContextualFragment(e);
  6419. r.selectNodeContents(document.body);
  6420. t.body.appendChild(n);
  6421. 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);
  6422. return t;
  6423. }
  6424. } else console.error('没有找到要转成 DOM 的字符串');
  6425. }
  6426.  
  6427.  
  6428. // 强制新标签页打开链接(翻页模式 5/6)
  6429. function forceTarget() {
  6430. document.body.addEventListener('click', function(e) {
  6431. if (e.target.tagName === 'A') {
  6432. forceTarget_(e.target, e);
  6433. } else {
  6434. let path = e.path || e.composedPath();
  6435. for (let i = 1; i < path.length - 3; i++) {
  6436. //console.log(path[i])
  6437. if (path[i].tagName === 'A') {
  6438. forceTarget_(path[i], e);
  6439. break;
  6440. }
  6441. }
  6442. }
  6443. });
  6444.  
  6445. function forceTarget_(target, e){
  6446. if (target.href && target.target != '_blank' && !(target.getAttribute('onclick')) && target.href.slice(0,4) == 'http' && target.getAttribute('href').slice(0,1) != '#') {
  6447. e.preventDefault(); // 阻止默认打开链接事件
  6448. //console.log(target.href);
  6449. //window.top.location.href = target.href;
  6450. window.GM_openInTab(target.href, {active: true,insert: true,setParent: true});
  6451. }
  6452. }
  6453. //document.head.appendChild(document.createElement('base')).target = '_top';
  6454. }
  6455. // 判断元素是否隐藏(隐藏返回 true)
  6456. function isHidden(el){
  6457. return (el.offsetParent === null);
  6458. }
  6459. // 判断是否为手机版(是则返回 true)
  6460. function isMobile(){
  6461. 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));
  6462. }
  6463. // 判断 URL 是否存在指定文本
  6464. function indexOF(e, l = 'p', low = false){
  6465. switch (l) {
  6466. case 'h':
  6467. l = location.href; break;
  6468. case 'p':
  6469. l = location.pathname; break;
  6470. case 's':
  6471. l = location.search; break;
  6472. }
  6473. //console.log(l,e,l.indexOf(e))
  6474. if (low) {e = e.toLowerCase(); l = l.toLowerCase();} // 全部转为小写
  6475. if (e instanceof RegExp) {
  6476. if (e.test(l)) return true
  6477. } else {
  6478. if (l.indexOf(e) > -1) return true
  6479. }
  6480. return false
  6481. }
  6482. // 获取 Search 指定参数
  6483. function getSearch(variable) {
  6484. let query = window.location.search.substring(1),
  6485. vars = query.split('&');
  6486. for (var i=0;i<vars.length;i++) {
  6487. var pair = vars[i].split('=');
  6488. if(pair[0] == variable){return pair[1];}
  6489. }
  6490. return '';
  6491. }
  6492. // 启用/禁用 (当前网站)
  6493. function menu_disable(type) {
  6494. switch(type) {
  6495. case 'check':
  6496. return check(); break;
  6497. case 'add':
  6498. add(); break;
  6499. case 'del':
  6500. del(); break;
  6501. }
  6502.  
  6503. function check() { // 存在返回真,不存在返回假
  6504. if (GM_getValue('menu_disable').indexOf(location.hostname) == -1) return false // 不存在返回假
  6505. return true
  6506. }
  6507.  
  6508. function add() {
  6509. if (check()) return
  6510. let list = GM_getValue('menu_disable'); // 读取网站列表
  6511. list.push(location.hostname); // 追加网站域名
  6512. GM_setValue('menu_disable', list); // 写入配置
  6513. location.reload(); // 刷新网页
  6514. }
  6515.  
  6516. function del() {
  6517. if (!check()) return
  6518. let list = GM_getValue('menu_disable'), // 读取网站列表
  6519. index = list.indexOf(location.hostname);
  6520. list.splice(index, 1); // 删除网站域名
  6521. GM_setValue('menu_disable', list); // 写入配置
  6522. location.reload(); // 刷新网页
  6523. }
  6524. }
  6525. // 左键双击网页空白处暂停翻页
  6526. function pausePageEvent() {
  6527. if (!GM_getValue('menu_pause_page')) return
  6528. if (curSite.SiteTypeID === 0) return
  6529. if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
  6530. document.body.addEventListener('dblclick', function () {
  6531. if (pausePage) {GM_notification({text: `❌ 已暂停本页 [自动无缝翻页]\n (再次双击可恢复)`, timeout: 2000});} else {GM_notification({text: `✅ 已恢复本页 [自动无缝翻页]\n (再次双击可暂停)`, timeout: 2000});}
  6532. pausePage = !pausePage;
  6533. if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
  6534. });
  6535. }
  6536. // 自定义翻页规则
  6537. function customRules() {
  6538. if (getCSS('#Autopage_customRules')) return
  6539. // 改名过渡,过段时间将其移除
  6540. let customRules = JSON.stringify(GM_getValue('menu_customRules', {}), null, '\t').replaceAll('functionS', 'url').replaceAll('css;', '');
  6541. if (customRules == '{}') customRules = '{\n\t\n}'; // 引导用户插入位置
  6542. 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;">
  6543. <h3 style="font-size: 24px !important;"><strong># 自定义翻页规则(优先于脚本内置规则)-【将规则插入默认的 <code>{ }</code> 中间】</strong></h3>
  6544. <details>
  6545. <summary><kbd><strong>「 点击展开 查看示例 」(我把常用规则都塞进去了,方便需要的时候可直接复制一份修改使用)</strong></kbd></summary>
  6546. <ul style="list-style: disc !important; margin-left: 35px !important;">
  6547. <li>翻页规则为 JSON 格式,因此大家需要多少<strong>了解一点 JSON 的基本格式</strong>(主要就是逗号、转义、双引号等)。</li>
  6548. <li>具体的翻页规则说明、示例,为了方便更新及补充,我都写到 <strong><a href="https://github.com/XIU2/UserScript/issues/176" target="_blank">Github</a></strong> 里面了。</li>
  6549. <li>脚本会自动格式化规则,因此<strong>无需手动缩进、换行</strong>,只需把规则<strong>插入默认的 { } 中间</strong>即可。</li>
  6550. <li style="color: #ff3535 !important;">注意:目前自定义翻页规则处于 Beta 阶段,随时可能更改规则格式/语法,具体请关注上面的 Github 链接。</li>
  6551. </ul>
  6552. <pre>
  6553. // 大多数网站一般都只需要像第一个 "aaa" 这样的规则(注意,不要连带着复制这几行注释说明)
  6554. // 其中 "scrollD" 是用来控制翻页敏感度的(越大就越早触发翻页,访问速度慢的网站需要调大,可省略(注意逗号),默认 1500)
  6555. // 每个规则第一行的规则名(即 "aaa": { )是唯一的,不能重复(包括与脚本内置规则),否则会被覆盖,支持中文
  6556. {
  6557. "aaa": {
  6558. "host": "aaa.com",
  6559. "url": "/xxx/",
  6560. "pager": {
  6561. "nextL": "xxx",
  6562. "pageE": "xxx",
  6563. "replaceE": "xxx",
  6564. "scrollD": 1000
  6565. }
  6566. },
  6567. "bbb": {
  6568. "host": ["bbb1.com", "bbb2.com"],
  6569. "url": "/^\\/s$/",
  6570. "style": ".aaaa {display: none !important;}",
  6571. "pager": {
  6572. "type": 1,
  6573. "nextL": "id('page')//a[contains(text(),'下一页') or text()='下一页']",
  6574. "pageE": "aaa",
  6575. "insertP": [".bbb",3],
  6576. "replaceE": ".page",
  6577. "scriptT": 1,
  6578. "interval": 500,
  6579. "scrollD": 1500
  6580. },
  6581. "function": {
  6582. "bF": "return fun.src_bF(pageE, [0,'img[data-src]','data-src'])",
  6583. "aF": "document.body.appendChild(document.createElement('script')).textContent = 'xxx'"
  6584. }
  6585. },
  6586. "这里也可以用中文": {
  6587. "host": "/\\.ccc\\.com/",
  6588. "url": "return (fun.lp() == '/' || fun.indexOF('/s'))",
  6589. "pager": {
  6590. "type": 2,
  6591. "nextL": "#autopbn",
  6592. "nextText": "下一页",
  6593. "nextTextOf": "下一页",
  6594. "interval": 1000,
  6595. "scrollD": 1500
  6596. }
  6597. }
  6598. }
  6599. </pre>
  6600. </details>
  6601.  
  6602. <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>
  6603. <button id="Autopage_customRules_save" style="margin-right: 20px !important;">保存并刷新</button><button id="Autopage_customRules_cancel">取消修改</button>
  6604. </div>`
  6605. document.documentElement.insertAdjacentHTML('beforeend', _html);
  6606. document.documentElement.style.overflow = document.body.style.overflow = 'hidden';
  6607. // 点击事件
  6608. getCSS('#Autopage_customRules_save').onclick = function () {
  6609. // 改名过渡,过段时间将其移除
  6610. customRules = getCSS('#Autopage_customRules_textarea').value.replaceAll('functionS', 'url').replaceAll('css;', '');
  6611. //console.log(customRules)
  6612. if (!customRules) customRules = '{}'
  6613. try {
  6614. customRules = JSON.parse(customRules)
  6615. //console.log(customRules)
  6616. GM_setValue('menu_customRules', customRules)
  6617. location.reload();
  6618. } catch (e) {
  6619. console.error('自定义规则存在格式错误:\n' + e + '\n\n格式错误一般为:\n· 逗号:每组 {} 中的最后一个值末尾不能加逗号\n\n· 转义:如果正则表达式中含有转义符 \\ 那就要对其再次转义为 \\\\\n\n· 双引号:规则中冒号左右的内容都需要加上双引号,如果内容中含有双引号则需要对双引号转义(即 \\" 这样),或改为单引号')
  6620. window.alert('自定义规则存在格式错误:\n' + e + '\n\n格式错误一般为:\n· 逗号:每组 {} 中的最后一个值末尾不能加逗号\n\n· 转义:如果正则表达式中含有转义符 \\ 那就要对其再次转义为 \\\\\n\n· 双引号:规则中冒号左右的内容都需要加上双引号,如果内容中含有双引号则需要对双引号转义(即 \\" 这样),或改为单引号');
  6621. }
  6622. }
  6623. getCSS('#Autopage_customRules_cancel').onclick = function () {document.documentElement.style.overflow = document.body.style.overflow = ''; getCSS('#Autopage_customRules').remove();}
  6624. }
  6625. // 显示页码
  6626. function pageNumber(type) {
  6627. 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}
  6628. let status = getCSS('#Autopage_number');
  6629. switch (type) {
  6630. case 'add':
  6631. add(); break;
  6632. case 'del':
  6633. del(); break;
  6634. case 'set':
  6635. set(); break;
  6636. }
  6637.  
  6638. function add(){
  6639. if (status) {
  6640. if (status.style.display === 'none') {status.style.display = 'flex';}
  6641. return
  6642. }
  6643. // 插入网页
  6644. 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>`,
  6645. _html = `<div id="Autopage_number" title="1. 此处数字为 [当前页码] (可在脚本菜单中关闭)&#10;&#10;2. 鼠标左键点击此处可 [临时暂停翻页](再次点击可恢复)">${pageNum._now}</div>`
  6646. document.documentElement.insertAdjacentHTML('beforeend', _style + _html);
  6647. // 解决 远景论坛 会清理掉前面插入的 CSS 样式的问题
  6648. if (location.hostname === 'bbs.pcbeta.com') {setTimeout(function(){document.documentElement.insertAdjacentHTML('beforeend', _style);}, 500);}
  6649. if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
  6650. // 点击事件(临时暂停翻页)
  6651. getCSS('#Autopage_number').onclick = function () {
  6652. if (pausePage) {this.style = 'color: #FF5722 !important; font-style: italic !important;';} else {this.style = '';}
  6653. pausePage = !pausePage;
  6654. if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
  6655. };
  6656. status = getCSS('#Autopage_number');
  6657. set();
  6658. }
  6659. // 监听储存当前页码的对象值的变化
  6660. function set(){
  6661. Object.defineProperty(pageNum, 'now', {
  6662. set: function(value) {
  6663. this._now = value;
  6664. if (status) status.textContent = value;
  6665. }
  6666. });
  6667. }
  6668. function del(){
  6669. if (!status) return
  6670. status.style.display = 'none';
  6671. }
  6672. }
  6673. // 菜单开关
  6674. function menu_switch(menu_status, Name, Tips) {
  6675. if (menu_status === true){
  6676. GM_setValue(Name, false);
  6677. } else {
  6678. GM_setValue(Name, true);
  6679. }
  6680. if (Name === 'menu_page_number') {
  6681. if (menu_status === true){pageNumber('del');} else {pageNumber('add');}
  6682. registerMenuCommand(); // 重新注册(不可用)脚本菜单
  6683. } else {
  6684. location.reload();}
  6685. };
  6686. // 生成 SiteTypeID
  6687. function setSiteTypeID() {
  6688. let num = 0
  6689. for (let val in DBSite) {
  6690. DBSite[val].SiteTypeID = num = num + 1;
  6691. }
  6692. }
  6693. // 获取 Cookie
  6694. function getCookie(name) {
  6695. if (!name) return ''
  6696. let arr = document.cookie.split(';');
  6697. name += '='
  6698. for (let i=0; i<arr.length; i++) {
  6699. let now = arr[i].trim();
  6700. if (now.indexOf(name) == 0) return now.substring(name.length, now.length);
  6701. }
  6702. return '';
  6703. }
  6704. // 插入位置
  6705. function getAddTo(num) {
  6706. switch (num) {
  6707. case 1:
  6708. return 'beforebegin'; break;
  6709. case 2:
  6710. return 'afterbegin'; break;
  6711. case 3:
  6712. case 6:
  6713. return 'beforeend'; break;
  6714. case 4:
  6715. case 5:
  6716. return 'afterend'; break;
  6717. }
  6718. }
  6719. // 滚动条事件
  6720. function windowScroll(fn1) {
  6721. var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  6722. fn = fn1 || function () {};
  6723. setTimeout(function () { // 延时 1 秒执行,避免刚载入到页面就触发翻页事件
  6724. window.addEventListener('scroll', function (e) {
  6725. var afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  6726. delta = afterScrollTop - beforeScrollTop;
  6727. if (delta == 0) return false;
  6728. fn(delta > 0 ? 'down' : 'up', e);
  6729. beforeScrollTop = afterScrollTop;
  6730. }, false);
  6731. }, 1000)
  6732. }
  6733. // 自定义 urlchange 事件(用来监听 URL 变化)
  6734. function addUrlChangeEvent() {
  6735. history.pushState = ( f => function pushState(){
  6736. var ret = f.apply(this, arguments);
  6737. window.dispatchEvent(new Event('pushstate'));
  6738. window.dispatchEvent(new Event('urlchange'));
  6739. return ret;
  6740. })(history.pushState);
  6741.  
  6742. history.replaceState = ( f => function replaceState(){
  6743. var ret = f.apply(this, arguments);
  6744. window.dispatchEvent(new Event('replacestate'));
  6745. window.dispatchEvent(new Event('urlchange'));
  6746. return ret;
  6747. })(history.replaceState);
  6748.  
  6749. window.addEventListener('popstate',()=>{
  6750. window.dispatchEvent(new Event('urlchange'))
  6751. });
  6752. }
  6753. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址