自动无缝翻页

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

  1. // ==UserScript==
  2. // @name 自动无缝翻页
  3. // @name:zh-CN 自动无缝翻页
  4. // @name:zh-TW 自動無縫翻頁
  5. // @name:en AutoPager
  6. // @version 5.1.3
  7. // @author X.I.U
  8. // @description 无缝追加下一页内容(瀑布流),目前支持:【所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、NexusPHP」论坛】【百度、谷歌、必应、搜狗、微信、360、Yahoo、Yandex 等搜索引擎】、贴吧、豆瓣、知乎、微博、NGA、V2EX、B 站(Bilibili)、煎蛋网、糗事百科、龙的天空、起点中文、IT之家、千图网、Pixabay、Pixiv、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、小众软件、【动漫狂、漫画猫、漫画屋、漫画 DB、动漫之家、拷贝漫画、包子漫画、Mangabz、Xmanhua 等漫画网站】、PubMed、Z-Library、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了...
  9. // @description:zh-TW 無縫追加下一頁內容(瀑布流),支持各論壇、社交、遊戲、漫畫、小說、學術、搜索引擎等網站~
  10. // @description:en Append the next page content to the bottom seamlessly (like a 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.  
  50. getRulesUrl();
  51. registerMenuCommand();
  52. if (menuId.length < 4) {return}
  53. // 注册脚本菜单
  54. function registerMenuCommand() {
  55. if (menuId.length != []){
  56. for (let i=0;i<menuId.length;i++){
  57. GM_unregisterMenuCommand(menuId[i]);
  58. }
  59. }
  60. for (let i=0;i<menuAll.length;i++) { // 循环注册脚本菜单
  61. menuAll[i][3] = GM_getValue(menuAll[i][0]);
  62.  
  63. if (menuAll[i][0] === 'menu_disable') { // 启用/禁用
  64.  
  65. if (menu_disable('check')) { // 当前网站在禁用列表中
  66. menuId[i] = GM_registerMenuCommand(`${menuAll[i][2]}`, function(){menu_disable('del')});
  67. return
  68. } else { // 不在禁用列表中
  69. webType = doesItSupport(); // 判断网站类型(即是否支持),顺便直接赋值
  70. if (webType === 0) {
  71. menuId[0] = GM_registerMenuCommand('❌ 当前网页暂不支持 [欢迎点击申请]', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});});
  72. menuId[1] = GM_registerMenuCommand('🔄 更新外置翻页规则', function(){getRulesUrl(true)});
  73. menuId[2] = GM_registerMenuCommand('#️⃣ 自定义翻页规则 (beta)', function(){customRules()});
  74. console.info('[自动无缝翻页] - 暂不支持当前网页 [ ' + location.href + ' ],欢迎申请支持: https://github.com/XIU2/UserScript / https://greasyfork.org/zh-CN/scripts/96880/feedback');
  75. return
  76. } else if (webType === -1) {
  77. return
  78. }
  79. menuId[i] = GM_registerMenuCommand(`${menuAll[i][1]}`, function(){menu_disable('add')});
  80. }
  81.  
  82. } else if (menuAll[i][0] === 'menu_rules') {
  83. menuId[i] = GM_registerMenuCommand(`🔄 ${menuAll[i][1]}`, function(){getRulesUrl(true)});
  84.  
  85. } else if (menuAll[i][0] === 'menu_customRules') {
  86. menuId[i] = GM_registerMenuCommand(`#️⃣ ${menuAll[i][1]}`, function(){customRules()});
  87.  
  88. } else {
  89. menuId[i] = GM_registerMenuCommand(`${menuAll[i][3]?'✅':'❌'} ${menuAll[i][1]}`, function(){menu_switch(menuAll[i][3], menuAll[i][0], menuAll[i][2])});
  90. }
  91. }
  92. menuId[menuId.length] = GM_registerMenuCommand('💬 反馈失效 / 欢迎申请支持', function () {window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});});
  93. }
  94.  
  95.  
  96. // --------------------------------------------------------
  97.  
  98.  
  99. // 判断是支持
  100. function doesItSupport() {
  101. setDBSite(); // 配置 DBSite 变量对象
  102.  
  103. // 遍历判断是否是某个已支持的网站,顺便直接赋值
  104. let support = false;
  105. end:
  106. for (let now in DBSite) { // 遍历 对象
  107. if (!DBSite[now].host) continue; // 如果不存在则继续下一个循环
  108. //console.log(DBSite[now].host)
  109. // 如果是 数组
  110. if (Array.isArray(DBSite[now].host)) {
  111.  
  112. for (let i of DBSite[now].host) { // 遍历 数组
  113. // 针对自定义翻页规则中的正则
  114. if (typeof i === 'string' && i.slice(0,1) === '/') i = new RegExp(i.slice(1,i.length-1), 'i')
  115. if ((i instanceof RegExp && i.test(location.hostname)) || (typeof i === 'string' && i === location.hostname)) {
  116.  
  117. if (self != top) {if (!DBSite[now].iframe) break end;} // 如果当前位于 iframe 框架下,就需要判断是否需要继续执行
  118. if (DBSite[now].url) {
  119. if (typeof DBSite[now].url == 'function') {
  120. DBSite[now].url();
  121. } else { // 自定义翻页规则时,因为同域名不同页面 url 分开写,所以如果没找到就需要跳出当前数组循环,继续规则循环
  122. if (DBSite[now].url.slice(0,1) === '/') { // 如果是正则,则对 URL 路径进行匹配
  123. 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;}
  124. } else { // 如果是函数,那就执行代码
  125. try {
  126. if (new Function('fun', DBSite[now].url)(window.autoPage) === true) {curSite = DBSite[now];} else {break;}
  127. } catch (e) {
  128. console.error('[自动无缝翻页] - 当前网页规则 "url" 有误,请检查!', e);
  129. }
  130. }
  131. }
  132. } else {
  133. curSite = DBSite[now];
  134. }
  135. support = true; break end; // 如果找到了就退出所有循环
  136. }
  137. }
  138.  
  139. // 如果是 正则/字符串
  140. } else {
  141. // 针对自定义翻页规则中的正则
  142. 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')
  143. if ((DBSite[now].host instanceof RegExp && DBSite[now].host.test(location.hostname)) || (typeof DBSite[now].host === 'string' && DBSite[now].host === location.hostname)) {
  144.  
  145. if (self != top) {if (!DBSite[now].iframe) break;} // 如果当前位于 iframe 框架下,就需要判断是否需要继续执行
  146. if (DBSite[now].url) {
  147. if (typeof DBSite[now].url == 'function') {
  148. DBSite[now].url();
  149. } else { // 自定义翻页规则时,因为同域名不同页面 url 分开写,所以如果没找到就需要继续规则循环
  150. if (DBSite[now].url.slice(0,1) === '/') { // 如果是正则,则对 URL 路径进行匹配
  151. 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;}
  152. } else { // 如果是函数,那就执行代码
  153. try {
  154. if (new Function('fun', DBSite[now].url)(window.autoPage) === true) {curSite = DBSite[now];} else {continue;}
  155. } catch (e) {
  156. console.error('[自动无缝翻页] - 当前网页规则 "url" 有误,请检查!', e);
  157. }
  158. }
  159. }
  160. } else {
  161. curSite = DBSite[now];
  162. }
  163. support = true; break; // 如果找到了就退出循环
  164. }
  165. }
  166. }
  167.  
  168. if (support) {
  169. console.info('[自动无缝翻页] - 独立规则 网站'); return 1;
  170. } else if (self != top) {
  171. return -1;
  172. } 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)) {
  173. console.info('[自动无缝翻页] - <Discuz!> 论坛'); return 2;
  174. } else if (getCSS('#flarum-loading')) {
  175. console.info('[自动无缝翻页] - <Flarum> 论坛'); return 3;
  176. } else if (getCSS('body#phpbb')) {
  177. console.info('[自动无缝翻页] - <phpBB> 论坛'); return 4;
  178. } else if (getXpath('//footer//a[contains(string(), "Xiuno")] | //link[contains(@href, "xiuno")] | //script[contains(@src, "xiuno")]')) {
  179. console.info('[自动无缝翻页] - <Xiuno> 论坛'); return 5;
  180. } else if (typeof XF != 'undefined') {
  181. console.info('[自动无缝翻页] - <XenForo> 论坛'); return 6;
  182. } else if (getCSS('head meta[name="generator" i][content="nexusphp" i]') || getXpath('id("footer")[contains(string(), "NexusPHP")]')) {
  183. console.info('[自动无缝翻页] - <NexusPHP> 论坛'); return 7;
  184. } else if (getCSS('link[href*="themes/dux" i], script[src*="themes/dux" i]')) {
  185. console.info('[自动无缝翻页] - 使用 WordPress <DUX> 主题的网站'); return 100;
  186. } else if (getCSS('link[href*="themes/xiu" i], script[src*="themes/xiu" i]')) {
  187. console.info('[自动无缝翻页] - 使用 WordPress <XIU> 主题的网站'); return 101;
  188. } else if (getCSS('link[href*="themes/d8" i], script[src*="themes/d8" i]')) {
  189. console.info('[自动无缝翻页] - 使用 WordPress <D8> 主题的网站'); return 102;
  190. } else if (getCSS('link[href*="themes/begin" i], script[src*="themes/begin" i], img[src*="themes/begin" i]')) {
  191. console.info('[自动无缝翻页] - 使用 WordPress <Begin> 主题的网站'); return 103;
  192. } else if (getCSS('link[href*="/wp-content/" i], script[src*="/wp-content/" i]')) {
  193. if (getCSS('article.post') && getCSS('nav.navigation')) {
  194. if (getCSS('.nav-previous a')) {
  195. console.info('[自动无缝翻页] - 使用 WordPress <nav-previous 旧文章式> 主题的网站'); return 104;
  196. } else if (getXpath('//nav[contains(@class, "navigation")]//a[contains(text(), "下一页") or contains(text(), ">")]')) {
  197. console.info('[自动无缝翻页] - 使用 WordPress <nav-navigation> 下一页式> 主题的网站'); return 105;
  198. }
  199. }
  200. } 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(), "下一页")]')) {
  201. console.info('[自动无缝翻页] - <笔趣阁> 模板的小说网站'); return 200;
  202. }
  203. return 0;
  204. }
  205. // 判断网站类型
  206. function webTypeIf() {
  207. if (webType != 1) {
  208. switch (webType) {
  209. case 2: // < 所有 Discuz!论坛 >
  210. discuz_(); break;
  211. case 3: // < 所有 Flarum 论坛 >
  212. DBSite.flarum.url(); break;
  213. case 4: // < 所有 phpBB 论坛 >
  214. DBSite.phpbb.url(); break;
  215. case 5: // < 所有 Xiuno 论坛 >
  216. DBSite.xiuno.url(); break;
  217. case 6: // < 所有 XenForo 论坛 >
  218. DBSite.xenforo.url(); break;
  219. case 7: // < 所有 NexusPHP 论坛 >
  220. DBSite.nexusphp.url(); break;
  221. case 100: // < 所有使用 WordPress DUX 主题的网站 >
  222. DBSite.dux.url(); if (location.hostname === 'apphot.cc') {curSite.pager.scrollD = 2500;}; break;
  223. case 101: // < 所有使用 WordPress XIU 主题的网站 >
  224. DBSite.dux.url(); curSite.function = {bF: src_bF, bFp: [0, 'img.thumb[data-original]', 'data-original']}; break;
  225. case 102: // < 所有使用 WordPress D8 主题的网站 >
  226. DBSite.dux.url(); delete curSite.function; break;
  227. case 103: // < 所有使用 WordPress Begin 主题的网站 >
  228. DBSite.begin.url(); break;
  229. case 104: // < 所有使用 WordPress nav-previous 旧文章式 主题的网站 >
  230. DBSite.wp_nav_navigation.url(); break;
  231. case 105: // < 所有使用 WordPress nav-navigation 下一页式 主题的网站 >
  232. DBSite.wp_nav_navigation.url('//nav[contains(@class, "navigation")]//a[contains(text(), "下一页") or contains(text(), ">")]'); break;
  233. case 200: // < 所有使用 笔趣阁 模板的小说网站 >
  234. DBSite.biquge.url(); break;
  235. }
  236. }
  237. }
  238. // 网站规则
  239. function setDBSite() {
  240. /*
  241. url: 匹配到该域名后要执行的函数/正则(一般用于根据 URL 分配相应翻页规则)
  242. locationC: 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则(需要放在 url: 中)
  243.  
  244. hiddenPN: 不显示脚本左下角的页码
  245. history: 添加历史记录 并 修改当前 URL(默认开启,对于不支持的网站要设置为 false)
  246. thread: 对于社区类网站,要在 帖子内 的规则中加入这个,用于脚本的 [帖子内自动翻页] 功能(即用户可以选择开启/关闭所有社区类网站帖子内的自动翻页)
  247. style: 要插入网页的 CSS Style 样式
  248. retry: 允许获取失败后重试
  249.  
  250. pager: {
  251. type: 翻页模式
  252. 1 = 由脚本实现自动无缝翻页,可省略(适用于:静态加载内容网站,常规模式)
  253.  
  254. 2 = 只需要点击下一页按钮(适用于:网站自带了 自动无缝翻页 功能)
  255. nextText: 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页,下同)
  256. nextTextOf: 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页
  257. nextHTML: 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页
  258. interval: 点击间隔时间,对于没有按钮文字变化的按钮,可以手动指定间隔时间(单位 ms,默认 300,当指定上面三个时,会忽略 interval)
  259. isHidden: 只有下一页按钮可见时(没有被隐藏),才会点击
  260.  
  261. 3 = 依靠 [基准元素] 与 [浏览器可视区域底部] 之间的距离缩小来触发翻页(适用于:主体元素下方内容太多 且 高度不固定时)
  262. scrollE: 作为基准线的元素(一般为底部页码元素),和 replaceE 一样的话可以省略
  263. scrollD: 基准元素 - 可视区域底部
  264.  
  265. 4 = 动态加载类网站(适用于:简单的动态加载内容网站)
  266. insertE: 用来插入元素的函数
  267.  
  268. 5 = 插入 iframe 方式来加载下一页,无限套娃(适用于:部分动态加载内容的网站,需要允许 iframe 且支持通过 GET/POST 直接打开下一页)
  269. style: 加载 iframe 前要插入的 CSS Style 样式(比如为了悬浮的样式与下一页的重叠,隐藏网页底部间距提高阅读连续性)
  270. iframe: 这个必须加到 pager{} 外面(这样才会在该域名的 iframe 框架下运行脚本)
  271. forceTarget: 强制新标签页打开链接(适用于一些使用 pjax 技术的链接)
  272.  
  273. 6 = 通过 iframe 获取下一页动态加载内容插入本页,只有一个娃(适用于:部分动态加载内容的网站,与上面不同的是,该模式适合简单的网页,没有复杂事件什么的)
  274. loadTime: 预留的网页加载时间,确保网页内容加载完成
  275. forceTarget: 强制新标签页打开链接
  276.  
  277. nextL: 下一页链接所在元素
  278. pageE: 要从下一页获取的元素
  279. insertP: 下一页元素插入本页的位置(数组第一个是基准元素,第二个是基准元素的前后具体位置)
  280. 1 = 插入基准元素自身的前面
  281. 2 = 插入基准元素内,第一个子元素前面
  282. 3 = 插入基准元素内,最后一个子元素后面
  283. 4 = 插入基准元素自身的后面
  284. 5 = 插入 pageE 列表最后一个元素的后面(该 insertP 可以直接省略不写,等同于 ['pageE', 5] )
  285. 6 = 插入该元素自身内部末尾(针对小说网站等文本类的),附带参数 insertP6Br: true, 用来中间插入换行
  286. // 小技巧:当基准元素是下一页主体元素的父元素时(或者说要将下一页元素插入到本页同元素最后一个后面时)是可以省略不写 insertP
  287. 例如:当 pageE: 'ul>li' 且 insertP: ['ul', 3] 时,实际等同于 ['ul>li', 5]
  288. 当 pageE: '.item' 且 insertP: ['.item', 4] 时,实际等同于 ['.item', 5]
  289. 当 pageE: '.item' 且 insertP: ['.page', 1] 时,实际等同于 ['.item', 5]
  290. 注意:如 pageE 中选择了多类元素,则不能省略 insertP(比如包含 `,` 与 `|` 符号)
  291.  
  292. replaceE: 要替换为下一页内容的元素(比如页码)
  293. scrollD: 翻页动作触发点([滚动条] 与 [网页底部] 之间的距离),数值越大,越早开始翻页,一般是访问网页速度越慢,该值就需要越大,省略后默认 1500
  294.  
  295. scriptT: 单独插入 <script> 标签
  296. 0 = 下一页的所有 <script> 标签
  297. 1 = 下一页的所有 <script> 标签(不包括 src 链接)
  298. 2 = 下一页主体元素 (pageE) 的同级 <script> 标签
  299. 3 = 下一页主体元素 (pageE) 的子元素 <script> 标签
  300.  
  301. interval: 翻页后间隔时间(单位 ms)
  302. forceHTTPS: 下一页链接强制 HTTPS
  303. },
  304. function: {
  305. bF = 插入前执行函数
  306. bFp = 参数
  307. aF = 插入后执行函数
  308. aFp = 参数
  309. }
  310. */ //<<< 规则简单说明 >>>
  311. DBSite = {
  312. discuz_forum: {
  313. pager: {
  314. type: 2,
  315. nextL: '#autopbn',
  316. nextTextOf: '下一',
  317. scrollD: 1500
  318. }
  319. }, // Discuz! 论坛 - 帖子列表(自带无缝加载下一页按钮的)
  320. discuz_guide: {
  321. pager: {
  322. nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
  323. pageE: 'id("threadlist")//table[./tbody[contains(@id, "normalthread_")]]/tbody[not(@id="separatorline")]',
  324. replaceE: '.pg, .pages',
  325. scrollD: 1500
  326. }
  327. }, // Discuz! 论坛 - 导读页 及 帖子列表(不带无缝加载下一页按钮的)
  328. discuz_waterfall: {
  329. pager: {
  330. nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
  331. pageE: '#waterfall > li',
  332. replaceE: '.pg, .pages',
  333. scrollD: 1500
  334. }
  335. }, // Discuz! 论坛 - 图片模式的帖子列表(不带无缝加载下一页按钮的)
  336. discuz_thread: {
  337. thread: true,
  338. style: '.pgbtn {display: none;}',
  339. pager: {
  340. nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
  341. pageE: '#postlist > div[id^="post_"]',
  342. 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"))]]',
  343. scrollD: 1500
  344. },
  345. function: {
  346. bF: src_bF,
  347. bFp: [0, 'img[file]', 'file']
  348. }
  349. }, // Discuz! 论坛 - 帖子内
  350. discuz_search: {
  351. pager: {
  352. nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
  353. pageE: '#threadlist > ul',
  354. replaceE: '.pg, .pages',
  355. scrollD: 1500
  356. }
  357. }, // Discuz! 论坛 - 搜索页
  358. discuz_youspace: {
  359. pager: {
  360. nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
  361. pageE: 'form:not([action^="search.php?"]) tbody > tr:not(.th)',
  362. replaceE: '.pg, .pages',
  363. scrollD: 1500
  364. }
  365. }, // Discuz! 论坛 - 回复页、主题页(别人的)
  366. discuz_collection: {
  367. pager: {
  368. nextL: 'a.nxt:not([href^="javascript"]) ,a.next:not([href^="javascript"])',
  369. pageE: '#ct .bm_c table > tbody',
  370. replaceE: '.pg, .pages',
  371. scrollD: 1500
  372. }
  373. }, // Discuz! 论坛 - 淘帖页
  374. discuz_m: {
  375. thread: true,
  376. pager: {
  377. nextL: '//a[@class="nxt" or @class="next"] | //div[@class="page"]/a[text()="下一页" or contains(text(), ">")]',
  378. replaceE: '.pg, .page',
  379. scrollD: 1000
  380. }
  381. }, // Discuz! 论坛 - 触屏手机版 - 帖子内
  382. discuz_m_forum: {
  383. pager: {
  384. type: 2,
  385. nextL: 'a.loadmore',
  386. interval: 500,
  387. scrollD: 1000
  388. }
  389. }, // Discuz! 论坛 - 触屏手机版 - 帖子列表(自带无缝加载下一页按钮的)
  390. flarum: {
  391. url: ()=> {locationC = true;if (!indexOF('/d/')) {curSite = DBSite.flarum;}},
  392. pager: {
  393. type: 2,
  394. nextL: '.DiscussionList-loadMore > button',
  395. isHidden: true,
  396. scrollD: 1500
  397. }
  398. }, // Flarum 论坛
  399. phpbb: {
  400. url: ()=> {if (indexOF('/viewforum.php')) {
  401. curSite = DBSite.phpbb;
  402. } else if (indexOF('/viewtopic.php')) {
  403. curSite = DBSite.phpbb_post;
  404. } else if (indexOF('/search.php')) {
  405. curSite = DBSite.phpbb_search;
  406. }},
  407. pager: {
  408. nextL: '.pagination li.next a[rel="next"], .topic-actions .pagination strong~a',
  409. pageE: '.forumbg:not(.announcement) ul.topiclist.topics > li',
  410. replaceE: '.action-bar .pagination, .topic-actions .pagination',
  411. scrollD: 2000
  412. }
  413. }, // phpBB 论坛 - 帖子列表
  414. phpbb_post: {
  415. thread: true,
  416. pager: {
  417. nextL: '.pagination li.next a[rel="next"], .topic-actions .pagination strong~a',
  418. pageE: 'div.post[id], div.post[id]+hr',
  419. replaceE: '.action-bar .pagination, .topic-actions .pagination',
  420. scrollD: 2000
  421. }
  422. }, // phpBB 论坛 - 帖子内
  423. phpbb_search: {
  424. pager: {
  425. nextL: '.pagination li.next a[rel="next"], .topic-actions .pagination strong~a',
  426. pageE: 'div.search.post',
  427. replaceE: '.action-bar .pagination, .pagination',
  428. scrollD: 2000
  429. }
  430. }, // phpBB 论坛 - 搜索页
  431. xenforo: {
  432. url: ()=> {if (indexOF(/\/(forums|f)\//)) {
  433. curSite = DBSite.xenforo;
  434. } else if (indexOF(/\/(threads|t)\//)) {
  435. curSite = DBSite.xenforo_post;
  436. } else if (indexOF('/search/')) {
  437. curSite = DBSite.xenforo_search;
  438. }},
  439. pager: {
  440. nextL: 'a.pageNav-jump--next',
  441. pageE: '.structItemContainer-group.js-threadList > div',
  442. replaceE: 'nav.pageNavWrapper',
  443. scrollD: 2500
  444. }
  445. }, // XenForo 论坛 - 帖子列表
  446. xenforo_post: {
  447. thread: true,
  448. pager: {
  449. nextL: 'a.pageNav-jump--next',
  450. pageE: '.block-body.js-replyNewMessageContainer > article',
  451. replaceE: 'nav.pageNavWrapper',
  452. scrollD: 2500
  453. }
  454. }, // XenForo 论坛 - 帖子内
  455. xenforo_search: {
  456. pager: {
  457. nextL: 'a.pageNav-jump--next',
  458. pageE: 'ol.block-body > li',
  459. replaceE: 'nav.pageNavWrapper',
  460. scrollD: 2500
  461. }
  462. }, // XenForo 论坛 - 搜索页
  463. xiuno: {
  464. url: ()=> {if (lp == '/' || indexOF(/\/(index|forum)/)) {curSite = DBSite.xiuno;} else if (indexOF('/thread')) {curSite = DBSite.xiuno_post;}},
  465. pager: {
  466. nextL: '//li[@class="page-item"]/a[text()="▶"]',
  467. pageE: 'ul.threadlist > li',
  468. replaceE: 'ul.pagination',
  469. scrollD: 1500
  470. }
  471. }, // Xiuno 论坛 - 帖子列表
  472. xiuno_post: {
  473. thread: true,
  474. pager: {
  475. nextL: '//li[@class="page-item"]/a[text()="▶"]',
  476. pageE: 'li.post[data-pid]:not(.newpost)',
  477. replaceE: 'ul.pagination',
  478. scrollD: 1500
  479. }
  480. }, // Xiuno 论坛 - 帖子内
  481. nexusphp: {
  482. url: ()=> {
  483. if (lp == '/torrents.php' || getCSS('table.torrents')) {
  484. curSite = DBSite.nexusphp;
  485. } else if (lp == '/subtitles.php') {
  486. curSite = DBSite.nexusphp;
  487. curSite.pager.pageE = '#outer > table.main~table > tbody > tr:not(:first-of-type)'
  488. } else if (lp == '/forums.php' && indexOF('action=viewforum', 's')) {
  489. curSite = DBSite.nexusphp;
  490. curSite.pager.pageE = '#outer > table.main+table > tbody > tr:not(:first-of-type):not(:last-of-type)'
  491. } else if (lp == '/forums.php' && indexOF('action=viewtopic', 's')) {
  492. curSite = DBSite.nexusphp;
  493. curSite.thread = true;
  494. curSite.pager.pageE = 'td.text > div, td.text > div+table.main';
  495. }},
  496. pager: {
  497. nextL: '//a[./b[contains(text(), "下一页") or contains(text(), ">>")]]',
  498. pageE: 'table.torrents > tbody > tr:not(:first-of-type)',
  499. replaceE: '//p[@align][./font[@class="gray"]]',
  500. scrollD: 1500
  501. }
  502. }, // NexusPHP 论坛
  503. dux: {
  504. host: 'www.puresys.net',
  505. url: ()=> {if (!indexOF('.html')) curSite = DBSite.dux;},
  506. pager: {
  507. nextL: 'li.next-page > a',
  508. pageE: '.content > article',
  509. replaceE: '.content > .pagination',
  510. scrollD: 1500
  511. },
  512. function: {
  513. bF: src_bF,
  514. bFp: [0, 'img.thumb[data-src]', 'data-src']
  515. }
  516. }, // WordPress 的 DUX、XIU、D8 主题
  517. begin: {
  518. url: ()=> {if (location.search.slice(0,3) === '?s=') {curSite = DBSite.begin_search;} else if (!indexOF('.html')) {curSite = DBSite.begin;}},
  519. pager: {
  520. type: 2,
  521. nextL: 'div[id^="ias_trigger_"]',
  522. interval: 500,
  523. scrollD: 1500
  524. }
  525. }, // WordPress 的 Begin 主题
  526. begin_search: {
  527. pager: {
  528. nextL: 'a.next',
  529. pageE: '#main > ul > li',
  530. replaceE: 'nav.pagination',
  531. scrollD: 1500
  532. }
  533. }, // WordPress 的 Begin 主题 - 搜索页
  534. wp_nav_navigation: {
  535. url: function(nextL = '.nav-previous a') {if (!indexOF('/post/') && !getCSS('#comments, .comments-area, #disqus_thread')) {curSite = DBSite.wp_nav_navigation; curSite.pager.nextL = nextL;}},
  536. pager: {
  537. nextL: '.nav-previous a',
  538. pageE: 'article.post',
  539. replaceE: 'nav.navigation',
  540. scrollD: 1500
  541. }
  542. }, // Wordpress 的 nav.navigation 规则
  543. biquge: {
  544. url: ()=> {if (indexOF(/\d+\/\d+\.html/)) {curSite = DBSite.biquge;}},
  545. style: 'img, .posterror {display: none !important;}',
  546. pager: {
  547. nextL: '//a[contains(text(), "下一章") or contains(text(), "下一页")]',
  548. pageE: '#content, .content, #chaptercontent, .chaptercontent, #BookText',
  549. insertP: ['#content, .content, #chaptercontent, .chaptercontent, #BookText', 6],
  550. insertP6Br: true,
  551. replaceE: '//*[./a[contains(text(), "下一章") or contains(text(), "下一页")]]',
  552. scrollD: 1500
  553. }
  554. }, // 笔趣阁 模板的小说网站
  555. baidu: {
  556. host: 'www.baidu.com',
  557. 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';}},
  558. style: '.new-pmd .c-img-border {position: initial !important;} .op-bk-polysemy-video__wrap.c-gap-bottom {display: none !important;}',
  559. pager: {
  560. nextL: 'id("page")//a[contains(text(),"下一页")]',
  561. pageE: '#content_left > *',
  562. replaceE: '#page',
  563. scrollD: 2000
  564. }
  565. }, // 百度 搜索
  566. baidu_m: {
  567. host: 'm.baidu.com',
  568. url: ()=> {if (location.pathname.slice(location.pathname.length - 2,location.pathname.length) == '/s') curSite = DBSite.baidu_m;},
  569. style: 'div.result[tpl="recommend_list"], #page-copyright {display: none !important;}',
  570. pager: {
  571. nextL: 'a[class^="new-nextpage"]',
  572. pageE: '#results > *',
  573. replaceE: '#page-controller',
  574. scrollD: 2000
  575. }
  576. }, // 百度 搜索 - 手机版
  577. google: {
  578. host: /^www\.google\./,
  579. url: ()=> {if (lp == '/search' && !indexOF('tbm=isch', 's')) {
  580. if (indexOF('sclient=mobile', 's') || isMobile()) {
  581. curSite = DBSite.google_m;
  582. } else {
  583. curSite = DBSite.google;
  584. }
  585. } else if (lp == '/scholar') {
  586. curSite = DBSite.google_scholar;
  587. }},
  588. pager: {
  589. nextL: '#pnnext',
  590. pageE: 'id("search")/* | //style[not(contains(text(), "table,div,span,p{display:none}"))]',
  591. insertP: ['#search', 3],
  592. replaceE: 'id("navcnt") | id("rcnt")//div[@role="navigation"]',
  593. scriptT: 0,
  594. scrollD: 3000
  595. },
  596. function: {
  597. bF: google_bF
  598. }
  599. }, // 谷歌 搜索
  600. google_m: {
  601. pager: {
  602. type: 2,
  603. nextL: 'a[aria-label="查看更多"], a[aria-label="See more" i]',
  604. isHidden: true,
  605. scrollD: 1000
  606. }
  607. }, // 谷歌 搜索 - 手机版
  608. bing: {
  609. host: ['www.bing.com','cn.bing.com'],
  610. url: ()=> {if (lp == '/search') {
  611. curSite = DBSite.bing;
  612. curSite.function = {bF: bing_bF}
  613. } else if (lp == '/academic/search') {
  614. curSite = DBSite.bing_academic;
  615. }},
  616. style: '.b_imagePair.square_mp > .inner {display: none !important;}',
  617. pager: {
  618. nextL: 'a.sb_pagN, a.sb_halfnext, a.sb_fullnpl',
  619. pageE: '#b_results > li:not(.b_msg):not([class="b_ans"]):not(.b_pag):not(#mfa_root)',
  620. replaceE: '#b_results > .b_pag',
  621. scrollD: 2000
  622. }
  623. }, // 必应 搜索 + 手机版
  624. sogou: {
  625. host: 'www.sogou.com',
  626. url: '/^\\/.+/',
  627. pager: {
  628. nextL: '#sogou_next',
  629. pageE: '.results > *',
  630. replaceE: '#pagebar_container',
  631. scriptT: 3,
  632. scrollD: 2000
  633. }
  634. }, // 搜狗 搜索
  635. sogou_m: {
  636. host: ['m.sogou.com', 'wap.sogou.com'],
  637. url: '/^\\/.+/',
  638. pager: {
  639. type: 2,
  640. nextL: '#ajax_next_page',
  641. isHidden: true,
  642. scrollD: 1000
  643. }
  644. }, // 搜狗 搜索 - 手机版
  645. sogou_weixin: {
  646. host: 'weixin.sogou.com',
  647. url: ()=> {if (lp == '/') {
  648. curSite = DBSite.sogou_weixin;
  649. } else if (lp == '/weixin') {
  650. curSite = DBSite.sogou_weixin_search;
  651. }},
  652. pager: {
  653. type: 2,
  654. nextL: '#look-more',
  655. interval: 1000,
  656. scrollD: 1000
  657. }
  658. }, // 搜狗微信 - 首页
  659. sogou_weixin_search: {
  660. pager: {
  661. nextL: '#sogou_next',
  662. pageE: 'ul[class*="news-list"] > li',
  663. replaceE: '#pagebar_container',
  664. scrollD: 1200
  665. }
  666. }, // 搜狗微信 - 搜索
  667. toutiao: {
  668. host: ['www.toutiao.com', 'so.toutiao.com'],
  669. url: ()=> {if (location.hostname != 'www.toutiao.com') {
  670. if (lp == '/search/' || isMobile()) {
  671. curSite = DBSite.toutiao_m;
  672. } else if (lp == '/search') {
  673. curSite = DBSite.toutiao;
  674. }
  675. }},
  676. pager: {
  677. nextL: '//div[contains(@class, "-pagination")]/a[string()="下一页"]',
  678. pageE: 'div[class*="-result-list"] > .result-content[data-i]',
  679. replaceE: 'div[class*="-pagination"]',
  680. scrollD: 2000
  681. },
  682. function: {
  683. bF: pageE => { // 插入前函数(过滤相关搜索)
  684. if (getXpath('//div[contains(@class,"-header") and string()="相关搜索"]', pageE[pageE.length - 1])) pageE[pageE.length - 1].style.display = 'none';
  685. return pageE
  686. }
  687. }
  688. }, // 头条 搜索
  689. toutiao_m: {
  690. pager: {
  691. nextL: '#page-bottom a[class*="containerRight_"], #page-bottom a[class*="container_"]',
  692. pageE: '#results > div',
  693. replaceE: '#page-bottom',
  694. scrollD: 2000
  695. }
  696. }, // 头条 搜索 - 手机版
  697. so: {
  698. host: 'www.so.com',
  699. url: '/^\\/.+/',
  700. style: 'img {opacity: 1 !important;}',
  701. pager: {
  702. nextL: 'a#snext',
  703. pageE: 'ul.result > li, style:not(src)',
  704. insertP: ['ul.result', 3],
  705. replaceE: '#page',
  706. scrollD: 2000
  707. },
  708. function: {
  709. bF: src_bF,
  710. bFp: [0, 'img[data-isrc]', 'data-isrc']
  711. }
  712. }, // 360 搜索
  713. so_m: {
  714. host: 'm.so.com',
  715. url: '/^\\/.+/',
  716. pager: {
  717. type: 2,
  718. nextL: '#load-more',
  719. isHidden: true,
  720. scrollD: 1000
  721. }
  722. }, // 360 搜索 - 手机版
  723. duckduckgo: {
  724. host: 'duckduckgo.com',
  725. url: ()=> {
  726. if (getCookie('av') != '1') {
  727. document.cookie='av=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 强制开启自带的无缝翻页功能
  728. location.reload(); // 刷新网页
  729. }
  730. },
  731. history: false
  732. }, // DuckDuckGo 搜索
  733. startpage: {
  734. host: ['startpage.com', 'www.startpage.com'],
  735. url: ()=> {if (indexOF('/search')) {curSite = DBSite.startpage;}},
  736. pager: {
  737. nextL: ()=> getNextF('//div[contains(@class, "pagination ")]/form[./button[@class="pagination__next-prev-button next"]]'),
  738. pageE: 'section.w-gl--desktop > div',
  739. replaceE: '.pagination',
  740. scrollD: 2000
  741. }
  742. }, // Startpage 搜索
  743. yandex: {
  744. host: ['yandex.com', 'yandex.ru', 'yandex.ua', 'yandex.by', 'yandex.kz', 'yandex.uz', 'yandex.com.tr'],
  745. url: ()=> {if (lp == '/search/') {curSite = DBSite.yandex;} else if (lp == '/video/search') {curSite = DBSite.yandex_video;}},
  746. pager: {
  747. nextL: 'a.pager__item_kind_next',
  748. pageE: '#search-result > *, style',
  749. insertP: ['#search-result', 3],
  750. replaceE: '.pager',
  751. scrollD: 1500
  752. }
  753. }, // Yandex 搜索
  754. yandex_video: {
  755. hiddenPN: true,
  756. pager: {
  757. type: 2,
  758. nextL: 'button.more__button',
  759. interval: 1000,
  760. scrollD: 1000
  761. }
  762. }, // Yandex 搜索 - 视频
  763. yahoo: {
  764. host: 'search.yahoo.com',
  765. url: ()=> {if (indexOF('/search')) {curSite = DBSite.yahoo;}},
  766. pager: {
  767. nextL: '.pagination a.next',
  768. pageE: '#web ol > li',
  769. replaceE: '.pagination',
  770. scrollD: 2000
  771. }
  772. }, // Yahoo 搜索
  773. yahoo_jp: {
  774. host: 'search.yahoo.co.jp',
  775. url: ()=> {if (indexOF('/search')) {curSite = DBSite.yahoo_jp;}},
  776. pager: {
  777. nextL: '.Pagenation__next > a',
  778. pageE: '.Contents__innerGroupBody > div',
  779. replaceE: '.Pagenation',
  780. scrollD: 2000
  781. }
  782. }, // Yahoo 搜索 (JP)
  783. qwant: {
  784. host: 'www.qwant.com',
  785. url: ()=> {locationC = true; if (indexOF('q=', 's') && indexOF('t=web', 's')) {curSite = DBSite.qwant;}},
  786. pager: {
  787. type: 2,
  788. nextL: 'button[data-testid="buttonShowMore"]',
  789. interval: 500,
  790. scrollD: 2000
  791. }
  792. }, // Qwant 搜索
  793. ecosia: {
  794. host: 'www.ecosia.org',
  795. url: ()=> {if (lp == '/search') {curSite = DBSite.ecosia;}},
  796. pager: {
  797. nextL: 'nav.pagination a[aria-label="Next page"]',
  798. pageE: 'section.mainline > div:not(.related-queries)',
  799. replaceE: 'nav.pagination',
  800. scrollD: 1500
  801. }
  802. }, // Ecosia 搜索
  803. magi: {
  804. host: 'magi.com',
  805. url: ()=> {if (lp == '/search') {curSite = DBSite.magi;}},
  806. pager: {
  807. type: 2,
  808. nextL: '.card[data-type="next"]',
  809. nextText: '加载更多',
  810. scrollD: 1500
  811. }
  812. }, // Magi 搜索
  813. ask: {
  814. host: ['ask.com', 'www.ask.com'],
  815. url: ()=> {if (lp == '/web') {curSite = DBSite.ask;}},
  816. style: '.PartialSearchResults-heading {display: none !important;}',
  817. pager: {
  818. nextL: 'li.PartialWebPagination-next > a',
  819. pageE: '.PartialSearchResults.mid',
  820. replaceE: '.PartialWebPagination',
  821. scrollD: 2000
  822. }
  823. }, // ASK 搜索
  824. fsou: {
  825. host: 'fsou.cc',
  826. url: ()=> {
  827. if (lp == '/search') {
  828. if (window.screen.width < 780) {
  829. curSite = DBSite.fsou_m;
  830. } else {
  831. curSite = DBSite.fsou;
  832. }
  833. }
  834. },
  835. retry: 1000,
  836. pager: {
  837. type: 6,
  838. nextL: ()=> getNextEP('.turn-page-num-wrap.selected', 'pageIndex=', /pageIndex=\d+/),
  839. pageE: '.organic-results > div',
  840. replaceE: '.bottom-pagination',
  841. loadTime: 1000,
  842. scrollD: 3000
  843. }
  844. }, // F 搜
  845. fsou_m: {
  846. pager: {
  847. type: 2,
  848. nextL: '.next-page-container',
  849. scrollD: 1500
  850. }
  851. }, // F 搜 - 手机版
  852. baidu_tieba: {
  853. host: ['tieba.baidu.com', 'jump2.bdimg.com'],
  854. url: ()=> {if (location.hostname == 'jump2.bdimg.com') location.hostname = 'tieba.baidu.com';
  855. if (lp == '/f') {
  856. baidu_tieba_1(); // 右侧悬浮发帖按钮点击事件(解决自动翻页导致无法发帖的问题)
  857. curSite = DBSite.baidu_tieba;
  858. } else if (indexOF('/p/')) {
  859. curSite = DBSite.baidu_tieba_post;
  860. } else if (lp == '/f/search/res') {
  861. curSite = DBSite.baidu_tieba_search;
  862. }},
  863. style: 'img.j_retract {margin-top: 0 !important;margin-bottom: 0 !important;}', // 修复帖子列表中预览图片,在切换下一个/上一个图片时,多出来的图片上下边距
  864. history: false,
  865. iframe: true,
  866. pager: {
  867. type: 4,
  868. nextL: ()=> {if (getNextE('a.next.pagination-item')) getPageE_(curSite.pageUrl + '&pagelets=frs-list%2Fpagelet%2Fthread&pagelets_stamp=' + new Date().getTime());},
  869. pageE: '#thread_list > li',
  870. insertP: ['#thread_list', 3],
  871. insertE: baidu_tieba_insertE,
  872. replaceE: '#frs_list_pager',
  873. interval: 2000,
  874. scrollD: 2500
  875. },
  876. function: {
  877. bF: src_bF,
  878. bFp: [0, 'img[data-original]', 'data-original']
  879. }
  880. }, // 百度贴吧 - 帖子列表
  881. baidu_tieba_post: {
  882. forceTarget: true,
  883. thread: true,
  884. 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 元素
  885. pager: {
  886. type: 5,
  887. nextL: '//li[contains(@class,"pb_list_pager")]/a[text()="下一页"]',
  888. style: 'ul.tbui_aside_float_bar, .core_title_wrap_bright.tbui_follow_fixed.core_title_absolute_bright {display: none !important;}',
  889. scrollD: 1500
  890. }
  891. }, // 百度贴吧 - 帖子内
  892. baidu_tieba_search: {
  893. pager: {
  894. nextL: 'a.next',
  895. pageE: '.s_post_list > div',
  896. replaceE: '.pager',
  897. scrollD: 1000
  898. }
  899. }, // 百度贴吧 - 搜索页
  900. douban_subject_comments: {
  901. host: 'movie.douban.com',
  902. url: ()=> {if (indexOF('/subject/') && indexOF('/comments')) {
  903. curSite = DBSite.douban_subject_comments;
  904. } else if (indexOF('/subject/') && indexOF('/reviews')) {
  905. curSite = DBSite.douban_subject_reviews;
  906. } else if(indexOF('/subject/') && indexOF('/episode') || indexOF('/subject/') && indexOF('/tv_discuss')) {
  907. curSite = DBSite.douban_subject_episode;
  908. } else if(indexOF('/people/') && indexOF('/collect')) {
  909. curSite = DBSite.douban_people_collect;
  910. } else if(indexOF('/celebrity/') && indexOF('/movies')) {
  911. curSite = DBSite.douban_celebrity_movies;
  912. }},
  913. pager: {
  914. nextL: 'a.next',
  915. pageE: '#comments > .comment-item',
  916. replaceE: '#paginator',
  917. scrollD: 1500
  918. }
  919. }, // 豆瓣 - 短评
  920. douban_subject_reviews: {
  921. pager: {
  922. nextL: 'link[rel="next"]',
  923. pageE: '.review-list > div',
  924. replaceE: '.paginator',
  925. scrollD: 1500
  926. }
  927. }, // 豆瓣 - 影评
  928. douban_subject_episode: {
  929. pager: {
  930. nextL: 'link[rel="next"]',
  931. pageE: '#comments > div',
  932. replaceE: '.paginator',
  933. scrollD: 1500
  934. }
  935. }, // 豆瓣 - 剧评
  936. douban_people_collect: {
  937. pager: {
  938. nextL: 'link[rel="next"]',
  939. pageE: '.grid-view > div',
  940. replaceE: '.paginator',
  941. scrollD: 1500
  942. }
  943. }, // 豆瓣 - 看过的电影
  944. douban_celebrity_movies: {
  945. pager: {
  946. nextL: 'link[rel="next"]',
  947. pageE: '.grid_view > ul > li',
  948. replaceE: '.paginator',
  949. scrollD: 1500
  950. }
  951. }, // 豆瓣 - 作品
  952. douban_group: {
  953. host: 'www.douban.com',
  954. url: ()=> {if (indexOF('/group/topic/')) {
  955. curSite = DBSite.douban_group_topic;
  956. } else if (indexOF('/group/explore')) {
  957. curSite = DBSite.douban_group_explore;
  958. } else if (indexOF('/group/') && indexOF('/discussion')) {
  959. curSite = DBSite.douban_group;
  960. }},
  961. pager: {
  962. nextL: 'span.next > a',
  963. pageE: 'table.olt > tbody > tr:not(.th)',
  964. replaceE: '.paginator',
  965. scrollD: 1500
  966. }
  967. }, // 豆瓣 - 小组
  968. douban_group_explore: {
  969. pager: {
  970. nextL: 'span.next > a',
  971. pageE: '#content .article > div > .channel-item',
  972. replaceE: '.paginator',
  973. scrollD: 1500
  974. }
  975. }, // 豆瓣 - 小组讨论精选
  976. douban_group_topic: {
  977. thread: true,
  978. pager: {
  979. nextL: 'span.next > a',
  980. pageE: '#comments > li',
  981. replaceE: '.paginator',
  982. scrollD: 1500
  983. }
  984. }, // 豆瓣 - 小组帖子内
  985. zhihu: {
  986. host: 'www.zhihu.com',
  987. url: ()=> {locationC = true; if (indexOF(/\/people\/.+\/.+/) || indexOF('/collection/')) {curSite = DBSite.zhihu; if (self != top) insStyle('#ProfileHeader {display: none !important;}')}},
  988. forceTarget: true,
  989. iframe: true,
  990. pager: {
  991. type: 5,
  992. nextL: ()=> {
  993. let next = getCSS('.Pagination .PaginationButton--current+button:not(.PaginationButton-next)');
  994. if (next) return (location.origin + location.pathname + '?page=' + next.textContent)
  995. },
  996. scrollD: 2000
  997. }
  998. }, // 知乎 - 用户主页、收藏夹
  999. weibo_comment: {
  1000. host: 'weibo.com',
  1001. pager: {
  1002. type: 2,
  1003. nextL: 'a[action-type="click_more_comment"]',
  1004. nextText: '查看更多c',
  1005. scrollD: 1000
  1006. }
  1007. }, // 微博评论
  1008. tianya: {
  1009. host: 'bbs.tianya.cn',
  1010. url: ()=> {if (indexOF('/list')) {
  1011. curSite = DBSite.tianya;
  1012. } else if (indexOF('/post')) {
  1013. curSite = DBSite.tianya_post;
  1014. }},
  1015. pager: {
  1016. nextL: '//div[contains(@class, "pages")]/div[@class="links"]/a[text()="下一页"]',
  1017. pageE: '.tab-bbs-list > tbody:not(:first-of-type)',
  1018. replaceE: '//div[contains(@class, "pages")]',
  1019. scrollD: 1500
  1020. }
  1021. }, // 天涯社区
  1022. tianya_post: {
  1023. thread: true,
  1024. pager: {
  1025. nextL: 'a.js-keyboard-next',
  1026. pageE: '.atl-main > div[class="atl-item"]',
  1027. replaceE: '.atl-pages > form',
  1028. scrollD: 2000
  1029. }
  1030. }, // 天涯社区 - 帖子内
  1031. hupu: {
  1032. host: 'bbs.hupu.com',
  1033. url: ()=> {if (indexOF('.html')) {
  1034. curSite = DBSite.hupu_post;
  1035. } else if (lp != '/' && !indexOF('/all-')) {
  1036. curSite = DBSite.hupu;
  1037. }},
  1038. pager: {
  1039. 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 ''}},
  1040. pageE: 'li.bbs-sl-web-post-body',
  1041. replaceE: 'ul.hupu-rc-pagination',
  1042. scrollD: 1500
  1043. }
  1044. }, // 虎扑社区
  1045. hupu_post: {
  1046. thread: true,
  1047. pager: {
  1048. nextL: 'li.hupu-rc-pagination-next > a',
  1049. pageE: '.post-reply-list ',
  1050. replaceE: 'ul.hupu-rc-pagination',
  1051. scrollD: 2000
  1052. }
  1053. }, // 虎扑社区 - 帖子内
  1054. nga_thread: {
  1055. host: ['bbs.nga.cn', 'ngabbs.com', 'nga.178.com', 'g.nga.cn'],
  1056. iframe: true,
  1057. url: ()=> {locationC = true;
  1058. if (lp == '/thread.php') {
  1059. curSite = DBSite.nga_thread;
  1060. } else if (lp == '/read.php') {
  1061. curSite = DBSite.nga_read;
  1062. }},
  1063. pager: {
  1064. nextL: '#pagebbtm a[title="下一页"]',
  1065. pageE: '#topicrows > tbody, #topicrows > script',
  1066. insertP: ['#topicrows', 3],
  1067. replaceE: 'div[name="pageball"]',
  1068. scriptT: 2,
  1069. scrollD: 1000
  1070. },
  1071. function: {
  1072. aF: ()=> {document.body.appendChild(document.createElement('script')).textContent = 'commonui.topicArg.loadAll();';}
  1073. }
  1074. }, // NGA - 各版块帖子列表
  1075. nga_read: {
  1076. history: false,
  1077. thread: true,
  1078. retry: 1000,
  1079. pager: {
  1080. nextL: '#pagebbtm a[title*="下一页"]',
  1081. pageE: 'id("m_posts_c")/table | id("m_posts_c")/script | //script[contains(text(), "commonui.userInfo.setAll")]',
  1082. insertP: ['#m_posts_c', 3],
  1083. replaceE: 'div[name="pageball"]',
  1084. scriptT: 2,
  1085. scrollD: 1000
  1086. }
  1087. }, // NGA - 帖子内
  1088. v2ex_recent: {
  1089. host: ['v2ex.com', 'www.v2ex.com'],
  1090. url: ()=> {if (lp == '/') {
  1091. v2ex_aF('#Main a.topic-link:not([target])');
  1092. } else if (lp == '/recent') {
  1093. curSite = DBSite.v2ex_recent;
  1094. v2ex_aF('#Main a.topic-link:not([target])');
  1095. } else if (lp == '/notifications') {
  1096. curSite = DBSite.v2ex_notifications;
  1097. v2ex_aF('#Main a[href^="/t/"]:not([target])');
  1098. } else if (lp == '/balance') {
  1099. curSite = DBSite.v2ex_balance;
  1100. } else if (indexOF('/go/')) {
  1101. curSite = DBSite.v2ex_go;
  1102. v2ex_aF('#Main a.topic-link:not([target])');
  1103. } else if (indexOF('/replies')) {
  1104. curSite = DBSite.v2ex_replies;
  1105. v2ex_aF('#Main a[href^="/t/"]:not([target])');
  1106. }},
  1107. pager: {
  1108. nextL: 'a.page_current+a.page_normal',
  1109. pageE: '.cell.item',
  1110. replaceE: '#Main > .box > .cell[style]:not(.item) > table',
  1111. scrollD: 1500
  1112. },
  1113. function: {
  1114. aF: v2ex_aF,
  1115. aFp: '#Main a.topic-link:not([target])'
  1116. }
  1117. }, // V2EX - 最近主题页
  1118. v2ex_notifications: {
  1119. pager: {
  1120. nextL: 'a.page_current+a.page_normal',
  1121. pageE: '#notifications > div',
  1122. replaceE: '#Main > .box > .cell[style] > table',
  1123. scrollD: 1500
  1124. },
  1125. function: {
  1126. aF: v2ex_aF,
  1127. aFp: '#Main a[href^="/t/"]:not([target])'
  1128. }
  1129. }, // V2EX - 提醒消息页
  1130. v2ex_replies: {
  1131. pager: {
  1132. nextL: 'a.page_current+a.page_normal',
  1133. 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]',
  1134. insertP: ['//div[@id="Main"]//div[@class="box"]//div[@class="cell"][last()]', 1],
  1135. replaceE: '#Main > .box > .cell[style] > table',
  1136. scrollD: 1500
  1137. },
  1138. function: {
  1139. aF: v2ex_aF,
  1140. aFp: '#Main a[href^="/t/"]:not([target])'
  1141. }
  1142. }, // V2EX - 用户回复页
  1143. v2ex_go: {
  1144. pager: {
  1145. nextL: 'a.page_current+a.page_normal',
  1146. pageE: '#TopicsNode > div',
  1147. replaceE: '#Main > .box > .cell[style] > table',
  1148. scrollD: 1500
  1149. },
  1150. function: {
  1151. aF: v2ex_aF,
  1152. aFp: '#Main a.topic-link:not([target])'
  1153. }
  1154. }, // V2EX - 分类主题页
  1155. v2ex_balance: {
  1156. pager: {
  1157. nextL: 'a.page_current+a.page_normal',
  1158. pageE: '#Main .box > div:not(.cell) > table > tbody > tr:not(:first-child)',
  1159. replaceE: '#Main > .box > .cell[style] > table',
  1160. scrollD: 1000
  1161. }
  1162. }, // V2EX - 账户余额页
  1163. jandan: {
  1164. host: 'jandan.net',
  1165. url: ()=> {if (lp == '/' || indexOF('/page/')) {
  1166. curSite = DBSite.jandan;
  1167. } else if (lp == '/dzh') {
  1168. curSite = DBSite.jandan_dzh;
  1169. } else {
  1170. curSite = DBSite.jandan_comment;
  1171. }},
  1172. style: '#nav_prev, #nav_next, .post.f:not(.list-post) {display: none !important;}',
  1173. history: false,
  1174. pager: {
  1175. nextL: '//div[@class="wp-pagenavi"]/a[contains(text(), "下一页") or contains(text(), "更多文章")]',
  1176. pageE: '#content > .list-post',
  1177. replaceE: '.wp-pagenavi',
  1178. scrollD: 1500
  1179. },
  1180. function: {
  1181. bF: src_bF,
  1182. bFp: [0, 'img[data-original]', 'data-original']
  1183. }
  1184. }, // 煎蛋网
  1185. jandan_comment: {
  1186. 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;}',
  1187. pager: {
  1188. nextL: 'a.previous-comment-page',
  1189. pageE: 'ol.commentlist > li[id^="comment-"], script[src^="//cdn.jandan.net/static/min/"]',
  1190. insertP: ['ol.commentlist', 3],
  1191. replaceE: '.cp-pagenavi',
  1192. scriptT: 2,
  1193. scrollD: 1500
  1194. },
  1195. function: {
  1196. bF: pageE => { // 插入前函数(修改当前网页中的 吐槽 等按钮,避免重复添加点击事件)
  1197. getAllCSS('a.tucao-btn').forEach(function (now) {now.className = now.className.replace('tucao-btn', 'tucao-btn23');});
  1198. getAllCSS('a.comment-like.like').forEach(function (now) {now.className = now.className.replace('comment-like', 'comment-like23');});
  1199. getAllCSS('a.comment-unlike.unlike').forEach(function (now) {now.className = now.className.replace('comment-unlike', 'comment-unlike23');});
  1200. return pageE
  1201. }
  1202. }
  1203. }, // 煎蛋网
  1204. jandan_dzh: {
  1205. history: false,
  1206. pager: {
  1207. type: 2,
  1208. nextL: '.show_more',
  1209. interval: 1500,
  1210. scrollD: 1500
  1211. }
  1212. }, // 煎蛋网 - 大杂烩
  1213. qiushibaike: {
  1214. host: 'www.qiushibaike.com',
  1215. url: ()=> {insStyle('.qrcode-wrap, .qrcode-wrap-img, .index-side-left-AD1 {display: none !important;}');
  1216. if (lp == '/') {
  1217. curSite = DBSite.qiushibaike;
  1218. } else if (!indexOF('/article/')) {
  1219. curSite = DBSite.qiushibaike_;
  1220. }},
  1221. pager: {
  1222. nextL: '//ul[@class="pagination"]//a[./span[@class="next"]]',
  1223. pageE: '.recommend-article > ul > li',
  1224. replaceE: 'ul.pagination',
  1225. scrollD: 1500
  1226. }
  1227. }, // 糗事百科
  1228. qiushibaike_: {
  1229. pager: {
  1230. nextL: '//ul[@class="pagination"]//a[./span[@class="next"]]',
  1231. pageE: '[id^="qiushi_tag_"]',
  1232. replaceE: 'ul.pagination',
  1233. scrollD: 1500
  1234. }
  1235. }, // 糗事百科 - 分类页
  1236. lkong: {
  1237. host: 'www.lkong.com',
  1238. url: ()=> {locationC = true; if (indexOF('/forum/')) {
  1239. curSite = DBSite.lkong;
  1240. } else if (indexOF('/thread/')) {
  1241. curSite = DBSite.lkong;
  1242. curSite.thread = true;
  1243. curSite.pager.pageE = '//div[@class="main-content"]/parent::div | //head/style[@data-emotion-css]';
  1244. curSite.pager.insertP = ['//div[@class="main-content"][1]/parent::div/parent::div', 3];
  1245. }},
  1246. history: false,
  1247. pager: {
  1248. nextL: ()=> { // 获取下一页地址
  1249. let next = getCSS('li.ant-pagination-next'), page;
  1250. if (next && next.getAttribute('aria-disabled') === 'false') {
  1251. page = getCSS('li.ant-pagination-item-active[title]');
  1252. if (page && page.title) {return (location.origin + location.pathname + '?page=' + ++page.title);}
  1253. }
  1254. return '';
  1255. },
  1256. pageE: '//div[@class="main-title"]/parent::div/parent::div | //head/style[@data-emotion-css]',
  1257. insertP: ['//div[@class="main-title"][1]/parent::div/parent::div/parent::div', 3],
  1258. replaceE: 'ul.ant-pagination',
  1259. interval: 500,
  1260. scrollD: 1200
  1261. }
  1262. }, // 龙的天空
  1263. pediy_forum: {
  1264. host: 'bbs.pediy.com',
  1265. url: ()=> {if (indexOF('/forum-')) {
  1266. curSite = DBSite.pediy_forum;
  1267. } else if (indexOF('/thread-')) {
  1268. curSite = DBSite.pediy_thread;
  1269. }},
  1270. pager: {
  1271. nextL: '//a[@class="page-link" and text()="▶"]',
  1272. pageE: 'table.threadlist > tbody > tr',
  1273. replaceE: 'ul.pagination',
  1274. scrollD: 1500
  1275. }
  1276. }, // 看雪论坛 - 各版块帖子列表
  1277. pediy_thread: {
  1278. thread: true,
  1279. pager: {
  1280. nextL: '//a[@class="page-link" and text()="▶"]',
  1281. pageE: 'table.postlist > tbody > tr[data-pid]',
  1282. replaceE: 'ul.pagination',
  1283. scrollD: 1500
  1284. }
  1285. }, // 看雪论坛 - 帖子内
  1286. bangumitv: {
  1287. host: 'bangumi.tv',
  1288. url: ()=> {
  1289. if (indexOF('/browser') || indexOF('/subject_search')) {
  1290. curSite = DBSite.bangumitv;
  1291. } else if (indexOF('/forum')) {
  1292. curSite = DBSite.bangumitv_forum;
  1293. }},
  1294. pager: {
  1295. nextL: '//div[@class="page_inner"]/a[text()="››"]',
  1296. pageE: 'ul#browserItemList > li',
  1297. replaceE: '.page_inner',
  1298. scrollD: 1500
  1299. }
  1300. }, // 番组计划
  1301. bangumitv_forum: {
  1302. pager: {
  1303. nextL: '//div[@class="page_inner"]/a[text()="››"]',
  1304. pageE: '.topic_list > tbody:last-of-type > tr.topic',
  1305. replaceE: '.page_inner',
  1306. scrollD: 1500
  1307. }
  1308. }, // 番组计划 - 小组帖子列表
  1309. dongchedi: {
  1310. host: 'www.dongchedi.com',
  1311. url: ()=> {locationC = true;
  1312. if (indexOF('/community/')) {
  1313. curSite = DBSite.dongchedi;
  1314. }},
  1315. pager: {
  1316. nextL: 'li.pagination-item.is-active+li > a',
  1317. pageE: '.data-wrapper > section.community-card, style',
  1318. insertP: ['.data-wrapper', 3],
  1319. replaceE: '//ul[./li[contains(@class, "pagination-item")]]',
  1320. scrollD: 2000
  1321. },
  1322. function: {
  1323. bF: pageE => {
  1324. pageE.forEach(function (one) {
  1325. one.querySelectorAll('.g-load-img-wrap, .tw-absolute.tw-cursor-pointer, .avatar').forEach(function (now) {
  1326. getCSS('noscript+img', now).src = getCSS('noscript > img', now).src;
  1327. });
  1328. });
  1329. return pageE
  1330. }
  1331. }
  1332. }, // 懂车帝论坛
  1333. kdslife: {
  1334. host: 'club.kdslife.com',
  1335. url: ()=> {
  1336. if (indexOF('/f_')) {
  1337. curSite = DBSite.kdslife;
  1338. } else if (indexOF('/t_')) {
  1339. curSite = DBSite.kdslife_t;
  1340. }},
  1341. pager: {
  1342. nextL: '//div[@class="fr i3_r"]/a[text()="后一页"]',
  1343. pageE: 'ul.main_List > li.i2:not(.h_bg)',
  1344. replaceE: 'ul.main_List > li.i3',
  1345. scrollD: 1000
  1346. }
  1347. }, // 宽带山论坛
  1348. kdslife_t: {
  1349. pager: {
  1350. nextL: '//div[@class="pages"]/a[text()=">>"]',
  1351. pageE: '#reply_list_panel > *, script[src*="ui/js/kds.js"]',
  1352. insertP: ['#reply_list_panel', 3],
  1353. replaceE: '.pages',
  1354. scriptT: 2,
  1355. scrollD: 1000
  1356. }
  1357. }, // 宽带山论坛 - 帖子内
  1358. libaclub: {
  1359. host: 'www.libaclub.com',
  1360. url: ()=> {
  1361. if (lp == '/' || indexOF('/date_')) {
  1362. curSite = DBSite.libaclub;
  1363. } else if (indexOF('/f_')) {
  1364. curSite = DBSite.libaclub_f;
  1365. } else if (indexOF('/t_') || indexOF('/reply_')) {
  1366. curSite = DBSite.libaclub_t;
  1367. } else if (indexOF('/prt_')) {
  1368. curSite = DBSite.libaclub_prt;
  1369. } else if (lp == '/facade.php') {
  1370. curSite = DBSite.libaclub_search;
  1371. }},
  1372. style: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1373. pager: {
  1374. nextL: '//div[@class="ui-crumbs-more"]/a[@class="fn-link"][1]',
  1375. pageE: 'ul.ui-list > li:not(.ui-list-item-head):not(.ui-list-merchant-ad)',
  1376. replaceE: 'div.ui-crumbs-more',
  1377. scrollD: 1200
  1378. }
  1379. }, // 篱笆网论坛
  1380. libaclub_f: {
  1381. style: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1382. pager: {
  1383. nextL: 'a.ui-paging-next',
  1384. pageE: 'ul.ui-list > li:not(.ui-list-item-head):not(.ui-list-merchant-ad)',
  1385. replaceE: 'div.ui-paging',
  1386. scrollD: 1200
  1387. }
  1388. }, // 篱笆网论坛 - 各版块帖子列表
  1389. libaclub_t: {
  1390. style: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1391. pager: {
  1392. nextL: 'a.ui-paging-next',
  1393. pageE: '.ui-box-content > div.ui-topic, .ui-box-content > a[name]',
  1394. insertP: ['.ui-box-content', 3],
  1395. replaceE: 'div.ui-paging',
  1396. scrollD: 1500
  1397. }
  1398. }, // 篱笆网论坛 - 帖子内
  1399. libaclub_prt: {
  1400. style: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1401. pager: {
  1402. nextL: 'a.ui-paging-next',
  1403. pageE: 'ul.ui-list > li',
  1404. replaceE: 'div.ui-paging',
  1405. scrollD: 2000
  1406. }
  1407. }, // 篱笆网论坛 - 帖子内 - 打印版
  1408. libaclub_search: {
  1409. style: 'li.ui-list-merchant-ad, .ui-nav-appImage {display: none !important;}',
  1410. pager: {
  1411. nextL: '//div[@class="ui-page"]/a[contains(text(), "下一页")]',
  1412. pageE: '.ui-box-main > ul.ui-list > li',
  1413. replaceE: 'div.ui-page',
  1414. scrollD: 1200
  1415. }
  1416. }, // 篱笆网论坛 - 搜索页
  1417. taoguba: {
  1418. host: 'www.taoguba.com.cn',
  1419. url: ()=> {insStyle('#joinTGB {display: none !important;}')
  1420. if (indexOF('/Article/')) {
  1421. curSite = DBSite.taoguba_t;
  1422. } else if (indexOF('/shenghuoba/')) {
  1423. curSite = DBSite.taoguba_;
  1424. } else if (indexOF(/\/bbs|zongban|dianzan|jinghua\//)) {
  1425. curSite = DBSite.taoguba;
  1426. }},
  1427. history: false,
  1428. pager: {
  1429. nextL: ()=> {
  1430. let next = getXpath('//div[contains(@class, "t_page01")]/a[contains(text(), "下一页")]'), next_ = '/';
  1431. if (next) {
  1432. next = next.getAttribute('onclick').replace('gotoPage(','').replace(')','').split(',');
  1433. if (indexOF(/\/dianzan|jinghua\//)) next_ = '-';
  1434. if (parseInt(next[0]) <= parseInt(next[2])) {return (`${location.origin}/${location.pathname.split('/')[1]}/${next[0]}${next_}${next[1]}`)}
  1435. }
  1436. return '';
  1437. },
  1438. pageE: '.p_list > .p_list01[class*="user_"]',
  1439. replaceE: '.t_page',
  1440. scrollD: 1000
  1441. }
  1442. }, // 淘股吧论坛
  1443. taoguba_: {
  1444. history: false,
  1445. pager: {
  1446. nextL: ()=> {
  1447. let next = getCSS('#N_go_pageBtn'), next_ = location.pathname.split('/')[2].split('-')[0];
  1448. if (next && (parseInt(next.dataset.now) + 1 <= parseInt(next.dataset.total))) {
  1449. if (!next_) next_ = 'H';
  1450. return (`${location.origin}/shenghuoba/${next_}-${parseInt(next.dataset.now) + 1}`)
  1451. }
  1452. return '';
  1453. },
  1454. pageE: '.lifeContent-topicList-item',
  1455. replaceE: '.N_sortPage ',
  1456. scrollD: 1000
  1457. }
  1458. }, // 淘股吧论坛 - 生活圈
  1459. taoguba_t: {
  1460. history: false,
  1461. thread: true,
  1462. pager: {
  1463. nextL: ()=> {
  1464. let next = getXpath('//div[contains(@class, "t_page01")]/a[contains(text(), "下一页")]');
  1465. if (next) {
  1466. next = next.getAttribute('onclick').replace('gotoPageTopic(','').replace(')','').split(',');
  1467. if (parseInt(next[0]) <= parseInt(next[1])) {return (`${location.origin}/Article/${getCSS("#looktopicID").value}/${next[0]}`)}
  1468. }
  1469. return '';
  1470. },
  1471. pageE: 'div[id^="reply_"]',
  1472. replaceE: '.t_page',
  1473. scrollD: 1000
  1474. },
  1475. function: {
  1476. bF: src_bF,
  1477. bFp: [0, 'img[data-original]', 'data-original']
  1478. }
  1479. }, // 淘股吧论坛 - 帖子内
  1480. lowendtalk: {
  1481. host: 'lowendtalk.com',
  1482. pager: {
  1483. nextL: 'a.Next',
  1484. pageE: 'ul.DataList > li',
  1485. replaceE: '.Pager',
  1486. scrollD: 1500
  1487. }
  1488. }, // LowEndTalk
  1489. lieyou: {
  1490. host: 'bbs.lieyou888.com',
  1491. url: ()=> {if (indexOF('/forum')) {curSite = DBSite.lieyou;}},
  1492. pager: {
  1493. nextL: '//div[contains(@class, "_pageNav")]/a[text()="下一页"]',
  1494. pageE: 'ul.gb-bbs-list > li',
  1495. replaceE: '._pageNav',
  1496. scrollD: 1000
  1497. },
  1498. function: {
  1499. bF: src_bF,
  1500. bFp: [0, 'img[original]', 'original']
  1501. }
  1502. }, // 芥子空间论坛
  1503. xcar_forumdisplay: {
  1504. host: 'www.xcar.com.cn',
  1505. url: ()=> {if (lp == '/bbs/forumdisplay.php') {curSite = DBSite.xcar_forumdisplay}},
  1506. pager: {
  1507. nextL: 'a.page_down',
  1508. pageE: '.table-section > dl:not(.table_head)',
  1509. replaceE: '.forumList_page',
  1510. scrollD: 2000
  1511. }
  1512. }, // 爱卡汽车网论坛 - 各版块帖子列表
  1513. flyert_forumdisplay: {
  1514. host: 'www.flyert.com',
  1515. url: ()=> {if (indexOF('/forum-') || indexOF('mod=forumdisplay', 's')) {
  1516. curSite = DBSite.flyert_forumdisplay;
  1517. } else if (indexOF('/forum') || indexOF('mod=viewthread', 's')) {
  1518. curSite = DBSite.flyert_viewthread;
  1519. }},
  1520. pager: {
  1521. nextL: 'a.nxt:not([href*="javascript"])',
  1522. pageE: '#threadlist table > tbody[id^="normalthread_"]',
  1523. replaceE: '.pg',
  1524. scrollD: 2500
  1525. }
  1526. }, // 飞客网论坛 - 各版块帖子列表
  1527. flyert_viewthread: {
  1528. thread: true,
  1529. pager: {
  1530. nextL: 'a.nxt:not([href*="javascript"])',
  1531. pageE: '#postlist > .comiis_viewbox',
  1532. replaceE: '.comiis_pgs > .pg',
  1533. scrollD: 3000
  1534. }
  1535. }, // 飞客网论坛 - 帖子内
  1536. cnprint: {
  1537. host: 'www.cnprint.org',
  1538. url: ()=> {if (indexOF('/forum/')) {curSite = DBSite.cnprint;} else if (indexOF('/thread/')) {curSite = DBSite.cnprint_thread;}},
  1539. pager: {
  1540. nextL: 'a[rel="next"]',
  1541. pageE: 'tbody[id*="threadbits_forum"] > tr',
  1542. replaceE: '.pagenav',
  1543. scrollD: 2500
  1544. }
  1545. }, // CPC 中文印刷社区
  1546. cnprint_thread: {
  1547. thread: true,
  1548. pager: {
  1549. nextL: 'a[rel="next"]',
  1550. pageE: '#posts > div:not([id])',
  1551. replaceE: '.pagenav',
  1552. scrollD: 2000
  1553. }
  1554. }, // CPC 中文印刷社区 - 帖子内
  1555. discusshk: {
  1556. host: /.+\.discuss\.com\.hk/,
  1557. url: ()=> {if (lp == '/forumdisplay.php') {curSite = DBSite.discusshk;} else if (lp == '/viewthread.php') {curSite = DBSite.discusshk_thread;}},
  1558. pager: {
  1559. nextL: '.pagination a.next',
  1560. pageE: 'tbody[id^="normalthread_"]',
  1561. replaceE: '.pagination',
  1562. scrollD: 2000
  1563. }
  1564. }, // 中国香港社区
  1565. discusshk_thread: {
  1566. thread: true,
  1567. style: '.viewthread.mt-0:not(:first-of-type) .viewthread__head {display: none !important;}',
  1568. pager: {
  1569. nextL: '.pagination a.next',
  1570. pageE: '.viewthread',
  1571. replaceE: '.pagination',
  1572. scrollD: 2000
  1573. }
  1574. }, // 中国香港论坛 - 帖子内
  1575. tgfcer: {
  1576. host: 'bbs.tgfcer.com',
  1577. url: ()=> {if (lp == '/forumdisplay.php' || indexOF('/forum')) {curSite = DBSite.tgfcer;} else if ((lp == '/viewthread.php' || indexOF('/thread'))) {curSite = DBSite.tgfcer_thread;}},
  1578. pager: {
  1579. nextL: '.pages a.next',
  1580. pageE: 'tbody[id^="normalthread_"]',
  1581. replaceE: '.pages',
  1582. scrollD: 2000
  1583. }
  1584. }, // TGFC Lifestyle
  1585. tgfcer_thread: {
  1586. thread: true,
  1587. style: '.viewthread:not(:first-of-type) h1 {display: none !important;}',
  1588. pager: {
  1589. nextL: '.pages a.next',
  1590. pageE: '.viewthread',
  1591. replaceE: '.pages',
  1592. scrollD: 2000
  1593. }
  1594. }, // TGFC Lifestyle - 帖子内
  1595. south: {
  1596. host: [/((www|bbs)\.)?(soul|north|south|white|level|summer|spring|snow)-plus\.(net|org)/, 'bbs.imoutolove.me'],
  1597. url: ()=> {
  1598. if (lp == '/thread.php' || lp == '/search.php') {
  1599. curSite = DBSite.south;
  1600. } else if (lp == '/thread_new.php') {
  1601. 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;}';
  1602. } else if (lp == '/read.php') {
  1603. curSite = DBSite.south; curSite.thread = true; curSite.pager.pageE = 'form[name=delatc] > *:not(input)';
  1604. } else if (lp == '/u.php' && (indexOF('action-topic-', 's') || indexOF('action-post-', 's'))) {
  1605. curSite = DBSite.south; curSite.pager.pageE = '#u-contentmain table tr';
  1606. }},
  1607. pager: {
  1608. nextL: '//div[@class="pages"]/ul/li[./b]/following-sibling::li[1][not(@class)]/a[not(text()="»")]',
  1609. pageE: 'tr.tr3',
  1610. replaceE: '.pages',
  1611. scrollD: 1500
  1612. }
  1613. }, // South Plus (南+)
  1614. goddessfantasy: {
  1615. host: 'www.goddessfantasy.net',
  1616. url: ()=> {
  1617. if (indexOF('board=', 's')) {
  1618. curSite = DBSite.goddessfantasy;
  1619. } else if (indexOF('topic=', 's')) {
  1620. curSite = DBSite.goddessfantasy; curSite.pager.pageE = '#quickModForm > *'; curSite.thread = true;
  1621. }},
  1622. pager: {
  1623. nextL: '//div[contains(@class,"pagelinks")]/a[@class="navPages" and text()="»"]',
  1624. pageE: '.table_grid > tbody > tr',
  1625. replaceE: '.pagelinks',
  1626. scrollD: 1500
  1627. }
  1628. }, // 纯美苹果园
  1629. adnmb3: {
  1630. host: ['adnmb3.com', 'www.tnmb.org', 'nimingban.xyz', 'nimingban.org'],
  1631. url: ()=> {
  1632. if (indexOF('/m/f/')) {
  1633. curSite = DBSite.adnmb3_mf;
  1634. } else if (indexOF('/m/t/')) {
  1635. curSite = DBSite.adnmb3_mt;
  1636. } else if (indexOF(/\/(f|Forum)\//)) {
  1637. curSite = DBSite.adnmb3;
  1638. } else if (indexOF('/t/')) {
  1639. curSite = DBSite.adnmb3_t;
  1640. }},
  1641. pager: {
  1642. nextL: '//ul[contains(@class, "pagination")]//a[text()="下一页"]',
  1643. pageE: '.h-threads-list > *, script[src$="/h.desktop.js"]',
  1644. insertP: ['.h-threads-list', 3],
  1645. replaceE: '//ul[contains(@class, "pagination")]',
  1646. scriptT: 2,
  1647. scrollD: 2500
  1648. }
  1649. }, // A 岛
  1650. adnmb3_t: {
  1651. thread: true,
  1652. pager: {
  1653. nextL: '//ul[contains(@class, "pagination")]//a[text()="下一页"]',
  1654. pageE: '.h-threads-list > .h-threads-item > .h-threads-item-replys, script[src$="/h.desktop.js"]',
  1655. insertP: ['.h-threads-list > .h-threads-item', 3],
  1656. replaceE: '//ul[contains(@class, "pagination")]',
  1657. scriptT: 2,
  1658. scrollD: 2500
  1659. }
  1660. }, // A 岛 - 帖子内
  1661. adnmb3_mf: {
  1662. pager: {
  1663. nextL: '//li[contains(@class, "pagination-next")]//a[text()="下一页"]',
  1664. 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"]',
  1665. insertP: ['#h-threads-pagination', 1],
  1666. replaceE: '#h-threads-pagination',
  1667. scriptT: 2,
  1668. scrollD: 2500
  1669. }
  1670. }, // A 岛 - 帖子列表(手机版)
  1671. adnmb3_mt: {
  1672. thread: true,
  1673. pager: {
  1674. nextL: '//li[contains(@class, "pagination-next")]//a[text()="下一页"]',
  1675. pageE: '.h-threads-replylist > div, script[src$="/h.mobile.js"]',
  1676. insertP: ['.h-threads-replylist', 3],
  1677. replaceE: '#h-threads-pagination',
  1678. scriptT: 2,
  1679. scrollD: 2500
  1680. }
  1681. }, // A 岛 - 帖子内(手机版)
  1682. pixiv: {
  1683. host: 'www.pixiv.net',
  1684. url: ()=> {locationC = true;
  1685. if (lp == '/') {
  1686. forceTarget();
  1687. } else if (indexOF('/tags/')/* && self == top*/) {
  1688. curSite = DBSite.pixiv;
  1689. } else if (indexOF('/users/') && indexOF(/\/(artworks|illustrations|manga)/)) {
  1690. curSite = DBSite.pixiv_user;
  1691. } else if (indexOF('/artworks/')) {
  1692. setTimeout(function(){getXpath('//button[contains(string(), "查看全部") or contains(string(), "See all") or contains(string(), "すべて見る") or contains(string(), "모두 보기")]').click();}, 1000)
  1693. }
  1694. },
  1695. forceTarget: true,
  1696. 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;}',
  1697. iframe: true,
  1698. pager: {
  1699. type: 5,
  1700. nextL: 'a[aria-disabled="false"][class*="filterProps-Styled-Component"][href]:last-child',
  1701. /*pageE: '//ul[contains(@class, "-1 ")]/li',
  1702. insertP: ['//ul[contains(@class, "-1 ")]', 3],
  1703. replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]',*/
  1704. scrollD: 2000
  1705. }
  1706. }, // Pixiv - 分类页
  1707. pixiv_user: {
  1708. forceTarget: true,
  1709. 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;}',
  1710. pager: {
  1711. type: 5,
  1712. nextL: 'a[aria-disabled="false"][class*="filterProps-Styled-Component"][href]:last-child',
  1713. /*pageE: '//ul[contains(@class, "-1 ")]/li',
  1714. insertP: ['//ul[contains(@class, "-1 ")]', 3],
  1715. replaceE: '//nav[./a[@aria-disabled="false"][contains(@class, "filterProps-Styled-Component")]]',*/
  1716. scrollD: 2000
  1717. }
  1718. }, // Pixiv - 用户作品页
  1719. vilipix: {
  1720. host: 'www.vilipix.com',
  1721. url: ()=> {locationC = true; if (lp == '/') {forceTarget();} else if (indexOF(/\/(tags|user|new|ranking)/)) {curSite = DBSite.vilipix;}},
  1722. forceTarget: true,
  1723. pager: {
  1724. type: 6,
  1725. nextL: ()=> {let next = getCSS('li.number.active+li.number'); if (next) return (location.origin + location.pathname + '?p=' + next.textContent)},
  1726. pageE: 'ul.illust-content > li',
  1727. replaceE: 'ul.el-pager',
  1728. loadTime: 800,
  1729. scrollD: 2000
  1730. }
  1731. }, // Vilipix
  1732. pixivision: {
  1733. host: 'www.pixivision.net',
  1734. url: ()=> {if (!indexOF('/a/')) curSite = DBSite.pixivision;},
  1735. pager: {
  1736. nextL: 'a.next',
  1737. pageE: 'li.article-card-container',
  1738. replaceE: '._pager',
  1739. scrollD: 2000
  1740. }
  1741. }, // Pixivision
  1742. _58pic: {
  1743. host: 'www.58pic.com',
  1744. url: ()=> {insStyle('.qt-model-t.login-model {display: none !important;}');
  1745. if (indexOF(/\/(tupian|piccate)\//)) {
  1746. curSite = DBSite._58pic;
  1747. 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;}')
  1748. } else if (indexOF('/c/')) {
  1749. curSite = DBSite._58pic_c;
  1750. }},
  1751. style: '.qtw-card.place-box, .card-lazy, .is-line .is-back {display: none !important;}',
  1752. pager: {
  1753. nextL: '//div[contains(@class,"page-box")]//a[text()="下一页"]',
  1754. pageE: '.card-grid-box:not(.favorites-box) > div',
  1755. replaceE: '.page-box',
  1756. scrollD: 2500
  1757. },
  1758. function: {
  1759. bF: "src_bF",
  1760. bFp: [0, 'img[data-original]', 'data-original']
  1761. }
  1762. }, // 千图网 - 分类/搜索页
  1763. _58pic_c: {
  1764. pager: {
  1765. nextL: '//div[contains(@class,"page-box")]//a[text()="下一页"]',
  1766. pageE: '.list-box > .qtw-card',
  1767. replaceE: '.page-box',
  1768. scrollD: 4000
  1769. },
  1770. function: {
  1771. bF: src_bF,
  1772. bFp: [0, 'img[data-original]', 'data-original']
  1773. }
  1774. }, // 千图网 - 专题/收藏夹
  1775. _588ku: {
  1776. host: '588ku.com',
  1777. style: '.listlogin-box.listloginBox, .CLdialogV1, .editIndexEntry, .globalRSideB {display: none !important;}',
  1778. pager: {
  1779. nextL: '//ul[contains(@class, "page-list")]//a[text()="下一页"]',
  1780. pageE: '.data-box .dataList, .data-box .data-list',
  1781. insertP: ['.data-box .dataList, .data-box .data-list', 3],
  1782. replaceE: 'ul.page-list',
  1783. scrollD: 2000
  1784. },
  1785. function: {
  1786. bF: src_bF,
  1787. bFp: [0, 'img[data-original]', 'data-original']
  1788. }
  1789. }, // 千库网
  1790. nipic: {
  1791. host: ['www.nipic.com', 'soso.nipic.com'],
  1792. style: 'li.search-works-item {display: none !important;}',
  1793. pager: {
  1794. nextL: '//a[@title="下一页" or text()="下一页"][not(contains(@class, "search-works-nextpage"))]',
  1795. pageE: 'ul#img-list-outer > li',
  1796. replaceE: '.common-page-box, .common-seo-page-box',
  1797. scrollD: 2000
  1798. },
  1799. function: {
  1800. bF: src_bF,
  1801. bFp: [0, 'img[data-original]', 'data-original']
  1802. }
  1803. }, // 昵图网
  1804. ztupic: {
  1805. host: 'www.ztupic.com',
  1806. url: ()=> {if (lp != '/' && !indexOF('/sucai/')) {curSite = DBSite.ztupic;}},
  1807. pager: {
  1808. nextL: 'a.page-link[rel="next"]',
  1809. pageE: '.floor_item',
  1810. replaceE: 'ul.pagination',
  1811. scrollD: 2000
  1812. },
  1813. function: {
  1814. bF: src_bF,
  1815. bFp: [0, 'img[data-src]', 'data-src']
  1816. }
  1817. }, // 众图网
  1818. ooopic: {
  1819. host: ['www.ooopic.com', 'so.ooopic.com', 'weili.ooopic.com'],
  1820. url: ()=> {if (lp != '/' && !indexOF('/weili_')) {curSite = DBSite.ooopic;}},
  1821. style: '.overWidth.clearfix.masonry {height: auto !important;} .pic-list, .video-list {position: relative !important;float: left !important;top: auto !important;left: auto !important;}',
  1822. pager: {
  1823. nextL: 'a.next_page, a.so-next',
  1824. pageE: '.overWidth.clearfix.masonry > div',
  1825. replaceE: '.page',
  1826. scrollD: 2000
  1827. },
  1828. function: {
  1829. bF: src_bF,
  1830. bFp: [0, 'img[data-original]', 'data-original']
  1831. }
  1832. }, // 我图网
  1833. ibaotu: {
  1834. host: 'ibaotu.com',
  1835. 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'}}},
  1836. style: '.searchAdver {display: none !important;}',
  1837. pager: {
  1838. nextL: 'a.next',
  1839. pageE: '.pr-container[pr-data-title]:not(.searchAdver)',
  1840. replaceE: '.pagelist',
  1841. scrollD: 2000
  1842. },
  1843. function: {
  1844. bF: src_bF,
  1845. bFp: [0, 'img[data-url]', 'data-url']
  1846. }
  1847. }, // 包图网
  1848. pixabay: {
  1849. host: 'pixabay.com',
  1850. pager: {
  1851. nextL: '//a[text()="›"]',
  1852. pageE: '[class^="results"] > [class^="container"] > div',
  1853. replaceE: '//a[text()="›"]',
  1854. scrollD: 2000
  1855. },
  1856. function: {
  1857. bF: src_bF,
  1858. bFp: [0, 'img[data-lazy-src]', 'data-lazy-src']
  1859. }
  1860. }, // Pixabay
  1861. logosc: {
  1862. host: 'www.logosc.cn',
  1863. url: '/\\/so\\//',
  1864. pager: {
  1865. type: 2,
  1866. nextL: 'button.so-pablo-button',
  1867. interval: 1500,
  1868. scrollD: 1500
  1869. }
  1870. }, // 搜图神器 (免费无版权)
  1871. sccnn: {
  1872. host: 'www.sccnn.com',
  1873. pager: {
  1874. nextL: '//ul[@class="listpage"]//a[text()=">"]',
  1875. pageE: 'td[valign="TOP"]:not([width]) tr[valign="Middle"]',
  1876. replaceE: 'ul.listpage',
  1877. scrollD: 1000
  1878. }
  1879. }, // 素材中国
  1880. sccnn_so: {
  1881. host: 'so.sccnn.com',
  1882. pager: {
  1883. nextL: 'font[color="Red"]+a.F16',
  1884. pageE: '//tr[@valign="Top"][1]/preceding-sibling::tr',
  1885. replaceE: '//tr[@valign="Top"][last()]',
  1886. scrollD: 1000
  1887. }
  1888. }, // 素材中国 - 搜索页
  1889. pngss: {
  1890. host: 'pngss.com',
  1891. url: ()=> {if (lp == '/search') curSite = DBSite.pngss;},
  1892. pager: {
  1893. nextL: '.page a[rel="next"]',
  1894. pageE: 'ul.list-ul > li',
  1895. replaceE: '.page',
  1896. scrollD: 1200
  1897. },
  1898. function: {
  1899. bF: src_bF,
  1900. bFp: [0, 'img[data-original]', 'data-original']
  1901. }
  1902. }, // PNG 搜索网
  1903. iconfont: {
  1904. host: 'www.iconfont.cn',
  1905. url: ()=> {locationC = true; if (indexOF('/search/')) curSite = DBSite.iconfont;},
  1906. forceTarget: true,
  1907. style: '.footer, header .bind-tips, .block-pagination-wrap, #magix_vf_main .block-sub-banner, #J_block_sidebar {display: none !important;}',
  1908. iframe: true,
  1909. pager: {
  1910. type: 5,
  1911. nextL: ()=> getNextEP('li.active+li:not(.disabled) > a', 'page=', /page=\d+/),
  1912. scrollD: 1000
  1913. }
  1914. }, // iconfont
  1915. iconarchive: {
  1916. host: 'iconarchive.com',
  1917. url: '/\\/(tag|search|category)/',
  1918. pager: {
  1919. nextL: 'a.next',
  1920. pageE: '.icondetail',
  1921. replaceE: '.pagination',
  1922. scrollD: 2000
  1923. }
  1924. }, // IconArchive
  1925. puxiang: {
  1926. host: 'www.puxiang.com',
  1927. url: ()=> {if (lp == '/search/favorite') {
  1928. curSite = DBSite.puxiang_collect;
  1929. } else if (lp == '/search/puxiang' || lp == '/list' || lp == '/galleries' || lp == '/articles') {
  1930. curSite = DBSite.puxiang;
  1931. } else if (lp == '/') {
  1932. curSite = DBSite.puxiang; curSite.pager.scrollD = 4000;
  1933. }},
  1934. pager: {
  1935. nextL: 'li.next > a',
  1936. pageE: '.work-list > div',
  1937. replaceE: '.pagerbar',
  1938. scrollD: 1500
  1939. }
  1940. }, // 普象网 - 作品集/搜索页
  1941. puxiang_collect: {
  1942. pager: {
  1943. nextL: 'li.next > a',
  1944. pageE: '.collect-list > div',
  1945. replaceE: '.pagerbar',
  1946. scrollD: 1500
  1947. }
  1948. }, // 普象网 - 收藏夹
  1949. xuexiniu: {
  1950. host: ['www.xuexiniu.com', 'bbs.xuexiniu.com'],
  1951. url: ()=> {
  1952. if (getCSS('body#nv_forum.pg_forumdisplay')) {
  1953. if (getCSS('ul.waterfall')) {
  1954. curSite = DBSite.xuexiniu_forum;
  1955. } else {
  1956. curSite = DBSite.discuz_guide
  1957. }
  1958. } else if (getCSS('body#nv_forum.pg_viewthread')) {
  1959. curSite = DBSite.xuexiniu_thread;
  1960. } else if (indexOF('/search.php')) {
  1961. curSite = DBSite.xuexiniu_search;
  1962. } else {
  1963. curSite = DBSite.xuexiniu;
  1964. }
  1965. },
  1966. pager: {
  1967. nextL: '//a[@class="page-link" and contains(text(), "下一页")]',
  1968. pageE: '.row > .col-sm-6',
  1969. replaceE: 'ul.pagination',
  1970. scrollD: 1000
  1971. }
  1972. }, // 学犀牛 - 分类页
  1973. xuexiniu_forum: {
  1974. pager: {
  1975. nextL: 'a.nxt:not([href*="javascript"])',
  1976. pageE: '.waterfall > li',
  1977. replaceE: '.pg',
  1978. scrollD: 1500
  1979. }
  1980. }, // 学犀牛 - 各板块帖子列表
  1981. xuexiniu_thread: {
  1982. thread: true,
  1983. pager: {
  1984. nextL: 'a.nxt:not([href*="javascript"])',
  1985. pageE: '#zhanzhuai_primary > .box',
  1986. replaceE: '.pg',
  1987. scrollD: 1500
  1988. }
  1989. }, // 学犀牛 - 帖子内
  1990. xuexiniu_search: {
  1991. pager: {
  1992. nextL: 'a.nxt:not([href*="javascript"])',
  1993. pageE: '.yangshi.yangshi2',
  1994. insertP: ['.page', 1],
  1995. replaceE: '.page',
  1996. scrollD: 1500
  1997. }
  1998. }, // 学犀牛 - 搜索页
  1999. om: {
  2000. host: 'www.om.cn',
  2001. url: '/^\\/.+/',
  2002. pager: {
  2003. nextL: 'li.next > a',
  2004. pageE: '.main_content > ul > li',
  2005. replaceE: 'ul.pagination',
  2006. scrollD: 1500
  2007. }
  2008. }, // 欧模网
  2009. xiadele: {
  2010. host: ['www.xiadele.com', 'search.xiadele.com'],
  2011. url: '/^\\/.+/',
  2012. style: '.last-li-carousel-img {display: none !important;}',
  2013. pager: {
  2014. nextL: 'li.next_page a[rel="next"]',
  2015. pageE: 'ul.list-page-ul > li',
  2016. replaceE: 'ul.pagination',
  2017. scrollD: 2000
  2018. }
  2019. }, // 下得乐
  2020. Mixkit: {
  2021. host: 'mixkit.co',
  2022. url: '/^\\/.+/',
  2023. pager: {
  2024. nextL: 'a.pagination__link--next',
  2025. pageE: '.item-grid-item',
  2026. replaceE: '.pagination__wrapper',
  2027. scrollD: 2000
  2028. }
  2029. }, // Mixkit
  2030. _3dmgame: {
  2031. host: 'www.3dmgame.com',
  2032. url: ()=> {
  2033. if (getCSS('.Llist_b > div.lis')) {
  2034. curSite = DBSite._3dmgame_list;
  2035. } else if (getCSS('.newsleft > ul')) {
  2036. curSite = DBSite._3dmgame_list2;
  2037. } else if (indexOF('/resource')) {
  2038. curSite = DBSite._3dmgame_list3;
  2039. } else {
  2040. curSite = DBSite._3dmgame;
  2041. }},
  2042. pager: {
  2043. type: 3,
  2044. nextL: 'li.next > a',
  2045. pageE: 'script[src*="common.js"], .news_warp_center > *',
  2046. insertP: ['.news_warp_center', 3],
  2047. replaceE: '.pagewrap',
  2048. scrollE: '.pagewrap',
  2049. scriptT: 2,
  2050. interval: 500,
  2051. scrollD: 500
  2052. }
  2053. }, // 3DM
  2054. _3dmgame_list: {
  2055. pager: {
  2056. nextL: 'li.next > a',
  2057. pageE: '.Llist_b > div.lis',
  2058. replaceE: '.pagewrap',
  2059. scrollD: 1000
  2060. },
  2061. function: {
  2062. bF: src_bF,
  2063. bFp: [0, 'img[data-original]', 'data-original']
  2064. }
  2065. }, // 3DM - 分类页
  2066. _3dmgame_list2: {
  2067. pager: {
  2068. nextL: 'li.next > a',
  2069. pageE: '.newsleft > ul > li',
  2070. replaceE: '.pagewrap',
  2071. scrollD: 1000
  2072. },
  2073. function: {
  2074. bF: src_bF,
  2075. bFp: [0, 'img[data-original]', 'data-original']
  2076. }
  2077. }, // 3DM - 游戏专区 - 分类页
  2078. _3dmgame_list3: {
  2079. pager: {
  2080. nextL: 'li.next > a',
  2081. pageE: '.item > ul',
  2082. insertP: ['.item > ul:last-child', 1],
  2083. replaceE: '.pagewrap',
  2084. scrollD: 800
  2085. }
  2086. }, // 3DM - 游戏专区 - 资源页
  2087. _3dmgame_mod: {
  2088. host: 'mod.3dmgame.com',
  2089. pager: {
  2090. nextL: ()=> getNextEP('//li[@class="page-list active"]/following-sibling::li[contains(@class, "page-list")]/a', 'Page=', /Page=\d+/),
  2091. 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")]',
  2092. insertP: ['//div[contains(@class, "game-mod-wrap") or contains(@class, "search-mod ")]', 3],
  2093. scriptT: 2,
  2094. scrollD: 1200
  2095. }
  2096. }, // 3DM MOD站
  2097. ali213_www: {
  2098. host: 'www.ali213.net',
  2099. pager: {
  2100. type: 3,
  2101. nextL: '#after_this_page',
  2102. pageE: '#Content >*:not(.news_ding):not(.page_fenye)',
  2103. insertP: ['.page_fenye', 1],
  2104. replaceE: '.page_fenye',
  2105. scrollE: '.page_fenye',
  2106. interval: 500,
  2107. scrollD: 100
  2108. }
  2109. }, // 游侠网
  2110. ali213_list: {
  2111. host: 'down.ali213.net',
  2112. url: ()=> {if (getCSS('.famous-ul > .famous-li')) {curSite = DBSite.ali213_list;}},
  2113. pager: {
  2114. nextL: 'a.page-next',
  2115. pageE: '.famous-ul > .famous-li',
  2116. replaceE: '.page-container',
  2117. scrollD: 1000
  2118. },
  2119. function: {
  2120. bF: src_bF,
  2121. bFp: [0, 'img[data-original]', 'data-original']
  2122. }
  2123. }, // 游侠网 - 分类页
  2124. ali213_gl: {
  2125. host: 'gl.ali213.net',
  2126. style: '.n_show_b, a.morezjjump {display: none !important;}',
  2127. pager: {
  2128. type: 3,
  2129. nextL: 'a.next',
  2130. pageE: '.c-detail > *',
  2131. insertP: ['.c-detail', 3],
  2132. replaceE: '.page_fenye',
  2133. scrollE: '.page_fenye',
  2134. interval: 500,
  2135. scrollD: 300
  2136. }
  2137. }, // 游侠网 - 攻略
  2138. ali213_pic: {
  2139. host: 'pic.ali213.net',
  2140. style: 'a.prev, a.next {display: none !important;}',
  2141. pager: {
  2142. nextL: 'a.next',
  2143. pageE: '#image-show > img',
  2144. replaceE: '#image-show > a',
  2145. scrollD: 1200
  2146. }
  2147. }, // 游侠网 - 图库
  2148. gamersky_ent: {
  2149. host: 'www.gamersky.com',
  2150. url: ()=> {if (indexOF('/ent/')) {
  2151. curSite = DBSite.gamersky_ent;
  2152. } else {
  2153. curSite = DBSite.gamersky_gl;
  2154. if (indexOF('/zl/') && indexOF('.shtml')) {curSite.pager.insertP = ['.pagecss', 1]; curSite.pager.scrollD = 400;}
  2155. }},
  2156. pager: {
  2157. type: 3,
  2158. nextL: '//div[@class="page_css"]/a[text()="下一页"]',
  2159. pageE: '.Mid2L_con > *:not(.gs_nc_editor):not(.pagecss):not(.page_css):not(.gs_ccs_solve):not(.post_ding)',
  2160. insertP: ['.page_css', 1],
  2161. replaceE: '.page_css',
  2162. scrollE: '.page_css',
  2163. interval: 500,
  2164. scrollD: 100
  2165. }
  2166. }, // 游民星空
  2167. gamersky_gl: {
  2168. pager: {
  2169. type: 3,
  2170. nextL: '//div[@class="page_css"]/a[text()="下一页"]',
  2171. pageE: '.Mid2L_con > *:not(.gs_nc_editor):not(.pagecss):not(.gs_ccs_solve):not(.post_ding)',
  2172. insertP: ['.gs_nc_editor', 1],
  2173. replaceE: '.page_css',
  2174. scrollE: '.page_css',
  2175. forceHTTPS: true,
  2176. interval: 500,
  2177. scrollD: 100
  2178. },
  2179. function: {
  2180. bF: pageE => { // 插入前函数(移除下一页底部的 "更多相关内容请关注:xxx" 文字 + 加载图片)
  2181. pageE.forEach(function (one) {if (one.tagName === 'P' && one.textContent.indexOf('更多相关内容请关注') > -1) {one.style.display = 'none';}});
  2182. return src_bF(pageE, [0, 'img[data-src]', 'data-src'])
  2183. }
  2184. }
  2185. }, // 游民星空 - 攻略
  2186. nexusmods: {
  2187. host: 'www.nexusmods.com',
  2188. url: ()=> {locationC = true; if (!(lp == '/' || indexOF(/\/mods\/\d+/))) {curSite = DBSite.nexusmods;}},
  2189. history: false,
  2190. pager: {
  2191. nextL: nexusmods_nextL,
  2192. pageE: 'ul.tiles > li',
  2193. replaceE: '.pagination',
  2194. scrollD: 4000
  2195. },
  2196. function: {
  2197. bF: nexusmods_bF
  2198. }
  2199. }, // NexusMods
  2200. bilibili_search: {
  2201. host: 'search.bilibili.com',
  2202. url: ()=> {
  2203. locationC = true;
  2204. if (lp == '/all' || lp == '/video') {
  2205. curSite = DBSite.bilibili_search;
  2206. } else if (lp == '/article') {
  2207. curSite = DBSite.bilibili_search_article;
  2208. }
  2209. },
  2210. retry: 100,
  2211. pager: {
  2212. nextL: bilibili_search_nextL,
  2213. pageE: '//ul[contains(@class, "video-list")]/li | //script[contains(text(), "window.__INITIAL_STATE__")]',
  2214. insertP: ['ul.video-list', 3],
  2215. replaceE: 'ul.pages',
  2216. scriptT: 2,
  2217. scrollD: 1000
  2218. },
  2219. function: {
  2220. bF: bilibili_search_bF,
  2221. aF: bilibili_search_aF
  2222. }
  2223. }, // B 站(Bilibili) - 搜索页 - 视频
  2224. bilibili_search_article: {
  2225. retry: 100,
  2226. pager: {
  2227. nextL: bilibili_search_nextL,
  2228. pageE: 'li.article-item',
  2229. replaceE: 'ul.pages',
  2230. //scriptT: 2,
  2231. scrollD: 1000
  2232. }
  2233. }, // B 站(Bilibili) - 搜索页 - 专栏
  2234. anime1: {
  2235. host: 'anime1.me',
  2236. url: ()=> {if (indexOF('s=', 's')) {curSite = DBSite.wp_nav_navigation;} else if (lp == '/') {curSite = DBSite.anime1;}},
  2237. history: false,
  2238. pager: {
  2239. type: 4,
  2240. nextL: ()=> { // 获取下一页内容(叠加)
  2241. let next = getCSS('a.paginate_button.next');
  2242. if (next && next.className.indexOf('disabled') === -1) {
  2243. let oldList = getCSS('#table-list > tbody').innerHTML;
  2244. if (oldList) {next.click(); pageNum.now = pageNum._now + 1; getCSS('#table-list > tbody').insertAdjacentHTML('afterbegin', oldList);}
  2245. }
  2246. },
  2247. interval: 500,
  2248. scrollD: 800
  2249. }
  2250. }, // Anime1
  2251. manben: {
  2252. host: 'www.manben.com',
  2253. url: ()=> {if (indexOF(/\/m\d+/)) {
  2254. if (getCookie('showtype') != '2') {
  2255. document.cookie='showtype=2; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 开启 [垂直阅读] 模式
  2256. location.reload(); // 刷新网页
  2257. }
  2258. curSite = DBSite.mhxqiu;
  2259. }}
  2260. }, // 漫本
  2261. haoman: {
  2262. host: ['www.haoman6.com', 'www.g-lens.com'],
  2263. url: ()=> {
  2264. if (indexOF('/chapter/')) {
  2265. curSite = DBSite.haoman;
  2266. if (location.hostname == 'www.g-lens.com') curSite.function.bFp = [0, 'img[data-echo]', 'data-echo']
  2267. } else if (indexOF('/comic/')) {
  2268. if (getCSS('.chapter__more')) getCSS('.chapter__more').click();
  2269. } else if (indexOF('/category/') || indexOF('/search')) {
  2270. curSite = DBSite.haoman_list;
  2271. }},
  2272. 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;}',
  2273. pager: {
  2274. nextL: ()=> {if (getCSS('a.rd-aside__item.j-rd-next')) return location.origin + getCSS('a.rd-aside__item.j-rd-next').getAttribute('_href')},
  2275. pageE: '.rd-article-wr > div',
  2276. replaceE: 'a.last-crumb, .rd-aside',
  2277. interval: 2000,
  2278. scrollD: 2000
  2279. },
  2280. function: {
  2281. bF: src_bF,
  2282. bFp: [0, 'img[dta-echo]', 'dta-echo']
  2283. }
  2284. }, // 好漫 6
  2285. haoman_list: {
  2286. pager: {
  2287. nextL: 'a.next',
  2288. pageE: '.cate-comic-list > div',
  2289. replaceE: '#Pagination',
  2290. scrollD: 1000
  2291. },
  2292. function: {
  2293. bF: src_bF,
  2294. bFp: [0, 'img[data-original]', 'data-original']
  2295. }
  2296. }, // 好漫 6 - 分类/搜索页
  2297. cartoonmad: {
  2298. host: ['www.cartoonmad.com','www.cartoonmad.cc'],
  2299. url: ()=> {if (indexOF('/comic/')) {
  2300. getCSS('body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child > a').href = 'javascript:void(0);'; // 清理图片上的链接
  2301. curSite = DBSite.cartoonmad;
  2302. } else if (lp != '/') {
  2303. curSite = DBSite.cartoonmad_list;
  2304. }},
  2305. 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;}',
  2306. pager: {
  2307. nextL: cartoonmad_nextL,
  2308. pageE: 'body > table > tbody > tr:nth-child(4) > td > table > tbody > tr:first-child > td:first-child img',
  2309. replaceE: 'body > table > tbody > tr:nth-child(2), body > table > tbody > tr:nth-child(5)',
  2310. scrollD: 2000
  2311. }
  2312. }, // 动漫狂
  2313. cartoonmad_list: {
  2314. pager: {
  2315. nextL: '//a[@class="pages"][contains(text(), "下一頁")]',
  2316. pageE: 'td[background="/image/content_box4.gif"]+td > table > tbody > tr',
  2317. replaceE: '//a[@class="pages"]/parent::td/parent::tr | //font[contains(text(), "目前在第")]',
  2318. scrollD: 1000
  2319. }
  2320. }, // 动漫狂 - 分类/搜索页
  2321. dongman: {
  2322. host: 'www.dongman.la',
  2323. url: ()=> {if (indexOF('/chapter/')) {
  2324. src_bF(getAllCSS('img.mdui-img-fluid[data-srcset]:not([src])'), [0, 'img[data-srcset]', 'data-srcset']);
  2325. curSite = DBSite.dongman;
  2326. } else if (indexOF('/detail/')) {
  2327. setTimeout(function(){getCSS('a#zhankai').click()}, 500)
  2328. } else if (indexOF('/manhua/')) {
  2329. curSite = DBSite.dongman_list;
  2330. }},
  2331. 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;}',
  2332. pager: {
  2333. nextL: '//footer//a[./label[text()="下一章"]]',
  2334. pageE: '.lazyBox',
  2335. insertP: ['.slick-track', 3],
  2336. replaceE: 'footer',
  2337. scrollD: 3000
  2338. },
  2339. function: {
  2340. bF: src_bF,
  2341. bFp: [0, 'img[data-srcset]', 'data-srcset']
  2342. }
  2343. }, // 动漫啦
  2344. dongman_list: {
  2345. pager: {
  2346. nextL: '//a[@class="GPageLink" and text()="下一页"]',
  2347. pageE: '.cy_list_mh > ul',
  2348. replaceE: '.NewPages',
  2349. scrollD: 2000
  2350. }
  2351. }, // 动漫啦 - 分类页
  2352. manhuacat: {
  2353. host: ['www.manhuacat.com', 'www.maofly.com'],
  2354. url: ()=> {if (indexOF(/\/manga\/\d+\/.+\.html/)) {
  2355. if (getCookie('is_pull') == 'true') { // 强制关闭 [下拉] 模式
  2356. document.cookie='is_pull=false; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 关闭 [下拉] 模式
  2357. location.reload(); // 刷新网页
  2358. }
  2359. setTimeout(manhuacat_init, 100);
  2360. curSite = DBSite.manhuacat;
  2361. } else if (indexOF('/list')) {
  2362. curSite = DBSite.manhuacat_list;
  2363. } else if (indexOF('/search') || indexOF('/update')) {
  2364. curSite = DBSite.manhuacat_search;
  2365. }},
  2366. 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;}', // 隐藏不需要的元素,调整图片
  2367. pager: {
  2368. type: 4,
  2369. nextL: manhuacat_nextL,
  2370. insertP: ['.img-content', 3],
  2371. insertE: manhuacat_insertE,
  2372. replaceE: '.comic-detail > .breadcrumb-bar, .comic-detail >h2.h4, .vg-r-data, body > script:not([src])',
  2373. interval: 2000,
  2374. scrollD: 3000
  2375. }
  2376. }, // 漫画猫
  2377. manhuacat_list: {
  2378. pager: {
  2379. nextL: '//div[contains(@class, "pagination")]//a[contains(text(), "下一页") or contains(text(), "下页")]',
  2380. pageE: '.comic-main-section > *',
  2381. replaceE: '.pagination',
  2382. scrollD: 1000
  2383. },
  2384. function: {
  2385. bF: src_bF,
  2386. bFp: [0, 'img[data-original]', 'data-original']
  2387. }
  2388. }, // 漫画猫 - 分类页
  2389. manhuacat_search: {
  2390. pager: {
  2391. nextL: '//div[contains(@class, "pagination")]//a[contains(text(), "下一页") or contains(text(), "下页")]',
  2392. pageE: '.comic-main-section .row > div',
  2393. replaceE: '.pagination',
  2394. scrollD: 1000
  2395. }
  2396. }, // 漫画猫 - 搜索页
  2397. manhuatai: {
  2398. host: 'www.manhuatai.net',
  2399. url: ()=> {if (indexOF('/manhua/')) {
  2400. curSite = DBSite.manhuatai;
  2401. } else if (indexOF('/fenlei_') || indexOF('/top_')) {
  2402. curSite = DBSite.manhuatai_list;
  2403. } else if (indexOF('/search')) {
  2404. curSite = DBSite.manhuatai_search;
  2405. }},
  2406. pager: {
  2407. nextL: '//div[contains(@class, "page")]//a[@href][contains(text(), "下一页") or contains(text(), "下一章")]',
  2408. pageE: '#htmlContent p.img > img',
  2409. replaceE: '.page, .title',
  2410. scrollD: 2000
  2411. }
  2412. }, // 漫画台
  2413. manhuatai_list: {
  2414. pager: {
  2415. nextL: '#pagelink a.next',
  2416. pageE: '.article-list',
  2417. replaceE: '#pagelink',
  2418. scrollD: 1500
  2419. }
  2420. }, // 漫画台 - 分类页
  2421. manhuatai_search: {
  2422. pager: {
  2423. nextL: '#pagelink a.next',
  2424. pageE: '#content > table > tbody > tr:not([align])',
  2425. replaceE: '#pagelink',
  2426. scrollD: 1500
  2427. }
  2428. }, // 漫画台 - 搜索页
  2429. manhuapi: {
  2430. host: 'www.manhuapi.com',
  2431. url: ()=> {if (indexOF('/chapter/')) {
  2432. curSite = DBSite.manhuapi;
  2433. } else if (!indexOF(/\/manhua\/\d+\.html/)) {
  2434. curSite = DBSite.manhuapi_list;
  2435. }},
  2436. pager: {
  2437. nextL: '//div[@class="page"]/a[text()="下一页" or text()="下一章"]',
  2438. pageE: '.mh_list img[src]',
  2439. replaceE: '.page',
  2440. scrollD: 2000
  2441. }
  2442. }, // 漫画皮
  2443. manhuapi_list: {
  2444. pager: {
  2445. nextL: '//div[@class="pages"]/a[text()="下一页"]',
  2446. pageE: '.cy_list_mh > ul',
  2447. replaceE: '.pages',
  2448. scrollD: 1500
  2449. }
  2450. }, // 漫画皮 - 分类页
  2451. imanhuaw: {
  2452. host: ['www.imanhuaw.net', 'www.imanhuaw.com', 'www.ccshwy.com'],
  2453. url: ()=> {
  2454. if (getCSS('.mh-search-result')) {
  2455. curSite = DBSite.imanhuaw_list;
  2456. } else if (getCSS('a#zhankai')) {
  2457. getCSS('a#zhankai').click();
  2458. } else if (indexOF(/\/\d{3,}\.html/)) {
  2459. curSite = DBSite.imanhuaw; imanhuaw_init();
  2460. }
  2461. },
  2462. 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;}',
  2463. pager: {
  2464. type: 4,
  2465. nextL: imanhuaw_nextL,
  2466. insertP: ['#qTcms_Pic_middle img:last-of-type', 4],
  2467. insertE: imanhuaw_insertE,
  2468. replaceE: '.title h2',
  2469. interval: 2000,
  2470. scrollD: 3000
  2471. }
  2472. }, // 爱漫画 + 188漫画网
  2473. imanhuaw_list: {
  2474. pager: {
  2475. nextL: '//div[@class="NewPages"]//a[text()="下一页"]',
  2476. pageE: 'ul.mh-search-list > li',
  2477. replaceE: '.NewPages',
  2478. scrollD: 1500
  2479. }
  2480. }, // 爱漫画 - 分类页
  2481. manhuagui: {
  2482. host: ['www.mhgui.com', 'tw.mhgui.com', 'www.manhuagui.com', 'tw.manhuagui.com'],
  2483. url: ()=> {if (indexOF(/\/comic\/\d+\/\d+\.html/)) {
  2484. if (!getXpath('//li[@class="pfunc"]/a[@class="current"][text()="双击" or text()="雙擊"]')) getXpath('//li[@class="pfunc"]/a[text()="双击" or text()="雙擊"]').click();
  2485. pausePage = false;
  2486. setTimeout(manhuagui_init, 100);
  2487. curSite = DBSite.manhuagui;
  2488. } else if (indexOF('list/') || indexOF('/s/')) {
  2489. curSite = DBSite.manhuagui_list;
  2490. }},
  2491. 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;}',
  2492. pager: {
  2493. type: 4,
  2494. nextL: manhuagui_nextL,
  2495. pageE: 'body > script:not([src])',
  2496. insertP: ['#mangaBox', 3],
  2497. insertE: manhuagui_insertE,
  2498. replaceE: 'title',
  2499. interval: 4000,
  2500. scrollD: 2500
  2501. }
  2502. }, // 漫画柜
  2503. manhuagui_list: {
  2504. pager: {
  2505. nextL: '//div[@class="pager"]/a[text()="下一页" or text()="下一頁"]',
  2506. pageE: '.book-result > ul > li, .book-list > ul > li',
  2507. insertP: ['.book-result > ul, .book-list > ul', 3],
  2508. replaceE: '.pager',
  2509. scrollD: 1500
  2510. },
  2511. function: {
  2512. bF: src_bF,
  2513. bFp: [0, 'img[data-src]', 'data-src']
  2514. }
  2515. }, // 漫画台 - 分类/搜索页
  2516. _36manga: {
  2517. host: ['36manga.com', 'www.36manga.com', '36manhua.com', 'www.36manhua.com'],
  2518. url: ()=> {if (indexOF(/\/manhua\/.+\/\d+\.html/)) {
  2519. if (localStorage.getItem('chapterScroll') != '"pagination"') {
  2520. localStorage.setItem('chapterScroll', '"pagination"'); location.reload()
  2521. } else {
  2522. pausePage = false;
  2523. setTimeout(_36manga_init, 100);
  2524. curSite = DBSite._36manga;
  2525. }
  2526. } else if (indexOF('list/') || indexOF('/search/')) {
  2527. curSite = DBSite._36manga_list;
  2528. }},
  2529. 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;}',
  2530. pager: {
  2531. type: 4,
  2532. nextL: _36manga_nextL,
  2533. pageE: '//body/script[contains(text(), "chapterImages")]',
  2534. insertP: ['#images', 3],
  2535. insertE: _36manga_insertE,
  2536. replaceE: '.title',
  2537. interval: 4000,
  2538. scrollD: 2500
  2539. }
  2540. }, // 36漫画
  2541. _36manga_list: {
  2542. pager: {
  2543. nextL: 'ul.pagination li.next a',
  2544. pageE: '#contList',
  2545. replaceE: 'ul.pagination',
  2546. scrollD: 1500
  2547. }
  2548. }, // 36漫画 - 分类/搜索页
  2549. manhuadb: {
  2550. host: 'www.manhuadb.com',
  2551. url: ()=> {if (indexOF(/\/manhua\/\d+\/.+\.html/)) {
  2552. if (getCSS('img.img-fluid.show-pic')) getCSS('img.img-fluid.show-pic').style.display = 'none'; // 隐藏第一个图片(避免重复)
  2553. setTimeout(manhuadb_init, 100);
  2554. curSite = DBSite.manhuadb;
  2555. } else if (indexOF('/list')) {
  2556. curSite = DBSite.manhuacat_list;
  2557. } else if (indexOF('/search') || indexOF('/update')) {
  2558. curSite = DBSite.manhuacat_search;
  2559. }},
  2560. style: '.row.m-0.pt-3.ad_2_wrap, .row.m-0.ad_1_wrap, .pagination.justify-content-center, #left, #right {display: none !important;}',
  2561. pager: {
  2562. type: 4,
  2563. nextL: manhuadb_nextL,
  2564. pageE: 'body > script:not([type]):not([src]), .vg-r-data, ol.links-of-books.num_div',
  2565. insertP: ['.pjax-container', 3],
  2566. insertE: manhuadb_insertE,
  2567. interval: 5000,
  2568. scrollD: 3000
  2569. }
  2570. }, // 漫画 DB
  2571. hicomic: {
  2572. host: 'www.hicomic.net',
  2573. url: ()=> {if (indexOF('/chapters/')) {
  2574. setTimeout(hicomic_init, 100);
  2575. curSite = DBSite.hicomic;
  2576. }},
  2577. style: '.content {height: auto !important;} .footer, .left_cursor, .right_cursor, .finish {display: none !important;} .content > img {display: block !important;margin: 0 auto !important;}',
  2578. pager: {
  2579. type: 4,
  2580. nextL: hicomic_nextL,
  2581. insertP: ['.content', 3],
  2582. insertE: hicomic_insertE,
  2583. interval: 5000,
  2584. scrollD: 3000
  2585. }
  2586. }, // HiComic (嗨漫画)
  2587. dmzj: {
  2588. host: 'www.dmzj.com',
  2589. url: ()=> {if (indexOF('/view/')) {
  2590. if (getCookie('display_mode') != '1') { // 强制开启 [上下滚动阅读] 模式
  2591. document.cookie='display_mode=1; expires=Thu, 18 Dec 2031 12:00:00 GMT; path=/'; // 写入 Cookie 开启 [上下滚动阅读] 模式
  2592. location.reload(); // 刷新网页
  2593. }
  2594. setTimeout(function() {dmzj_init('.comic_wraCon > a > img')}, 100);
  2595. curSite = DBSite.dmzj;
  2596. } else if (indexOF('/category') || indexOF('/update')) {
  2597. curSite = DBSite.dmzj_list;
  2598. } else if (indexOF('/rank')) {
  2599. curSite = DBSite.dmzj_rank;
  2600. }},
  2601. 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;}', // 隐藏中间的页数信息
  2602. pager: {
  2603. type: 4,
  2604. nextL: 'span.next > a',
  2605. insertP: ['.comic_wraCon', 3],
  2606. insertE: dmzj_insertE,
  2607. replaceE: '.wrap_last_mid, .wrap_last_head',
  2608. interval: 2000,
  2609. scrollD: 3000
  2610. }
  2611. }, // 动漫之家 - 原创
  2612. dmzj_list: {
  2613. style: '.wrap_mhlist_l.con_left, .wrap_list {height: auto!important;}',
  2614. pager: {
  2615. nextL: 'a.pg_next',
  2616. pageE: 'ul.list_con_li > li',
  2617. replaceE: '.page',
  2618. scrollD: 1000
  2619. }
  2620. }, // 动漫之家 - 原创 - 分类页
  2621. dmzj_rank: {
  2622. style: '.wrap_mhlist_l.con_left {height: auto!important;}',
  2623. pager: {
  2624. nextL: 'a.pg_next',
  2625. pageE: '.ph_r_con_li > div:not(.ad_column)',
  2626. replaceE: '.page',
  2627. scrollD: 1000
  2628. }
  2629. }, // 动漫之家 - 原创 - 排行榜
  2630. dmzj_manhua: {
  2631. host: 'manhua.dmzj.com',
  2632. url: ()=> {if (indexOF(/\/\d+\.shtml/)) {
  2633. let chapterScroll = getCSS('#qiehuan_txt') // 强制为 [上下滚动阅读] 模式
  2634. if (chapterScroll && chapterScroll.textContent === '切换到上下滚动阅读') {chapterScroll.click();}
  2635. setTimeout(function() {dmzj_init('#center_box > .inner_img img[src]')}, 100);
  2636. curSite = DBSite.dmzj_manhua;
  2637. /*} else if (indexOF('/tags/')) {
  2638. curSite = DBSite.dmzj_manhua_list;*/
  2639. } else if (indexOF('/update')) {
  2640. curSite = DBSite.dmzj_manhua_update;
  2641. }},
  2642. 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;}', // 隐藏中间的页数信息
  2643. pager: {
  2644. type: 4,
  2645. nextL: '#next_chapter',
  2646. insertP: ['#center_box', 3],
  2647. insertE: dmzj_manhua_insertE,
  2648. replaceE: '.display_graybg',
  2649. interval: 2000,
  2650. scrollD: 3000
  2651. }
  2652. }, // 动漫之家 - 日漫
  2653. /*dmzj_manhua_list: {
  2654. pager: {
  2655. nextL: ()=> getNextUPN(/(?<=-)\d+(?=\.shtml)/, /-\d+\.shtml/, '-', '.shtml', '2', getCSS('#topage > option:last-child').value),
  2656. pageE: '#search_list_div ul',
  2657. scrollD: 1500
  2658. }
  2659. },*/ // 动漫之家 - 日漫 - 分类页
  2660. dmzj_manhua_update: {
  2661. pager: {
  2662. nextL: '//div[@class="pages"]/a[contains(text(), "下一页")]',
  2663. pageE: '.newpic_content > *:not(.pages)',
  2664. replaceE: '.pages',
  2665. scrollD: 1000
  2666. }
  2667. }, //动漫之家 - 日漫 - 最新更新
  2668. acgn: {
  2669. host: 'comic.acgn.cc',
  2670. url: ()=> {
  2671. if (indexOF('/view-')) {
  2672. curSite = DBSite.acgn;
  2673. acgn_aF();
  2674. } else if (indexOF('/cate-') || indexOF('/pinyin-')) {
  2675. curSite = DBSite.acgn_list;
  2676. }
  2677. },
  2678. style: '.img1 {cursor: initial !important;}',
  2679. pager: {
  2680. nextL: '#next_chapter',
  2681. pageE: '.pic[_src]',
  2682. replaceE: '[class^="display_"]',
  2683. interval: 2000,
  2684. scrollD: 2000
  2685. },
  2686. function: {
  2687. aF: acgn_aF
  2688. }
  2689. }, // 动漫戏说
  2690. acgn_list: {
  2691. pager: {
  2692. nextL: 'a[rel="next"]',
  2693. pageE: 'ul#display > li',
  2694. replaceE: '#pagination',
  2695. scrollD: 1000
  2696. }
  2697. }, // 动漫戏说 - 分类页
  2698. ykmh: {
  2699. host: 'www.ykmh.com',
  2700. url: ()=> {if (indexOF(/\/\d+\.html/)) {
  2701. let chapterScroll = getCSS('#qiehuan_txt') // 强制为 [上下滚动阅读] 模式
  2702. if (localStorage.getItem('chapterScroll') != '"scroll"') {
  2703. localStorage.setItem('chapterScroll', '"scroll"'); location.reload()
  2704. } else {
  2705. setTimeout(ykmh_init, 100);
  2706. curSite = DBSite.ykmh;
  2707. }
  2708. } else if (indexOF('/list') || indexOF('/search')) {
  2709. curSite = DBSite.ykmh_list;
  2710. }},
  2711. 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;}',
  2712. pager: {
  2713. type: 4,
  2714. nextL: ykmh_nextL,
  2715. insertP: ['#images', 3],
  2716. insertE: ykmh_insertE,
  2717. replaceE: '.head_title, span.head_wz',
  2718. interval: 2000,
  2719. scrollD: 3000
  2720. }
  2721. }, // 优酷漫画
  2722. ykmh_list: {
  2723. pager: {
  2724. nextL: 'li.next > a',
  2725. pageE: 'li.list-comic',
  2726. replaceE: 'ul.pagination',
  2727. scrollD: 1000
  2728. }
  2729. }, // 优酷漫画 - 分类页
  2730. copymanga: {
  2731. host: /copymanga\./,
  2732. url: ()=> {if (indexOF('/chapter/')) {
  2733. curSite = DBSite.copymanga;
  2734. } else if (indexOF('/comics')) {
  2735. curSite = DBSite.copymanga_list;
  2736. }},
  2737. style: '.upMember, .comicContainerAds, .footer {display: none !important;} body, html {height: auto !important;}',
  2738. iframe: true,
  2739. pager: {
  2740. type: 5,
  2741. nextL: '.comicContent-next > a',
  2742. style: 'h4.header, h4.header +div[style*="fixed"] {display: none !important;}',
  2743. scrollD: 3000
  2744. }
  2745. }, // 拷贝漫画
  2746. copymanga_list: {
  2747. pager: {
  2748. nextL: 'li.next > a',
  2749. pageE: '.exemptComic-box > div',
  2750. replaceE: 'ul.page-all',
  2751. scrollD: 1500
  2752. },
  2753. function: {
  2754. bF: src_bF,
  2755. bFp: [0, 'img[data-src]', 'data-src']
  2756. }
  2757. }, // 拷贝漫画 - 分类页
  2758. mhxqiu: {
  2759. host: /\.mhxqiu/,
  2760. url: ()=> {if (indexOF(/\/\d+\.html/)) { // 阅读页
  2761. curSite = DBSite.mhxqiu;
  2762. } else if (indexOF(/\/\d+\/$/)) { // 目录页
  2763. setTimeout(function(){if (getCSS('#zhankai')) getCSS('#zhankai').click();}, 500)
  2764. } else if (indexOF(/\/(sort|rank)\//)) { // 分类页
  2765. curSite = DBSite.mhxqiu_list;
  2766. }},
  2767. 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;}',
  2768. pager: {
  2769. type: 4,
  2770. nextL: '#mainControlNext',
  2771. insertP: ['#comicContain', 3],
  2772. insertE: mhxqiu_insertE,
  2773. replaceE: '.main_control, h1.chaptername_title, span.title-comicHeading',
  2774. interval: 4000,
  2775. scrollD: 3000
  2776. }
  2777. }, // 漫画星球
  2778. mhxqiu_list: {
  2779. pager: {
  2780. nextL: '//div[@class="NewPages"]//a[contains(text(), "下一页")]',
  2781. pageE: '.cy_list_mh > ul',
  2782. replaceE: '.NewPages',
  2783. scrollD: 1000
  2784. }
  2785. }, // 漫画星球 - 分类页
  2786. fffdm: {
  2787. host: 'manhua.fffdm.com',
  2788. url: ()=> {if (location.pathname.split('/').length === 4) {curSite = DBSite.fffdm;}},
  2789. style: '#footer, #header {display: none !important;} #mhimg0 img {display: block !important;margin: 0 auto !important;}',
  2790. pager: {
  2791. type: 4,
  2792. nextL: '//a[contains(text(), "下一页") or contains(text(), "下一頁") or contains(text(), "下一话") or contains(text(), "下一話")]',
  2793. insertP: ['#mhimg0', 3],
  2794. insertE: fffdm_insertE,
  2795. replaceE: '.navigation, #weizhi, h1',
  2796. scrollD: 2000
  2797. }
  2798. }, // 风之动漫
  2799. baozimh: {
  2800. host: ['www.webmota.com', 'cn.webmota.com', 'cn.baozimh.com'],
  2801. url: ()=> {
  2802. if (indexOF('/chapter/')) {
  2803. curSite = DBSite.baozimh;
  2804. } else if (indexOF('/comic/')) {
  2805. if (getCSS('#button_show_all_chatper')) getCSS('#button_show_all_chatper').click();
  2806. }},
  2807. style: '#footer, #header {display: none !important;} .header, .bottom-bar {opacity: 0.3;}',
  2808. pager: {
  2809. nextL: '.next_chapter > a',
  2810. pageE: '.comic-contain > amp-img',
  2811. replaceE: '.next_chapter, .bottom-bar, .header .title',
  2812. scrollD: 2000
  2813. }
  2814. }, // 包子漫画
  2815. leyuman: {
  2816. host: 'www.leyuman.com',
  2817. url: ()=> {if (indexOF(/\/comic\/\d+\/\d+\.html/)) {
  2818. curSite = DBSite.leyuman;
  2819. setTimeout(leyuman_init, 100);
  2820. } else if (indexOF(/\/comic\/\d+\.html/)) {
  2821. setTimeout(function(){if (getCSS('#read-more')) getCSS('#read-more').click();}, 500)
  2822. } else {
  2823. curSite = DBSite.leyuman_list;
  2824. }},
  2825. style: '.mh_select, .mh_comicpic > p, mh_headpager {display: none !important;} .mh_comicpic > img{width: 100% !important; height: auto !important;}',
  2826. pager: {
  2827. type: 4,
  2828. nextL: '#xurl',
  2829. insertP: ['.mh_comicpic', 3],
  2830. insertE: leyuman_insertE,
  2831. replaceE: '.mh_headpager, .mh_readtitle',
  2832. interval: 3000,
  2833. scrollD: 3000
  2834. }
  2835. }, // 乐语漫画
  2836. leyuman_list: {
  2837. pager: {
  2838. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  2839. pageE: '.works_recommend.classification_works > ul',
  2840. replaceE: '.paging',
  2841. scrollD: 1000
  2842. },
  2843. function: {
  2844. bF: src_bF,
  2845. bFp: [0, 'img[data-src]', 'data-src']
  2846. }
  2847. }, // 乐语漫画 - 分类页
  2848. _77mh: {
  2849. host: 'www.77mh.cc',
  2850. url: ()=> {if (indexOF(/\/\d+\.html/)) {
  2851. curSite = DBSite._77mh;
  2852. setTimeout(_77mh_init, 100);
  2853. } else if (indexOF('/colist_')) {
  2854. setTimeout(function(){if (getCSS('#listmore1, .listmore')) getCSS('#listmore1, .listmore').click();}, 500)
  2855. } else {
  2856. curSite = DBSite._77mh_list;
  2857. }},
  2858. 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;}',
  2859. pager: {
  2860. type: 4,
  2861. nextL: _77mh_nextL,
  2862. insertP: ['#comicImg', 3],
  2863. insertE: _77mh_insertE,
  2864. interval: 3000,
  2865. scrollD: 2000
  2866. }
  2867. }, // 新新漫画
  2868. _77mh_list: {
  2869. pager: {
  2870. nextL: '//div[@class="pages_s"]/a[text()="下一页"]',
  2871. pageE: '.ar_list_co > ul > li',
  2872. replaceE: '.pages_s',
  2873. scrollD: 1000
  2874. }
  2875. }, // 新新漫画 - 分类页
  2876. _77mh_search: {
  2877. host: 'so.77mh.cc',
  2878. pager: {
  2879. nextL: 'a.next',
  2880. pageE: '.ar_list_co > ul > dl',
  2881. replaceE: '.pages_s',
  2882. scrollD: 1000
  2883. }
  2884. }, // 新新漫画 - 搜索页
  2885. gufengmh: {
  2886. host: /gufengmh/,
  2887. url: ()=> {if (indexOF(/\/\d+.+\.html/)) {
  2888. let chapterScroll = getCSS('#chapter-scroll') // 强制为 [下拉阅读] 模式
  2889. if (chapterScroll && chapterScroll.className === '') {chapterScroll.click();}
  2890. curSite = DBSite.gufengmh;
  2891. } else if (indexOF(/\/(update|list|search)/)) {
  2892. curSite = DBSite.gufengmh_list;
  2893. }},
  2894. style: 'p.img_info {display: none !important;}', // 隐藏中间的页数信息
  2895. pager: {
  2896. type: 4,
  2897. nextL: gufengmh_nextL,
  2898. pageE: 'body > script:first-child',
  2899. insertP: ['#images', 3],
  2900. insertE: gufengmh_insertE,
  2901. interval: 5000,
  2902. scrollD: 4000
  2903. }
  2904. }, // 古风漫画网
  2905. gufengmh_list: {
  2906. pager: {
  2907. nextL: 'li.next > a',
  2908. pageE: 'ul.book-list > li',
  2909. replaceE: 'ul.pagination',
  2910. scrollD: 1000
  2911. }
  2912. }, // 古风漫画网 - 分类页
  2913. szcdmj: {
  2914. host: 'www.szcdmj.com',
  2915. url: ()=> {
  2916. if (indexOF('/szcchapter/')) {
  2917. curSite = DBSite.szcdmj;
  2918. } else if (indexOF('/szcbook/')) {
  2919. if (getCSS('#detail-list-more')) getCSS('#detail-list-more').click();
  2920. } else if (lp == '/szcbolist' || lp == '/update') {
  2921. curSite = DBSite.szcdmj_list;
  2922. }},
  2923. style: '.header {opacity: 0.3 !important;}',
  2924. pager: {
  2925. nextL: '//div[@class="fanye"][1]/a[@href][text()="下一页" or text()="下一话"]',
  2926. pageE: '.comicpage > div',
  2927. insertP: ['.comicpage', 3],
  2928. replaceE: '.fanye,h1.title',
  2929. scrollD: 2000
  2930. },
  2931. function: {
  2932. bF: src_bF,
  2933. bFp: [0, 'img[data-original]', 'data-original']
  2934. }
  2935. }, // 砂之船动漫家
  2936. szcdmj_list: {
  2937. pager: {
  2938. nextL: '#nextPage',
  2939. pageE: 'ul.mh-list > li',
  2940. replaceE: '.pagination',
  2941. scrollD: 1000
  2942. }
  2943. }, // 砂之船动漫家 - 分类/搜索页
  2944. mangabz: {
  2945. host: ['mangabz.com', 'www.mangabz.com'],
  2946. url: ()=> {if (indexOF(/\/m\d+/)) {
  2947. setTimeout(mangabz_init, 1500);
  2948. curSite = DBSite.mangabz;
  2949. } else if (indexOF(/\/\d+bz\//)) {
  2950. if (getCSS('.detail-list-form-more')) getCSS('.detail-list-form-more').click();
  2951. } else if (indexOF('/manga-list') || lp == '/search') {
  2952. curSite = DBSite.mangabz_list;
  2953. }},
  2954. 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;}',
  2955. pager: {
  2956. type: 4,
  2957. nextL: mangabz_nextL,
  2958. insertP: ['#cp_img', 3],
  2959. insertE: mangabz_insertE,
  2960. replaceE: 'p.top-title, body > .container > div:not([id])',
  2961. interval: 500,
  2962. scrollD: 2000
  2963. }
  2964. }, // Mangabz 漫画
  2965. mangabz_list: {
  2966. pager: {
  2967. nextL: '//div[contains(@class,"page-pagination")]//a[contains(text(), ">")]',
  2968. pageE: 'ul.mh-list > li',
  2969. replaceE: '.page-pagination',
  2970. scrollD: 800
  2971. }
  2972. }, // Mangabz 漫画 - 分类/搜索页
  2973. dm5: {
  2974. host: 'www.dm5.com',
  2975. url: ()=> {if (indexOF(/\/m\d+/)) {
  2976. setTimeout(mangabz_init, 1500);
  2977. curSite = DBSite.dm5;
  2978. } else if (indexOF('/manga-list') || lp == '/search' || getCSS('.box-body > ul.mh-list > li')) {
  2979. curSite = DBSite.mangabz_list;
  2980. } else if (getCSS('.detail-more')) {
  2981. getCSS('.detail-more').click();
  2982. }},
  2983. 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;}',
  2984. pager: {
  2985. type: 4,
  2986. nextL: dm5_nextL,
  2987. insertP: ['#cp_img', 3],
  2988. insertE: dm5_insertE,
  2989. replaceE: '.view-paging > .container, .rightToolBar',
  2990. interval: 500,
  2991. scrollD: 2000
  2992. }
  2993. }, // 动漫屋
  2994. xmanhua: {
  2995. host: ['xmanhua.com', 'www.xmanhua.com'],
  2996. url: ()=> {if (indexOF(/\/m\d+/)) {
  2997. setTimeout(mangabz_init, 1500);
  2998. curSite = DBSite.xmanhua;
  2999. } else if (indexOF(/\/\d+xm\//)) {
  3000. if (getCSS('.detail-list-form-more')) getCSS('.detail-list-form-more').click();
  3001. } else if (indexOF('/manga-list') || lp == '/search') {
  3002. curSite = DBSite.xmanhua_list;
  3003. }},
  3004. 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;}',
  3005. hiddenPN: true,
  3006. pager: {
  3007. type: 4,
  3008. nextL: xmanhua_nextL,
  3009. insertP: ['#cp_img', 3],
  3010. insertE: xmanhua_insertE,
  3011. replaceE: '.reader-title, body > .container > div:not([id])',
  3012. interval: 500,
  3013. scrollD: 2500
  3014. }
  3015. }, // Xmanhua 漫画
  3016. xmanhua_list: {
  3017. pager: {
  3018. nextL: '//div[@class="page-pagination"]//a[contains(text(), ">")]',
  3019. pageE: 'ul.mh-list > li',
  3020. replaceE: '.page-pagination',
  3021. scrollD: 1000
  3022. }
  3023. }, // Xmanhua 漫画 - 分类/搜索页
  3024. cocomanga: {
  3025. host: 'www.cocomanga.com',
  3026. url: ()=> {if (indexOF('.html')) {
  3027. if (!(getCookie('mh_readmode') === '' || getCookie('mh_readmode') === '3')) {
  3028. document.cookie='mh_readmode=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/'; // 强制开启自带的无缝翻页功能
  3029. location.reload(); // 刷新网页
  3030. }
  3031. setTimeout(cocomanga_init, 500);
  3032. curSite = DBSite.cocomanga;
  3033. } else if (indexOF(/\/\d+\/$/)) {
  3034. setTimeout(function(){if (getCSS('a.website-display-all')) getCSS('a.website-display-all').click();}, 300)
  3035. } else if (lp == '/show') {
  3036. curSite = DBSite.cocomanga_list;
  3037. } else if (lp == '/search') {
  3038. curSite = DBSite.cocomanga_search;
  3039. }},
  3040. style: '.mh_readend, .mh_footpager, .mh_readmode {display: none !important;} .mh_comicpic img {cursor: unset !important;} .mh_comicpic img {min-height: 150px;}',
  3041. pager: {
  3042. type: 4,
  3043. nextL: '//a[contains(@class, "read_page_link") and contains(string(), "下一章")][not(contains(@href, "javascript"))]',
  3044. insertP: ['#mangalist', 3],
  3045. insertE: cocomanga_insertE,
  3046. replaceE: '.mh_readtitle, .mh_headpager > a.mh_prevbook, .mh_readend',
  3047. interval: 1000,
  3048. scrollD: 2500
  3049. }
  3050. }, // COCOMANGA 漫画
  3051. cocomanga_list: {
  3052. pager: {
  3053. nextL: ()=> getNextEP('.fed-page-info a.fed-btns-green+a[onclick]', 'page=', /page=\d+/),
  3054. pageE: 'ul.fed-list-info > li',
  3055. replaceE: '.fed-page-info',
  3056. scrollD: 1000
  3057. },
  3058. function: {
  3059. bF: src_bF,
  3060. bFp: [1, 'a[data-original]', 'data-original']
  3061. }
  3062. }, // COCOMANGA 漫画 - 分类页
  3063. cocomanga_search: {
  3064. pager: {
  3065. nextL: ()=> getNextEP('.fed-page-info a.fed-btns-green+a[onclick]', 'page=', /page=\d+/),
  3066. pageE: 'dl.fed-deta-info',
  3067. replaceE: '.fed-page-info',
  3068. scrollD: 1000
  3069. },
  3070. function: {
  3071. bF: src_bF,
  3072. bFp: [1, 'a[data-original]', 'data-original']
  3073. }
  3074. }, // COCOMANGA 漫画 - 搜索页
  3075. acs: {
  3076. host: ['pubs.acs.org','onlinelibrary.wiley.com'],
  3077. url: ()=> {if (indexOF('/doSearch')) {curSite = DBSite.acs;}},
  3078. pager: {
  3079. nextL: 'a.pagination__btn--next',
  3080. pageE: 'ul.items-results > *',
  3081. replaceE: '.pagination',
  3082. scrollD: 3000
  3083. }
  3084. }, // Wiley Online Library + ACS (Publications)
  3085. libgen: {
  3086. host: /libgen/,
  3087. url: ()=> {if (lp == '/search.php') {curSite = DBSite.libgen;}},
  3088. pager: {
  3089. nextL: '//font/a[contains(text(), "►")]',
  3090. pageE: 'table[rules="rows"] > tbody > tr:nth-of-type(n+2), .paginator+script:not([src])',
  3091. insertP: ['table[rules="rows"] > tbody', 3],
  3092. replaceE: '//td[./font/a[contains(text(), "►")]]',
  3093. scriptT: 2,
  3094. scrollD: 2000
  3095. }
  3096. }, // Library Genesis
  3097. sciencedirect: {
  3098. host: 'www.sciencedirect.com',
  3099. url: ()=> {locationC = true; if (lp == '/search') {curSite = DBSite.sciencedirect; setTimeout(function(){insStyle('html, body {height: ' + (document.documentElement.scrollHeight || document.body.scrollHeight) + 'px;}')}, 2000)}},
  3100. style: 'footer {display: none !important;}',
  3101. iframe: true,
  3102. pager: {
  3103. type: 5,
  3104. nextL: 'a[data-aa-name="srp-next-page"]',
  3105. scrollD: 2000
  3106. }
  3107. }, // ScienceDirect
  3108. Z_Library: {
  3109. host: /(\dlib|b-ok\d?|booksc|z-lib)\./,
  3110. url: ()=> {if (indexOF('/s/')) {curSite = DBSite.Z_Library;}},
  3111. pager: {
  3112. nextL: '//div[@class="paginator"]//span/strong/parent::span/parent::td/following-sibling::td[1]//a',
  3113. pageE: 'id("searchResultBox")/div | //script[contains(string(), "pagerOptions")]',
  3114. insertP: ['#searchResultBox', 3],
  3115. replaceE: '.paginator',
  3116. scriptT: 2,
  3117. scrollD: 2000
  3118. },
  3119. function: {
  3120. bF: src_bF,
  3121. bFp: [0, 'img[data-src]', 'data-src']
  3122. }
  3123. }, // Z-Library
  3124. pubmed: {
  3125. host: 'pubmed.ncbi.nlm.nih.gov',
  3126. pager: {
  3127. type: 2,
  3128. nextL: 'button.load-button.next-page',
  3129. nextText: 'Show more results',
  3130. scrollD: 1500
  3131. }
  3132. }, // PubMed
  3133. x_mol: {
  3134. host: 'www.x-mol.com',
  3135. url: ()=> {if (indexOF('/search/q') || indexOF('/paper/')) {curSite = DBSite.x_mol;}},
  3136. pager: {
  3137. nextL: ()=> getNextEP('.pagination li.active+li > a', 'pageIndex=', /pageIndex=\d+/),
  3138. pageE: '.magazine-senior-search-results-list > ul > li, .magazine-model-content-new > ul > li',
  3139. insertP: ['.magazine-senior-search-results-list > ul, .magazine-model-content-new > ul', 3],
  3140. replaceE: '.pagination',
  3141. scrollD: 2000
  3142. }
  3143. }, // X-MOL
  3144. cqvip: {
  3145. host: 'www.cqvip.com',
  3146. url: ()=> {if (indexOF('/search')) {curSite = DBSite.cqvip;}},
  3147. pager: {
  3148. type: 6,
  3149. nextL: '//ul[@class="pagenum"]//a[text()="下一页"]',
  3150. pageE: 'ul.prolist:last-child > li',
  3151. replaceE: 'ul.pagenum',
  3152. loadTime: 1000,
  3153. scrollD: 2000
  3154. }
  3155. }, // 维普网
  3156. ablesci: {
  3157. host: 'www.ablesci.com',
  3158. url: ()=> {if (indexOF('/detail')) {curSite = DBSite.ablesci_p;} else if (getCSS('ul.fly-list')) {curSite = DBSite.ablesci;}},
  3159. pager: {
  3160. nextL: 'li.next > a',
  3161. pageE: 'ul.fly-list > li',
  3162. replaceE: '.pages',
  3163. scrollD: 2000
  3164. }
  3165. }, // 科研通
  3166. ablesci_p: {
  3167. thread: true,
  3168. pager: {
  3169. nextL: 'li.next > a',
  3170. pageE: 'ul#jieda > li',
  3171. replaceE: '.pages',
  3172. scrollD: 2000
  3173. }
  3174. }, // 科研通 - 帖子内
  3175. coolkeyan: {
  3176. host: 'www.coolkeyan.com',
  3177. url: ()=> {if (location.hash.indexOf('/project/') > -1) curSite = DBSite.coolkeyan;},
  3178. style: '.q-img {height: auto !important;} .q-img__image {max-height: 1000px !important;} .row.q-my-sm.q-gutter-sm {display: none !important;}',
  3179. pager: {
  3180. type: 4,
  3181. nextL: coolkeyan_nextL,
  3182. insertP: ['//div[contains(@class, "q-img__image")][last()]', 4],
  3183. insertE: coolkeyan_insertE,
  3184. scrollD: 1500
  3185. }
  3186. }, // 酷科研
  3187. muchong: {
  3188. host: 'muchong.com',
  3189. url: ()=> {if (indexOF('/f-') || indexOF('search.php')) {
  3190. curSite = DBSite.muchong;
  3191. } else if (indexOF('/t-')) {
  3192. curSite = DBSite.muchong; curSite.pager.pageE = '#maincontent > table > tbody:not(.header)'; curSite.pager.scrollD = 2000; curSite.thread = true;
  3193. }},
  3194. style: 'tr.forum_head {display: none !important;}',
  3195. pager: {
  3196. nextL: '//div[contains(@class, "xmc_Pages")]//a[text()="下一页"]',
  3197. pageE: '.forum_body table > tbody',
  3198. replaceE: '.xmc_Pages',
  3199. scrollD: 1500
  3200. }
  3201. }, // 小木虫
  3202. google_scholar: {
  3203. host: 'scholar.google.com',
  3204. url: ()=> {if (lp == '/scholar') {curSite = DBSite.google_scholar;}},
  3205. pager: {
  3206. nextL: '//a[./span[contains(@class, "next")]]',
  3207. pageE: '#gs_res_ccl_mid > *',
  3208. insertP: ['#gs_res_ccl_mid', 3],
  3209. replaceE: '#gs_n',
  3210. scriptT: 1,
  3211. scrollD: 2000
  3212. }
  3213. }, // 谷歌学术
  3214. google_scholar_: {
  3215. host: 'sc.panda321.com',
  3216. pager: {
  3217. nextL: '//a[./span[contains(@class, "next")]]',
  3218. pageE: '#gs_res_ccl_mid > *',
  3219. insertP: ['#gs_res_ccl_mid', 3],
  3220. replaceE: '#gs_n',
  3221. scriptT: 1,
  3222. scrollD: 2000
  3223. },
  3224. function: {
  3225. bF: pageE => {
  3226. getCSS('#gs_n').remove();
  3227. return pageE
  3228. }
  3229. }
  3230. }, // 谷歌学术 - 其他镜像站
  3231. bing_academic: {
  3232. style: 'li.aca_algo_count {display: none !important;}',
  3233. pager: {
  3234. nextL: 'a.sb_pagN',
  3235. pageE: '#b_results > li.aca_algo',
  3236. replaceE: '#b_results .b_pag',
  3237. scrollD: 1000
  3238. }
  3239. }, // 必应学术
  3240. baidu_xueshu: {
  3241. host: 'xueshu.baidu.com',
  3242. url: ()=> {if (lp == '/s') {
  3243. curSite = DBSite.baidu_xueshu;
  3244. } else if (indexOF('journal/navigation')) {
  3245. curSite = DBSite.baidu_xueshu_journal;
  3246. } else if (indexOF('paper/show')) {
  3247. curSite = DBSite.baidu_xueshu_paper;
  3248. }},
  3249. pager: {
  3250. nextL: 'id("page")/a[./i[@class="c-icon-pager-next"]]',
  3251. pageE: '#bdxs_result_lists > div.result',
  3252. replaceE: '#page',
  3253. scrollD: 1000
  3254. }
  3255. }, // 百度学术
  3256. baidu_xueshu_journal: {
  3257. pager: {
  3258. nextL: 'a.res-page-next',
  3259. pageE: '#journaldetail > div',
  3260. replaceE: '.res-page',
  3261. scrollD: 1000
  3262. }
  3263. }, // 百度学术
  3264. baidu_xueshu_paper: {
  3265. pager: {
  3266. type: 2,
  3267. nextL: 'div:not([style*="display: none"]) > .more_btn',
  3268. nextText: '加载更多',
  3269. scrollD: 1000
  3270. }
  3271. }, // 百度学术
  3272. so_xueshu: {
  3273. host: 'xueshu.so.com',
  3274. url: ()=> {if (lp == '/s') {curSite = DBSite.so_xueshu;}},
  3275. pager: {
  3276. nextL: 'a#snext',
  3277. pageE: 'ul.list > li',
  3278. replaceE: '#page',
  3279. scrollD: 1000
  3280. }
  3281. }, // 360 学术
  3282. wanfangdata: {
  3283. host: 's.wanfangdata.com.cn',
  3284. url: ()=> {locationC = true; curSite = DBSite.wanfangdata;},
  3285. style: '#zkFooter {display: none !important;}',
  3286. iframe: true,
  3287. pager: {
  3288. type: 5,
  3289. nextL: ()=> getNextEP('.pager.active+span.pager', 'p=', /p=\d+/),
  3290. scrollD: 2000
  3291. }
  3292. }, // 万方数据知识服务
  3293. nsfc: {
  3294. host: ['output.nsfc.gov.cn', 'kd.nsfc.gov.cn'],
  3295. url: ()=> {if (indexOF('/conclusionProject/')) curSite = DBSite.nsfc;},
  3296. style: '#pageNoUl {display: none !important;}',
  3297. pager: {
  3298. type: 4,
  3299. nextL: nsfc_nextL,
  3300. insertP: ['#pageNoUl', 1],
  3301. insertE: nsfc_insertE,
  3302. scrollD: 1500
  3303. }
  3304. }, // 国家自然科学基金
  3305. stackoverflow: {
  3306. host: 'stackoverflow.com',
  3307. url: ()=> {if (indexOF('/questions') && !indexOF(/\/questions\/\d+\//)) {
  3308. curSite = DBSite.stackoverflow;
  3309. } else if (lp == '/search') {
  3310. curSite = DBSite.stackoverflow_search;
  3311. } else if (lp == '/tags') {
  3312. curSite = DBSite.stackoverflow_tags;
  3313. } else if (lp == '/users') {
  3314. curSite = DBSite.stackoverflow_users;
  3315. }},
  3316. pager: {
  3317. nextL: 'a[rel="next"]',
  3318. pageE: '#questions > div',
  3319. replaceE: '.pager',
  3320. scrollD: 2000
  3321. }
  3322. }, // StackOverflow - Questions
  3323. stackoverflow_tags: {
  3324. pager: {
  3325. nextL: 'a[rel="next"]',
  3326. pageE: '#tags-browser > div',
  3327. replaceE: '.pager',
  3328. scrollD: 2000
  3329. }
  3330. }, // StackOverflow - Tags
  3331. stackoverflow_users: {
  3332. pager: {
  3333. nextL: 'a[rel="next"]',
  3334. pageE: '#user-browser > div:first-child > div',
  3335. replaceE: '.pager',
  3336. scrollD: 2000
  3337. }
  3338. }, // StackOverflow - Users
  3339. stackoverflow_search: {
  3340. pager: {
  3341. nextL: 'a[rel="next"]',
  3342. pageE: '.js-search-results > div:first-child > div',
  3343. replaceE: '.pager',
  3344. scrollD: 2000
  3345. }
  3346. }, // StackOverflow - Search
  3347. segmentfault: {
  3348. host: 'segmentfault.com',
  3349. url: ()=> {locationC = true;
  3350. if (indexOF('/questions')) {
  3351. curSite = DBSite.segmentfault;
  3352. } else if (lp == '/search') {
  3353. curSite = DBSite.segmentfault_search;
  3354. }},
  3355. pager: {
  3356. nextL: '//a[@class="page-link"][contains(text(), "下一页")]',
  3357. pageE: 'ul.list-group > li',
  3358. replaceE: 'ul.pagination',
  3359. scrollD: 1000
  3360. }
  3361. }, // SegmentFault - Questions
  3362. segmentfault_search: {
  3363. pager: {
  3364. nextL: 'a[rel="next"]',
  3365. pageE: '.search-result > section',
  3366. replaceE: 'ul.pagination',
  3367. scrollD: 1000
  3368. }
  3369. }, // SegmentFault - Search
  3370. w3school_com_cn: {
  3371. host: 'www.w3school.com.cn',
  3372. url: ()=> {if (location.pathname.split('/').length > 2) {curSite = DBSite.w3school_com_cn;}},
  3373. style: '#maincontent h1:not(:nth-of-type(1)) {margin-top: 30px;}',
  3374. pager: {
  3375. type: 3,
  3376. nextL: ()=> { // 过滤部分非本页的参考手册
  3377. let next = getCSS('li.next > a[href]')
  3378. if (next && next.href.indexOf('/index.') === -1) return next.href;
  3379. curSite = {SiteTypeID: 0}; return ''
  3380. },
  3381. pageE: '#maincontent > *:not([class*="prenextnav"]):not(#bpn):not(#tpn)',
  3382. insertP: ['id("bpn") | //div[contains(@class, "prenextnav")][last()]', 1],
  3383. replaceE: 'ul.prenext, #navsecond',
  3384. scrollE: 'id("bpn") | //div[contains(@class, "prenextnav")][last()]',
  3385. forceHTTPS: true,
  3386. scrollD: 600
  3387. }
  3388. }, // W3school
  3389. w3cschool_cn: {
  3390. host: 'www.w3cschool.cn',
  3391. url: ()=> {if (location.pathname.split('/').length > 2) {curSite = DBSite.w3cschool_cn;}},
  3392. style: '.widget-body, #rfbanner {display: none !important;}',
  3393. pager: {
  3394. nextL: '.next-link > a',
  3395. pageE: '#pro-mian-header, .content-bg',
  3396. replaceE: '.content-links, .splitter-sidebar',
  3397. scrollD: 1500
  3398. }
  3399. }, // W3Cschool
  3400. runoob: {
  3401. host: 'www.runoob.com',
  3402. url: ()=> {if (location.pathname.split('/').length > 2 && getCSS('#leftcolumn')) {curSite = DBSite.runoob;}},
  3403. style: '#comments, #postcomments, #respond, #footer {display: none !important;} .article-intro h1:not(:nth-of-type(1)) {margin: 30px 0 10px 0;}',
  3404. pager: {
  3405. nextL: ()=> { // 过滤部分非本页的参考手册
  3406. let next = getCSS('#leftcolumn > a[style]~a[href]')
  3407. if (next && next.href.split('/').length === location.href.split('/').length && next.href.split('/')[3] === location.href.split('/')[3]) return next.href;
  3408. next.href = location.href; curSite = {SiteTypeID: 0}; return ''
  3409. },
  3410. pageE: '#content > *, script[src*="assets/js/main.min.js"]',
  3411. insertP: ['#content', 3],
  3412. replaceE: '.previous-next-links, #leftcolumn',
  3413. scriptT: 2,
  3414. forceHTTPS: true,
  3415. scrollD: 1000
  3416. }
  3417. }, // 菜鸟教程
  3418. cnblogs: {
  3419. host: ['www.cnblogs.com', 'zzk.cnblogs.com'],
  3420. url: ()=> {
  3421. if (location.hostname === 'zzk.cnblogs.com') {
  3422. curSite = DBSite.cnblogs_search;
  3423. } else if (getCSS('#post_list')) {
  3424. curSite = DBSite.cnblogs_list;
  3425. } else if (location.pathname.split('/').length === 3 && getCSS('.topicListFooter')) {
  3426. curSite = DBSite.cnblogs;
  3427. if (!getCSS('#homepage_top_pager')) {
  3428. getCSS('.forFlow').insertAdjacentHTML(getAddTo(2), '<div id="homepage_top_pager" class="topicListFooter"></div>');
  3429. getCSS('.forFlow').insertAdjacentHTML(getAddTo(3), '<div id="homepage_bottom_pager" class="topicListFooter"></div>');
  3430. }
  3431. }
  3432. },
  3433. pager: {
  3434. nextL: '//div[@class="topicListFooter"]//a[contains(text(), "下一页")]',
  3435. pageE: 'div.day',
  3436. replaceE: '.topicListFooter',
  3437. scrollD: 1000
  3438. }
  3439. }, // 博客园 - 文章列表(个人)
  3440. cnblogs_list: {
  3441. pager: {
  3442. nextL: '//div[@class="pager"]//a[contains(text(), ">")]',
  3443. pageE: '#post_list > article',
  3444. replaceE: '.pager',
  3445. scrollD: 1000
  3446. }
  3447. }, // 博客园 - 文章列表
  3448. cnblogs_search: {
  3449. pager: {
  3450. nextL: '//div[@class="pager"]//a[contains(text(), ">")]',
  3451. pageE: 'div.searchItem',
  3452. replaceE: '.pager',
  3453. scrollD: 1000
  3454. }
  3455. }, // 博客园 - 搜索页
  3456. gitee: {
  3457. host: 'gitee.com',
  3458. url: ()=> {
  3459. if (indexOF('/explore/')) {
  3460. curSite = DBSite.gitee;
  3461. } else if (indexOF(/\/issues$/)) {
  3462. curSite = DBSite.gitee_issues;
  3463. } else if (indexOF(/\/releases/)) {
  3464. curSite = DBSite.gitee_releases;
  3465. } else if (indexOF(/\/tags/)) {
  3466. curSite = DBSite.gitee_tags;
  3467. }
  3468. if (curSite.SiteTypeID > 0 && !curSite.pager.nextL) {
  3469. curSite.pager.type = 1;
  3470. curSite.pager.nextL = 'a[rel="next"]';
  3471. curSite.pager.replaceE = '.pagination';
  3472. curSite.pager.scrollD = 2500;
  3473. }
  3474. },
  3475. pager: {
  3476. pageE: '.items > .item',
  3477. }
  3478. }, // Gitee - Explore 列表
  3479. gitee_issues: {
  3480. pager: {
  3481. pageE: '.issue-wrapper',
  3482. }
  3483. }, // Gitee - Issues 列表
  3484. gitee_releases: {
  3485. pager: {
  3486. pageE: '.release-tag-item',
  3487. }
  3488. }, // Gitee - Releases 列表
  3489. gitee_tags: {
  3490. pager: {
  3491. pageE: '.tag-item',
  3492. }
  3493. }, // Gitee - Tags 列表
  3494. gitee_search: {
  3495. host: 'search.gitee.com',
  3496. url: ()=> {if (location.search) curSite = DBSite.gitee_search;},
  3497. pager: {
  3498. nextL: 'li.next:not(.disabled) > a',
  3499. pageE: '#hits-list > div',
  3500. replaceE: 'ul.pagination',
  3501. scrollD: 1000
  3502. }
  3503. }, // Gitee - Search 列表
  3504. github: {
  3505. host: ['github.com', 'hub.fastgit.org'],
  3506. url: ()=> {locationC = true;
  3507. if (lp == '/') {
  3508. curSite = DBSite.github;
  3509. } else if (indexOF('tab=stars', 's')) {
  3510. curSite = DBSite.github_star;
  3511. } else if (indexOF('tab=repositories', 's')) {
  3512. curSite = DBSite.github_repositories;
  3513. } else if (indexOF(/\/issues$/) || indexOF(/\/pulls$/)) {
  3514. curSite = DBSite.github_issues;
  3515. } else if (indexOF(/\/discussions$/) || indexOF('/discussions/categories')) {
  3516. curSite = DBSite.github_discussions;
  3517. } else if (indexOF(/\/releases$/)) {
  3518. curSite = DBSite.github_releases;
  3519. } else if (indexOF(/\/tags$/)) {
  3520. curSite = DBSite.github_tags;
  3521. } else if (indexOF('/commits')) {
  3522. curSite = DBSite.github_commits;
  3523. } else if (indexOF('/notifications')) {
  3524. curSite = DBSite.github_notifications;
  3525. } else if (indexOF('/search')) {
  3526. if (!location.search) return
  3527. if (!indexOF('type=', 's')) {
  3528. if (lp == '/search') {
  3529. curSite = DBSite.github_search_repositories;
  3530. } else {
  3531. curSite = DBSite.github_search_code;
  3532. }
  3533. } else {
  3534. curSite = DBSite['github_search_' + /type=[a-z]+/.exec(location.search.toLowerCase())[0].replace('type=','')];
  3535. }
  3536. if (curSite.SiteTypeID > 0 && !curSite.pager.nextL) {
  3537. curSite.pager.type = 1;
  3538. curSite.pager.nextL = 'a.next_page';
  3539. curSite.pager.replaceE = '.pagination';
  3540. curSite.pager.scrollD = 3000;
  3541. }
  3542. }},
  3543. pager: {
  3544. type: 2,
  3545. nextL: '.ajax-pagination-btn',
  3546. nextText: 'More',
  3547. scrollD: 2500
  3548. }
  3549. }, // Github - 首页
  3550. github_star: {
  3551. pager: {
  3552. nextL: '//div[@class="paginate-container"]//a[contains(text(), "Next")]',
  3553. pageE: '#js-pjax-container .position-relative div[class^="col-lg-"] > div:not(.position-relative):not(.paginate-container)',
  3554. insertP: ['.paginate-container', 1],
  3555. replaceE: '.paginate-container',
  3556. scrollD: 3000
  3557. }
  3558. }, // Github - 用户 Star 列表
  3559. github_repositories: {
  3560. pager: {
  3561. nextL: '//div[@class="paginate-container"]//a[contains(text(), "Next")]',
  3562. pageE: '#user-repositories-list > ul > li',
  3563. replaceE: '.paginate-container',
  3564. scrollD: 3000
  3565. }
  3566. }, // Github - 用户 项目 列表
  3567. github_issues: {
  3568. pager: {
  3569. nextL: 'a.next_page',
  3570. pageE: '.js-navigation-container.js-active-navigation-container > div[id^="issue_"]',
  3571. replaceE: '.pagination',
  3572. scrollD: 3000
  3573. }
  3574. }, // Github - Issues 列表 / PR 列表
  3575. github_discussions: {
  3576. pager: {
  3577. nextL: 'a.next_page',
  3578. pageE: 'ul[aria-labelledby="discussions-list"] > li',
  3579. replaceE: '.pagination',
  3580. scrollD: 3000
  3581. }
  3582. }, // Github - Discussions 列表
  3583. github_releases: {
  3584. pager: {
  3585. nextL: 'a.next_page',
  3586. pageE: '#repo-content-pjax-container > div[data-pjax] > div:not(.paginate-container)',
  3587. replaceE: '.pagination',
  3588. scrollD: 3000
  3589. }
  3590. }, // Github - Releases 列表
  3591. github_tags: {
  3592. pager: {
  3593. nextL: '//div[@class="pagination"]/a[contains(text(), "Next")]',
  3594. pageE: '.Box-body > div.Box-row',
  3595. replaceE: '.pagination',
  3596. scrollD: 3000
  3597. }
  3598. }, // Github - Tags 列表
  3599. github_commits: {
  3600. pager: {
  3601. nextL: '//div[@class="paginate-container"]//a[contains(text(), "Older")]',
  3602. pageE: 'div.js-navigation-container > div',
  3603. replaceE: '.paginate-container',
  3604. scrollD: 3000
  3605. }
  3606. }, // Github - Commits 列表
  3607. github_notifications: {
  3608. pager: {
  3609. nextL: 'nav.paginate-container > a[aria-label="Next"]',
  3610. pageE: 'li.notifications-list-item',
  3611. replaceE: 'nav.paginate-container, .js-notifications-list-paginator-counts',
  3612. scrollD: 3000
  3613. }
  3614. }, // Github - Notifications 列表
  3615. github_search_repositories: {
  3616. pager: {
  3617. pageE: 'ul.repo-list > li',
  3618. }
  3619. }, //Github - Search 列表
  3620. github_search_code: {
  3621. pager: {
  3622. pageE: '.code-list-item',
  3623. }
  3624. }, // Github - Search 列表 - Code
  3625. github_search_commits: {
  3626. pager: {
  3627. pageE: '#commit_search_results > div',
  3628. }
  3629. }, // Github - Search 列表 - Commit
  3630. github_search_issues: {
  3631. pager: {
  3632. pageE: '.issue-list-item',
  3633. }
  3634. }, // Github - Search 列表 - Issues
  3635. github_search_discussions: {
  3636. pager: {
  3637. pageE: '.discussion-list-item',
  3638. }
  3639. }, // Github - Search 列表 - Discussions
  3640. github_search_registrypackages: {
  3641. pager: {
  3642. pageE: '#package_search_results > div',
  3643. }
  3644. }, // Github - Search 列表 - Package
  3645. github_search_marketplace: {
  3646. pager: {
  3647. pageE: '#marketplace_search_results > div:first-child > div',
  3648. }
  3649. }, // Github - Search 列表 - Marketplace
  3650. github_search_topics: {
  3651. pager: {
  3652. pageE: '.topic-list-item',
  3653. }
  3654. }, // Github - Search 列表 - Topics
  3655. github_search_wikis: {
  3656. pager: {
  3657. pageE: '#wiki_search_results > div:first-child > div',
  3658. }
  3659. }, // Github - Search 列表 - wiki
  3660. github_search_users: {
  3661. pager: {
  3662. pageE: '#user_search_results > div:first-child > div',
  3663. }
  3664. } // Github - Search 列表 - user
  3665. };
  3666. // 向后兼容一段时间就移除
  3667. /*if (JSON.stringify(GM_getValue('menu_customRules', {})).indexOf('functionS') > -1 || JSON.stringify(GM_getValue('menu_customRules', {})).indexOf('css;') > -1) { // 改名过渡,过段时间将其移除
  3668. GM_setValue('menu_customRules', JSON.parse(JSON.stringify(GM_getValue('menu_customRules', {})).replaceAll('functionS', 'url').replaceAll('css;', '')))
  3669. }*/
  3670. //console.log(GM_getValue('menu_customRules'), GM_getValue('menu_rules'))
  3671. // 合并 自定义规则、外置规则、内置规则
  3672. DBSite = Object.assign(GM_getValue('menu_customRules', {}), GM_getValue('menu_rules', {}), DBSite)
  3673. // 生成 SiteTypeID
  3674. setSiteTypeID();
  3675. //console.log(DBSite)
  3676. // 用于脚本判断(针对部分特殊的网站)
  3677. SiteType = {
  3678. BAIDU_TIEBA: DBSite.baidu_tieba.SiteTypeID
  3679. };
  3680. }
  3681. // 获取外置翻页规则
  3682. function getRulesUrl(update = false) {
  3683. if (GM_getValue('menu_ruleUpdateTime') == null) update = true
  3684. if (update) GM_setValue('menu_ruleUpdateTime', '1970/1/1');
  3685. //console.log(new Date().getTime());
  3686. let timeNow = new Date().getFullYear() + '/' + (new Date().getMonth() + 1) + '/' + new Date().getDate(),
  3687. timeOld = GM_getValue('menu_ruleUpdateTime');
  3688. if (!timeOld || timeOld != timeNow) { // 是新的一天
  3689. GM_setValue('menu_ruleUpdateTime', timeNow); // 写入时间以供后续比较
  3690.  
  3691. GM_xmlhttpRequest({
  3692. url: 'https://userscript.xiu2.xyz/other/Autopage/rules.json',
  3693. method: 'GET',
  3694. responseType: 'json',
  3695. overrideMimeType: 'application/json; charset=utf-8',
  3696. timeout: 5000,
  3697. onload: function (response) {
  3698. try {
  3699. //console.log('最终 URL:' + response.finalUrl, '返回内容:',response.response)
  3700. if (response.response) {
  3701. GM_setValue('menu_rules', response.response);
  3702. if (update) {
  3703. curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  3704. registerMenuCommand(); // 重新判断规则
  3705. //console.log(new Date().getTime());
  3706. //console.log(curSite);
  3707. if (curSite.style) {insStyle(curSite.style)} // 插入 Style CSS 样式
  3708. curSite.pageUrl = ''; // 下一页URL
  3709. pageLoading(); // 自动无缝翻页
  3710.  
  3711. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  3712. pausePageEvent(); // 左键双击网页空白处暂停翻页
  3713. GM_notification({text: '✅ 已更新外置翻页规则!\n如果依然无法翻页,则说明还不支持当前网页,欢迎点击此处提交申请~', timeout: 5000, onclick: function(){window.GM_openInTab('https://github.com/XIU2/UserScript#xiu2userscript', {active: true,insert: true,setParent: true});window.GM_openInTab('https://greasyfork.org/zh-CN/scripts/419215/feedback', {active: true,insert: true,setParent: true});}});
  3714. }
  3715. } else {
  3716. GM_notification({text: '❌ 更新失败,请联系作者解决...', timeout: 5000});
  3717. }
  3718. } catch (e) {
  3719. console.log(e);
  3720. GM_notification({text: '❌ 更新失败,请联系作者解决...', timeout: 5000});
  3721. }
  3722. }
  3723. })
  3724. }
  3725. }
  3726.  
  3727.  
  3728. // --------------------------------------------------------
  3729.  
  3730.  
  3731. // 判断网站类型
  3732. webTypeIf();
  3733.  
  3734. // 帖子内自动翻页判断
  3735. if (!GM_getValue('menu_thread')) {
  3736. if (curSite.thread) {curSite = {SiteTypeID: 0}; pageNum.now = 1;}
  3737. }
  3738.  
  3739. //console.log(curSite)
  3740. // 显示页码
  3741. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');}
  3742. // 左键双击网页空白处暂停翻页
  3743. pausePageEvent();
  3744. // 强制新标签页打开链接(翻页模式 5/6)
  3745. if (curSite.forceTarget) forceTarget();
  3746.  
  3747. // 对于使用 pjax 技术的网站,需要监听 URL 变化来重新判断翻页规则
  3748. if (locationC) {
  3749. nowLocation = location.href
  3750. if (window.onurlchange === undefined) {addUrlChangeEvent();} // Tampermonkey v4.11 版本添加的 onurlchange 事件 grant,可以监控 pjax 等网页的 URL 变化
  3751. if (webType === 1) {
  3752. window.addEventListener('urlchange', function(){
  3753. lp = location.pathname;
  3754. //console.log(nowLocation, location.href)
  3755. if (curSite.history !== false && window.top.document.xiu_nowUrl === location.href) {nowLocation = location.href; return}
  3756. if (nowLocation == location.href) return
  3757. if (curSite.pager && curSite.pager.type == 5) {
  3758. if (self != top) {window.top.location.href = location.href;} else {if (getCSS('iframe#xiu_iframe')) {getCSS('iframe#xiu_iframe').remove();}}
  3759. pausePage = true;
  3760. } // 对于翻页模式 5,如果是 iframe 框架内 URL 变动,则升级为顶级页面,如果是顶级页面的 URL 变动,则清理 iframe 框架
  3761. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  3762. registerMenuCommand(); // 重新判断规则
  3763. //console.log(curSite);
  3764. if (curSite.style) {insStyle(curSite.style)} // 插入 Style CSS 样式
  3765. // 帖子内自动翻页判断
  3766. if (!GM_getValue('menu_thread')) {
  3767. if (curSite.thread) {curSite = {SiteTypeID: 0}; pageNum.now = 1;}
  3768. }
  3769. curSite.pageUrl = ''; // 下一页URL
  3770. pageLoading(); // 自动无缝翻页
  3771.  
  3772. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  3773. pausePageEvent(); // 左键双击网页空白处暂停翻页
  3774. })
  3775. } else if (webType === 2) {
  3776. window.addEventListener('urlchange', function(){
  3777. lp = location.pathname;
  3778. //console.log(nowLocation, location.href)
  3779. if (nowLocation == location.href) return
  3780. setTimeout(function(){
  3781. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  3782. discuz_(); // 重新判断规则
  3783.  
  3784. // 帖子内自动翻页判断
  3785. if (!GM_getValue('menu_thread')) {
  3786. if (curSite.thread) {curSite = {SiteTypeID: 0}; pageNum.now = 1;}
  3787. }
  3788.  
  3789. if (curSite.style) {insStyle(curSite.style)} // 插入 Style CSS 样式
  3790. curSite.pageUrl = ''; // 下一页URL
  3791. pageLoading(); // 自动无缝翻页
  3792.  
  3793. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  3794. pausePageEvent(); // 左键双击网页空白处暂停翻页
  3795. }, 500)
  3796. })
  3797. } else if (webType === 3) {
  3798. window.addEventListener('urlchange', function(){
  3799. lp = location.pathname;
  3800. if (nowLocation == location.href) return
  3801. nowLocation = location.href; curSite = {SiteTypeID: 0}; pageNum.now = 1; // 重置规则+页码
  3802. DBSite.flarum.url(); // 重新判断规则
  3803. if (curSite.style) {insStyle(curSite.style)} // 插入 Style CSS 样式
  3804. pageLoading(); // 自动无缝翻页
  3805.  
  3806. if (GM_getValue('menu_page_number')) {pageNumber('add');} else {pageNumber('set');} // 显示页码
  3807. pausePageEvent(); // 左键双击网页空白处暂停翻页
  3808. })
  3809. }
  3810. }
  3811. // 插入 Style CSS 样式
  3812. if (curSite.style) insStyle(curSite.style)
  3813.  
  3814. // 对翻页模式 5 的子 iframe 添加一个跟随滚动的事件
  3815. if (curSite.pager && curSite.pager.type === 5 && self != top) {
  3816. var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop
  3817. window.addEventListener('scroll', function (e) {
  3818. let scrollTop = window.parent.document.documentElement.scrollTop || window.parent.document.body.scrollTop,
  3819. clientHeight = window.parent.document.documentElement.clientHeight || window.parent.document.body.clientHeight,
  3820. scrollHeight = window.parent.document.documentElement.scrollHeight || window.parent.document.body.scrollHeight,
  3821. afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  3822. delta = afterScrollTop - beforeScrollTop;
  3823. if (delta == 0) return false;
  3824. beforeScrollTop = afterScrollTop;
  3825. //console.log(delta, scrollHeight - (scrollTop + clientHeight), '2222')
  3826. if (delta > 0 && scrollTop + clientHeight < scrollHeight) {
  3827. window.parent.scrollBy(0, delta*2);
  3828. }
  3829. }, false);
  3830. }
  3831.  
  3832. // 下一页URL
  3833. curSite.pageUrl = '';
  3834. // 自动无缝翻页
  3835. pageLoading();
  3836.  
  3837.  
  3838. // --------------------------------------------------------
  3839.  
  3840.  
  3841. // [Discuz! 论坛] 判断各版块帖子列表类型
  3842. function discuzForum(m) {
  3843. if (m == 'm') { // 手机版页面
  3844. if (getCSS('a.loadmore')) {
  3845. curSite = DBSite.discuz_m_forum;
  3846. } else if (getCSS('.threadlist')) {
  3847. curSite = DBSite.discuz_m; curSite.pager.pageE = '.threadlist > ul > li';
  3848. } else if (getCSS('[id^="normalthread_"]')) {
  3849. curSite = DBSite.discuz_m; curSite.pager.pageE = '[id^="normalthread_"]:not(.ZDlist)';
  3850. }
  3851. if (curSite.SiteTypeID !== 0 && location.hostname === 'keylol.com') {curSite.history = false; locationC = true;}
  3852. } else {
  3853. if (getCSS('#autopbn')) { // 判断是否有 [下一页] 按钮
  3854. curSite = DBSite.discuz_forum;
  3855. } else if (getCSS('#waterfall')) { // 判断是否为图片模式
  3856. if (!getCSS('#pgbtn, .pgbtn')) { // 如果各版块帖子列表已存在这个元素,说明自带了无缝翻页
  3857. curSite = DBSite.discuz_waterfall; waterfallStyle(); // 图片模式列表样式预处理
  3858. }
  3859. } else {
  3860. curSite = DBSite.discuz_guide;
  3861. }
  3862. }
  3863. }
  3864. // [Discuz! 论坛] 判断手机版帖子内
  3865. function discuzThreadM() {
  3866. if (getCSS('[id^="pid"]')) {
  3867. curSite = DBSite.discuz_m; curSite.pager.pageE = '[id^="pid"], [id^="pid"]+div:not([id="post_new"])'
  3868. } else if (getCSS('[id^="post_"]')) {
  3869. curSite = DBSite.discuz_m; curSite.pager.pageE = '[id^="post_"]';
  3870. }
  3871. if (curSite.SiteTypeID !== 0 && location.hostname === 'keylol.com') {curSite.history = false; locationC = true;}
  3872. }
  3873. function discuz_() {
  3874. if (getCSS('body[id="nv_forum"][class^="pg_"][onkeydown*="27"]')) {
  3875. switch (getCSS('body[id="nv_forum"][class^="pg_"][onkeydown*="27"]').className) {
  3876. case 'pg_forumdisplay': // < 各版块帖子列表 >
  3877. discuzForum(); break;
  3878. case 'pg_viewthread': // < 帖子内 >
  3879. curSite = DBSite.discuz_thread; break;
  3880. case 'pg_guide': // < 导读帖子列表等 >
  3881. curSite = DBSite.discuz_guide; break;
  3882. case 'pg_collection': // < 淘贴列表 >
  3883. curSite = DBSite.discuz_collection; break;
  3884. }
  3885. }
  3886. // 如果上面没有匹配的则继续 < 搜索结果 >
  3887. if (curSite.SiteTypeID === 0) {
  3888. if (indexOF('search') || getCSS('body[id="nv_search"][onkeydown*="27"]')) {
  3889. if (indexOF('mobile=2', 's')) { // 手机版页面
  3890. curSite = DBSite.discuz_m; curSite.pager.pageE = '.threadlist > ul > li'; locationC = true;
  3891. } else {
  3892. curSite = DBSite.discuz_search;
  3893. }
  3894. }
  3895. }
  3896. // 如果上面没有匹配的则继续
  3897. if (curSite.SiteTypeID === 0) {
  3898. if (indexOF('.html')) { // 判断是不是静态网页(.html 结尾)
  3899. if (indexOF('/forum-')) { // < 各版块帖子列表 >
  3900. if (getXpath('//head/meta[@name="applicable-device" and @content="mobile"] | //head/title[contains(text(), "手机版")] | //head/link[contains(@href, "/mobile/")] | //head/script[contains(@src, "/mobile/")]')) { // 手机版页面
  3901. discuzForum('m');
  3902. } else {
  3903. discuzForum();
  3904. }
  3905. } else if (indexOF('/thread-')) { // < 帖子内 >
  3906. if (getXpath('//head/meta[@name="applicable-device" and @content="mobile"] | //head/title[contains(text(), "手机版")] | //head/link[contains(@href, "/mobile/")] | //head/script[contains(@src, "/mobile/")]')) { // 手机版页面
  3907. discuzThreadM();
  3908. } else {
  3909. curSite = DBSite.discuz_thread;
  3910. }
  3911. }
  3912. }
  3913. }
  3914. // 如果上面没有匹配的则继续
  3915. if (curSite.SiteTypeID === 0) {
  3916. if (indexOF('mod=forumdisplay', 's') || indexOF('forumdisplay.php')) { // < 各版块帖子列表 >
  3917. 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/")]')) { // 手机版页面
  3918. discuzForum('m');
  3919. } else {
  3920. discuzForum();
  3921. }
  3922. } else if (indexOF('mod=viewthread', 's') || indexOF('viewthread.php')) { // < 帖子内 >
  3923. 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/")]')) { // 手机版页面
  3924. discuzThreadM();
  3925. } else {
  3926. curSite = DBSite.discuz_thread;
  3927. }
  3928. } else if (indexOF('mod=guide', 's')) { // < 导读帖子列表 >
  3929. curSite = DBSite.discuz_guide;
  3930. } else if(indexOF('mod=space', 's') && indexOF('do=thread', 's')) { // 别人的主题/回复
  3931. curSite = DBSite.discuz_youspace;
  3932. } else if (indexOF('mod=collection', 's')) { // < 淘贴列表 >
  3933. curSite = DBSite.discuz_collection;
  3934. } else if (getCSS('#threadlist')) { // < 部分论坛的各板块 URL 是自定义的 >
  3935. discuzForum();
  3936. } else if (getCSS('#postlist')) { // < 部分论坛的帖子内 URL 是自定义的 >
  3937. curSite = DBSite.discuz_thread;
  3938. } else { // 手机版判断
  3939. discuzForum('m');
  3940. if (curSite.SiteTypeID === 0) discuzThreadM();
  3941. }
  3942. }
  3943. }
  3944. // [Discuz! 论坛] 图片模式列表样式预处理
  3945. function waterfallStyle() {
  3946. let width = getCSS('#waterfall > li:first-child').style.width;
  3947. 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;}`);
  3948. }
  3949.  
  3950.  
  3951. // [谷歌搜索] 的插入前函数(加载视频图片)
  3952. function google_bF(pageE) {
  3953. if (!indexOF('tbm=nws', 's')){
  3954. pageE.forEach(function (one) {
  3955. getAllCSS('a[aria-label][href*="https://www.youtube.com/watch?v="]').forEach(function (one1) {
  3956. let img = getCSS('img', one1)
  3957. if (img) img.src = `https://i.ytimg.com/vi/${one1.href.split('?v=')[1]}/mqdefault.jpg`
  3958. })
  3959. });
  3960. }
  3961. return pageE
  3962. }
  3963.  
  3964.  
  3965. // [必应搜索] 的插入前函数(加载网站图标)
  3966. function bing_bF(pageE) {
  3967. if (!getCSS('.b_title > a.sh_favicon')) {
  3968. insStyle('.b_title > a.sh_favicon {display: none !important;}');
  3969. delete curSite.function
  3970. //console.log(curSite)
  3971. return pageE
  3972. }
  3973. pageE.forEach(function (one) {
  3974. getAllCSS('div.rms_iac[data-src]').forEach(function (one1) {
  3975. one1.outerHTML = `<img src="${one1.dataset.src}" height="16" width="16" alt="全球 Web 图标" role="presentation" class="rms_img">`;
  3976. })
  3977. });
  3978. return pageE
  3979. }
  3980.  
  3981.  
  3982. // [百度贴吧](发帖按钮点击事件)
  3983. function baidu_tieba_1() {
  3984. let button = getCSS('.tbui_aside_fbar_button.tbui_fbar_post > a');
  3985. if (button) {
  3986. button.remove();
  3987. 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>')
  3988. button = getCSS('.tbui_aside_fbar_button.tbui_fbar_post > a');
  3989. if (button) {
  3990. button.onclick = function(){
  3991. let button2 = getCSS('div.edui-btn.edui-btn-fullscreen.edui-btn-name-portrait');
  3992. if (button2) {button2.click();} else {alert('提示:登录后才能发帖!');}
  3993. return false;
  3994. }
  3995. }
  3996. }
  3997. }
  3998. // [百度贴吧] 插入数据
  3999. function baidu_tieba_insertE(pageE, type) {
  4000. if (!pageE) return
  4001. // 获取 <script> 内容
  4002. const scriptElems = getXpath(`//script[contains(text(), 'Bigpipe.register("frs-list/pagelet/thread_list", ')]`, pageE, pageE);
  4003. if (scriptElems) {
  4004. // 从 <script> 中提取帖子列表字符串
  4005. let scriptText = scriptElems.textContent.replace('Bigpipe.register("frs-list/pagelet/thread_list", ','');
  4006. scriptText = scriptText.slice(0, scriptText.indexOf(').'));
  4007. // 字符串转 Element 元素
  4008. let temp_baidu_tieba = document.createElement('div'); temp_baidu_tieba.innerHTML = JSON.parse(scriptText).content;
  4009. processElems(temp_baidu_tieba);
  4010. }
  4011. }
  4012.  
  4013.  
  4014. // [V2EX] 的插入后函数(新标签页打开链接)
  4015. function v2ex_aF(css) {
  4016. let links = getAllCSS(css);if (!links) return
  4017. links.forEach(function (_this) {_this.target = '_blank';});
  4018. }
  4019.  
  4020.  
  4021. // [NexusMods] 获取下一页地址
  4022. function nexusmods_nextL() {
  4023. if (getCSS('.nexus-ui-blocker')) return
  4024. let modList;
  4025. if (indexOF('/news')) {modList = RH_NewsTabContent;} else {modList = RH_ModList;}
  4026. if (!modList) return
  4027. let out_items = JSON.stringify(modList.out_items).replace(/{|}|"/g,''),
  4028. nextNum = getXpath('//div[contains(@class, "pagenav")][1]//a[contains(@class, "page-selected")]/parent::li/following-sibling::li/a'),
  4029. categories = modList.out_items.categories, categoriesUrl = '';
  4030. var url = '';
  4031. if (nextNum && nextNum.innerText) {
  4032. nextNum = nextNum.innerText;
  4033. if (out_items.indexOf('page:') > -1) {
  4034. out_items = out_items.replace(/page:\d+/, `page:${nextNum}`)
  4035. } else {
  4036. out_items += `,page:${nextNum}`;
  4037. }
  4038. if (categories && categories != []) {
  4039. for (let i = 0; i < categories.length; i++) {
  4040. categoriesUrl += `,categories[]:${categories[i]}`
  4041. }
  4042. categoriesUrl = categoriesUrl.replace(/,/,'');
  4043. if (out_items.indexOf('categories:') > -1) {
  4044. out_items = out_items.replace(/categories:\[.*\]/, categoriesUrl)
  4045. }
  4046. }
  4047. return `https://www.nexusmods.com${modList.uri}?RH_${modList.id}=${out_items}`
  4048. }
  4049. return ''
  4050. }
  4051. // [NexusMods] 的插入前函数(隐藏底部元素)
  4052. function nexusmods_bF(pageE) {
  4053. pageE.forEach(function (one) {
  4054. let now = one.querySelector('.mod-tile-left');
  4055. if (now) {
  4056. let downloadCount = now.querySelector('.downloadcount > span.flex-label');
  4057. if (downloadCount) {
  4058. if (GlobalModStats[now.dataset.gameId] && GlobalModStats[now.dataset.gameId][now.dataset.modId]) {
  4059. downloadCount.textContent = shortFormat(parseInt(GlobalModStats[now.dataset.gameId][now.dataset.modId].total));
  4060. }
  4061. }
  4062. }
  4063. });
  4064. return pageE
  4065. }
  4066.  
  4067.  
  4068. // [bilibili_search] 获取下一页地址
  4069. function bilibili_search_nextL() {
  4070. if (!location.search) return
  4071. let pageActive = 1, pageLast = parseInt(getXpath('//ul[@class="pages"]/li[contains(@class, "page-item")][not(contains(@class, "next") or contains(@class, "prev"))][last()]').innerText);
  4072. if (!pageLast) return
  4073. if (indexOF(/page=\d+/, 's')) {
  4074. pageActive = parseInt(/page=\d+/.exec(location.search)[0].replace('page=',''))
  4075. }
  4076. if (pageActive < pageLast) {
  4077. if (indexOF(/page=\d+/, 's')) {
  4078. return (location.origin + location.pathname + location.search.replace(/page=\d+/,`page=${pageActive+1}`))
  4079. } else {
  4080. return (location.origin + location.pathname + location.search + `&page=${pageActive+1}`)
  4081. }
  4082. }
  4083. }
  4084. // [bilibili_search] 插入前函数(加载图片)
  4085. function bilibili_search_bF(pageE) {
  4086. pageE.forEach(function (one) {
  4087. let img = getCSS('.img > .lazy-img > img[src=""]', one)
  4088. if (img) {
  4089. img.setAttribute('data-srclz', 'lazy')
  4090. }
  4091. });
  4092. return pageE
  4093. }
  4094. // [bilibili_search] 插入后函数(加载图片)
  4095. function bilibili_search_aF() {
  4096. let result = __INITIAL_STATE__.flow[__INITIAL_STATE__.flow.fields[0]].result;
  4097. if (result.length > 0) {
  4098. let imgArr = getAllCSS('.img > .lazy-img > img[data-srclz]');
  4099. if (imgArr.length > 0) {
  4100. for (let i = 0; i < imgArr.length; i++) {
  4101. imgArr[i].src = result[i].pic;
  4102. imgArr[i].removeAttribute('data-srclz');
  4103. }
  4104. }
  4105. }
  4106. }
  4107.  
  4108.  
  4109. // [漫画狂] 获取下一页地址
  4110. function cartoonmad_nextL() {
  4111. let url = getXpath('//a[@class="pages"][contains(text(),"下一頁")]');
  4112. if (url) {
  4113. if (url.getAttribute('href') === 'thend.asp') {
  4114. url = getXpath('//a[@class="pages"][contains(string(),"下一話")]')
  4115. if (url) return url.href;
  4116. pausePage = false;
  4117. GM_notification({text: `注意:该网站早期漫画(如海贼王、柯南)因为网站自身问题而无法翻至下一话(仅限于显示为 [第 X 卷]/[下一卷] 的)。\n因此需要手动去 [目录页] 进入下一卷!`, timeout: 10000});
  4118. } else {
  4119. return url.href;
  4120. }
  4121. }
  4122. return '';
  4123. }
  4124.  
  4125.  
  4126. // [漫画猫] 初始化(显示本话所以图片)
  4127. function manhuacat_init() {
  4128. let _img = '';
  4129. for (let now of img_data_arr) {_img += `<img src="${asset_domain}${img_pre}${now}">`;}
  4130. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  4131.  
  4132. }
  4133. // [漫画猫] 获取下一页地址
  4134. function manhuacat_nextL(pageE, type) {
  4135. if (type === 'url') {
  4136. if(pageE.code == '0000') {
  4137. if (pageE.url === curSite.pageUrl) return
  4138. curSite.pageUrl = pageE.url;
  4139. getPageE_(curSite.pageUrl); // 真正的下一页链接
  4140. }
  4141. } else {
  4142. let vg_r_data = getCSS('.vg-r-data');
  4143. if (vg_r_data) {
  4144. getPageE_(`${location.origin}/chapter_num?chapter_id=${vg_r_data.dataset.chapter_num}&ctype=1&type=${vg_r_data.dataset.chapterType};`, 'json', 'GET', '', 'url');
  4145. }
  4146. }
  4147. }
  4148. // [漫画猫] 插入数据
  4149. function manhuacat_insertE(pageE, type) {
  4150. if (!pageE) return
  4151. if (type === 'url') { // 获取下一页链接
  4152. manhuacat_nextL(pageE, type); return
  4153. }
  4154. addHistory(pageE);
  4155. replaceElems(pageE);
  4156.  
  4157. // 插入图片
  4158. 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');;
  4159. for (let now of _img_arr) {_img += `<img src="${vg_r_data.dataset.chapterDomain}${img_pre}${now}">`;}
  4160. if (_img) {
  4161. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  4162. pageNum.now = pageNum._now + 1
  4163. }
  4164. }
  4165.  
  4166.  
  4167. // [漫画柜] 初始化(将本话其余图片插入网页中)
  4168. function manhuagui_init() {
  4169. // hook imgDate 代码
  4170. SMH.imgData = function(n) {window['imgDate'] = n;return{preInit:function(){}}}
  4171. // 重新执行本页的 imgDate 代码
  4172. insScript(curSite.pager.pageE);
  4173. let _img = '', imgPath = `${location.protocol}//i.hamreus.com${window['imgDate'].path}`;
  4174. //console.log(imgPath, window['imgDate'])
  4175. if (!(window['imgDate']) || !(imgPath)) return
  4176. // 遍历图片文件名数组,组合为 img 标签
  4177. 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}">`;}
  4178. // 插入并覆盖原来的一个图片
  4179. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  4180. pausePage = true;
  4181. }
  4182. // [漫画柜] 获取下一页地址
  4183. function manhuagui_nextL() {
  4184. if (window['imgDate'].nextId == 0) return
  4185. var url = location.origin + location.pathname.replace(window['imgDate'].cid.toString(), window['imgDate'].nextId.toString())
  4186. if (url === curSite.pageUrl) return
  4187. curSite.pageUrl = url
  4188. getPageE_(curSite.pageUrl);
  4189. }
  4190. // [漫画柜] 插入数据
  4191. function manhuagui_insertE(pageE, type) {
  4192. if (!pageE) return
  4193. // 重新执行本页的 imgDate 代码
  4194. insScript(curSite.pager.pageE, document.body, pageE);
  4195. let _img = '', imgPath = `${location.protocol}//i.hamreus.com${window['imgDate'].path}`;
  4196. //console.log(imgPath, window['imgDate'])
  4197. if (!(window['imgDate']) || !(imgPath)) return
  4198. // 遍历图片文件名数组,组合为 img 标签
  4199. 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}">`;}
  4200. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  4201. addHistory(pageE);
  4202. pageNum.now = pageNum._now + 1
  4203. }
  4204.  
  4205.  
  4206. // [36漫画] 初始化(将本话其余图片插入网页中)
  4207. function _36manga_init() {
  4208. let _img = '', imgPath = `${SinConf.resHost[0].domain[0]}${chapterPath}`;
  4209. if (!(chapterImages) || !(imgPath)) return
  4210. // 遍历图片文件名数组,组合为 img 标签
  4211. for (let i = 0; i < chapterImages.length; i++) {_img += `<img src="${imgPath}${chapterImages[i]}">`;}
  4212. // 插入并覆盖原来的一个图片
  4213. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  4214. pausePage = true;
  4215. }
  4216. // [36漫画] 获取下一页地址
  4217. function _36manga_nextL() {
  4218. if (!nextChapterData.id) return
  4219. var url = comicUrl + nextChapterData.id + '.html'
  4220. if (url === curSite.pageUrl) return
  4221. curSite.pageUrl = url
  4222. getPageE_(curSite.pageUrl);
  4223. }
  4224. // [36漫画] 插入数据
  4225. function _36manga_insertE(pageE, type) {
  4226. if (!pageE) return
  4227. // 插入并执行数据代码
  4228. insScript(curSite.pager.pageE, document.body, pageE);
  4229. let _img = '', imgPath = `${SinConf.resHost[0].domain[0]}${chapterPath}`;
  4230. if (!(chapterImages) || !(imgPath)) return
  4231. // 遍历图片文件名数组,组合为 img 标签
  4232. for (let i = 0; i < chapterImages.length; i++) {_img += `<img src="${imgPath}${chapterImages[i]}">`;}
  4233. // 插入并覆盖原来的一个图片
  4234. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  4235. addHistory(pageE);
  4236. pageNum.now = pageNum._now + 1
  4237. }
  4238.  
  4239.  
  4240. // [爱漫画] 获取全部图片
  4241. function imanhuaw_getIMG() {
  4242. let _img = '', _imgUrl;
  4243. for (let one of base64_decode(qTcms_S_m_murl_e).split("$qingtiandy$")) {
  4244. _imgUrl = one;
  4245. if (one.substring(0,1) == '/') {
  4246. _imgUrl = qTcms_m_weburl + _imgUrl;
  4247. } else {
  4248. if (qTcms_Pic_m_if != '2') {
  4249. one = one.replace(/\?/gi, 'a1a1');
  4250. one = one.replace(/&/gi, 'b1b1');
  4251. one = one.replace(/%/gi, 'c1c1');
  4252. let m_httpurl = '';
  4253. if (typeof(qTcms_S_m_mhttpurl) != 'undefined') m_httpurl = base64_decode(qTcms_S_m_mhttpurl);
  4254. if (location.hostname == 'www.ccshwy.com') qTcms_m_indexurl = 'http://h.ccshwy.com/';
  4255. _imgUrl = qTcms_m_indexurl + 'statics/pic/?p=' + escape(one) + '&picid=' + qTcms_S_m_id + '&m_httpurl=' + escape(m_httpurl);
  4256. } else {
  4257. _imgUrl = _imgUrl.replace('http:', '') ;
  4258. _imgUrl = _imgUrl.replace('https:', '');
  4259. }
  4260. }
  4261. _img += `<img src="${_imgUrl}">`;
  4262. }
  4263. return _img;
  4264. }
  4265. // [爱漫画] 初始化(调整本话其余图片)
  4266. function imanhuaw_init() {
  4267. getOne(curSite.pager.insertP[0]).outerHTML = imanhuaw_getIMG();
  4268. document.oncontextmenu = function(){}
  4269. }
  4270. // [爱漫画] 获取下一页地址
  4271. function imanhuaw_nextL() {
  4272. let next = location.origin + qTcms_Pic_nextArr
  4273. if (next && next != location.origin && next != curSite.pageUrl) {
  4274. curSite.pageUrl = next;
  4275. getPageE_(curSite.pageUrl);
  4276. }
  4277. }
  4278. // [爱漫画] 插入数据
  4279. function imanhuaw_insertE(pageE, type) {
  4280. if (!pageE) return
  4281. // 插入并运行 <script>
  4282. insScript('//head/script[not(@src)][contains(text(), "qTcms_S_m_murl_e")]', document.body, pageE);
  4283. // 将 img 标签插入到网页中
  4284. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), imanhuaw_getIMG());
  4285. addHistory(pageE);
  4286. pageNum.now = pageNum._now + 1
  4287. }
  4288.  
  4289.  
  4290. // [漫画 DB] 初始化(将本话其余图片插入网页中)
  4291. function manhuadb_init() {
  4292. let _img = '', data = getCSS('.vg-r-data'), imgDate;
  4293. if (!data) return
  4294. getAllCSS(curSite.pager.pageE.replace('', '')).forEach(function (one) {
  4295. if (one.tagName === 'SCRIPT' && one.textContent.indexOf('var img_data =') > -1) {
  4296. let json = JSON.parse(window.atob(one.textContent.split("'")[1]));
  4297. if (json) {
  4298. let _img = '';
  4299. 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}">`;}
  4300. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  4301. }
  4302. }
  4303. })
  4304. }
  4305. // [漫画 DB] 获取下一页地址
  4306. function manhuadb_nextL() {
  4307. let nextArr = getAllCSS('a.fixed-a-es'), next;
  4308. var url = '';
  4309. if (nextArr.length == 0) return
  4310. for (let i = 0; i < nextArr.length; i++) {
  4311. if (nextArr[i].className.indexOf('active') > -1) {
  4312. if (nextArr[i+1]) url = nextArr[i+1].href;
  4313. break;
  4314. }
  4315. }
  4316. if (url === curSite.pageUrl) return
  4317. curSite.pageUrl = url
  4318. getPageE_(curSite.pageUrl);
  4319. }
  4320. // [漫画 DB] 插入数据
  4321. function manhuadb_insertE(pageE, type) {
  4322. if (!pageE) return
  4323. if (replaceElems(pageE, curSite.pager.pageE, curSite.pager.pageE)) {
  4324. addHistory(pageE);
  4325. pageNum.now = pageNum._now + 1
  4326. manhuadb_init(); // 将刚刚替换的图片插入网页中
  4327. }
  4328. }
  4329.  
  4330.  
  4331. // [HiComic(嗨漫画)] 初始化(将本话其余图片插入网页中)
  4332. function hicomic_init() {
  4333. let _img = '';
  4334. getAllCSS('.chapter > section:not(:first-child) > section[val]').forEach(function (one) {
  4335. let src = one.getAttribute('val');
  4336. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h'
  4337. _img += `<img src="${src}">`
  4338. })
  4339. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  4340. window.document.title = window.document.title.replace(/(\(第.+\))? - HiComic/, `(${getCSS('.chapter_name').textContent}) - HiComic`); // 修改网页标题(加上 第 X 话)
  4341. }
  4342. // [HiComic(嗨漫画)] 获取下一页地址
  4343. function hicomic_nextL() {
  4344. let nextId;
  4345. nextId = getCSS('.next_chapter:not(.end)')
  4346. if (nextId && nextId.id && nextId.id != 'None') {
  4347. curSite.pageUrl = location.href;
  4348. getPageE_(`https://www.hicomic.net/api/web/chapter/${nextId.id}/contents`, 'json');
  4349. }
  4350. }
  4351. // [HiComic(嗨漫画)] 插入数据
  4352. function hicomic_insertE(pageE, type) {
  4353. if (!pageE || pageE.code != 200) return
  4354. if (pageE.results.chapter.next) { // 写入下一页的 UUID
  4355. getCSS('.next_chapter').id = pageE.results.chapter.next;
  4356. } else {
  4357. getCSS('.next_chapter').id = 'None';
  4358. getCSS('.next_chapter').classList.add('end');
  4359. }
  4360. curSite.pageUrl =`https://www.hicomic.net/chapters/${pageE.results.chapter.uuid}/contents`
  4361. getCSS('.chapter_name').textContent = pageE.results.chapter.name; // 修改漫画标题
  4362. addHistory(pageE, window.document.title.replace(/(\(第.+\))? - HiComic/, `(${pageE.results.chapter.name}) - HiComic`));
  4363. let _img = '';
  4364. for (let i = 0; i < pageE.results.chapter.contents.length; i++) { // 遍历图片文件名数组,组合为 img 标签
  4365. let src = pageE.results.chapter.contents[i].url;
  4366. if (src.indexOf('!p_c_c_') === -1) src += '!p_c_c_h';
  4367. _img += `<img src="${src}">`
  4368. }
  4369. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  4370. pageNum.now = pageNum._now + 1
  4371. }
  4372.  
  4373.  
  4374. // [动漫之家] 初始化(调整本话其余图片)
  4375. function dmzj_init(css) {
  4376. let _img = '';
  4377. getAllCSS(css).forEach(function (one) {_img += `<img src="${one.dataset.original}">`;})
  4378. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  4379. }
  4380. // [动漫之家] 插入数据
  4381. function dmzj_insertE(pageE, type) {
  4382. if (!pageE) return
  4383. // 插入并运行 <script>
  4384. insScript('head > script[type]:not([src])', document.body, pageE);
  4385.  
  4386. // 插入图片
  4387. let _img = '', _img_arr;
  4388. if (pages.indexOf('|') === -1) {
  4389. _img_arr = JSON.parse(pages.replace(/\r\n/g,'|')).page_url.split('|');
  4390. } else {
  4391. _img_arr = JSON.parse(pages).page_url.split('|');
  4392. }
  4393. for (let now of _img_arr) {
  4394. _img += `<img src="${img_prefix}${now}">`;
  4395. }
  4396. if (_img) {
  4397. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  4398. addHistory(pageE);
  4399. if (replaceElems(pageE)) pageNum.now = pageNum._now + 1
  4400. }
  4401. }
  4402. // [动漫之家-漫画] 插入数据
  4403. function dmzj_manhua_insertE(pageE, type) {
  4404. if (!pageE) return
  4405. // 插入并运行 <script>
  4406. insScript('head > script[type]:not([src])', document.body, pageE);
  4407.  
  4408. // 插入图片
  4409. let _img = '';
  4410. for (let now of arr_pages) {
  4411. _img += `<img src="${img_prefix}${now}">`;
  4412. }
  4413. if (_img) {
  4414. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  4415. addHistory(pageE);
  4416. if (replaceElems(pageE)) pageNum.now = pageNum._now + 1
  4417. }
  4418. }
  4419.  
  4420.  
  4421. // [优酷漫画] 初始化(调整本话其余图片)
  4422. function ykmh_init(css) {
  4423. let host = SinMH.getChapterImage(1).split('/')[0] + '//' + SinMH.getChapterImage(1).split('/')[2];
  4424. if (!host) return
  4425. let _img = '';
  4426. for (let one of chapterImages) {_img += `<img src="${host}${one}">`;}
  4427. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  4428. }
  4429. // [优酷漫画] 获取下一页地址
  4430. function ykmh_nextL() {
  4431. let url = comicUrl + nextChapterData.id + '.html'
  4432. if (url && url != '.html' && url != curSite.pageUrl) {
  4433. curSite.pageUrl = url;
  4434. getPageE_(curSite.pageUrl);
  4435. }
  4436. }
  4437. // [优酷漫画] 插入数据
  4438. function ykmh_insertE(pageE, type) {
  4439. //console.log(pageE)
  4440. if (!pageE) return
  4441. // 插入并运行 <script>
  4442. insScript('//script[contains(text(),"chapterImages")]', document.body, pageE);
  4443.  
  4444. let host = SinMH.getChapterImage(1).split('/')[0] + '//' + SinMH.getChapterImage(1).split('/')[2];
  4445. if (!host) host = document.querySelector(curSite.pager.insertP[0]).src.split('/')[0] + '//' + document.querySelector(curSite.pager.insertP[0]).src.split('/')[2]
  4446. // 插入图片
  4447. let _img = '';
  4448. for (let one of chapterImages) {_img += `<img src="${host}${one}">`;}
  4449. if (_img) {
  4450. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  4451. addHistory(pageE);
  4452. if (replaceElems(pageE)) pageNum.now = pageNum._now + 1
  4453. }
  4454. }
  4455.  
  4456.  
  4457. // [动漫戏说] 插入后函数(加载图片)
  4458. function acgn_aF() {
  4459. let old = getAllCSS('.pic[_src][id]'), _img = '';
  4460. if (old.length > 0) {
  4461. for (let now of old) {now.outerHTML = `<div class="pic" _src="${now.getAttribute('_src')}"><img src="${now.getAttribute('_src')}" class="img1"></div>`;}
  4462. }
  4463. }
  4464.  
  4465.  
  4466. // [漫画星球] 插入数据
  4467. function mhxqiu_insertE(pageE, type) {
  4468. if (!pageE) return
  4469. // 插入并运行 <script>
  4470. insScript('//script[contains(text(), "eval") and contains(text(), "newImgs")]', document.body, pageE);
  4471.  
  4472. // 插入图片
  4473. let _img = '';
  4474. 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>`;}
  4475. if (_img) {
  4476. // 将 img 标签插入到网页中
  4477. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  4478. addHistory(pageE);
  4479. pageNum.now = pageNum._now + 1
  4480. replaceElems(pageE)
  4481. }
  4482. }
  4483.  
  4484.  
  4485. // [风之动漫] 插入数据
  4486. function fffdm_insertE(pageE, type) {
  4487. if (!pageE) return
  4488. // 插入并运行 <script>
  4489. let scriptElems = getXpath('id("main")/script[contains(text(), "mhpicurl")][1]', pageE, pageE);
  4490. if (scriptElems) {
  4491. document.body.appendChild(document.createElement('script')).textContent = scriptElems.textContent.replace(/document\.write.+/, '');
  4492.  
  4493. // 插入图片
  4494. setTimeout(function() {
  4495. getOne(curSite.pager.insertP[0]).appendChild(document.createElement('img')).src = mhpicurl;
  4496. addHistory(pageE);
  4497. pageNum.now = pageNum._now + 1
  4498. replaceElems(pageE)
  4499. }, 100)
  4500. }
  4501. }
  4502.  
  4503.  
  4504. // [乐语漫画] 初始化(调整本话其余图片)
  4505. function leyuman_init() {
  4506. let _img = '';
  4507. for (let one of JSON.parse(z_img)) {
  4508. if (one.slice(0,4) === 'http') {
  4509. _img += `<img src="${one}">`;
  4510. } else {
  4511. _img += `<img src="https://img.shishi-life.com/${one}">`;
  4512. }
  4513. }
  4514. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  4515.  
  4516. }
  4517. // [乐语漫画] 插入数据
  4518. function leyuman_insertE(pageE, type) {
  4519. if (!pageE) return
  4520. // 插入并运行 <script>
  4521. insScript('//body//script[not(@src)][contains(text(), "z_img=")]', document.body, pageE);
  4522.  
  4523. // 插入图片
  4524. let _img = '';
  4525. for (let one of JSON.parse(z_img)) {
  4526. if (one.slice(0,4) === 'http') {
  4527. _img += `<img src="${one}">`;
  4528. } else {
  4529. _img += `<img src="https://img.shishi-life.com/${one}">`;
  4530. }
  4531. }
  4532. if (_img) {
  4533. // 将 img 标签插入到网页中
  4534. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  4535. addHistory(pageE);
  4536. pageNum.now = pageNum._now + 1
  4537. replaceElems(pageE)
  4538. }
  4539. }
  4540.  
  4541.  
  4542. // [新新漫画] 初始化(调整本话其余图片)
  4543. function _77mh_init() {
  4544. let _img = '';
  4545. for (let one of arr) {_img += `<img src="${img_qianz}${one}">`;}
  4546. getOne(curSite.pager.insertP[0]).innerHTML = _img;
  4547. }
  4548. // [新新漫画] 获取下一页地址
  4549. function _77mh_nextL() {
  4550. let next = nextLink_b
  4551. if (next && next != curSite.pageUrl) {
  4552. curSite.pageUrl = next;
  4553. getPageE_(curSite.pageUrl);
  4554. }
  4555. }
  4556. // [新新漫画] 插入数据
  4557. function _77mh_insertE(pageE, type) {
  4558. if (!pageE) return
  4559. // 插入并运行 <script>
  4560. insScript('//script[not(@src)][contains(text(), "eval(")]', document.body, pageE);
  4561.  
  4562. // 插入图片
  4563. let _img = '';
  4564. for (let one of msg.split('|')) {_img += `<img src="${img_qianz}${one}.webp">`;}
  4565. if (_img) {
  4566. // 将 img 标签插入到网页中
  4567. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img);
  4568. addHistory(pageE);
  4569. pageNum.now = pageNum._now + 1
  4570. }
  4571. }
  4572.  
  4573.  
  4574. // [古风漫画网] 获取下一页地址
  4575. function gufengmh_nextL() {
  4576. let pageE = getOne(curSite.pager.pageE); // 寻找数据所在元素
  4577. if (pageE) {
  4578. let comicUrl, nextId;
  4579. var url = '';
  4580. pageE.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  4581. //console.log(one)
  4582. if (one.indexOf('comicUrl') > -1) { // 下一页 URL 前半部分
  4583. comicUrl = one.split('"')[1];
  4584. } else if (one.indexOf('nextChapterData') > -1) { // 下一页 URL 的后半部分 ID
  4585. nextId = one.split('"id":')[1].split(',')[0];
  4586. }
  4587. })
  4588. if (comicUrl && nextId && nextId != 'null') { // 组合到一起就是下一页 URL
  4589. url = comicUrl + nextId + '.html'
  4590. if (url === curSite.pageUrl) return
  4591. curSite.pageUrl = url
  4592. getPageE_(curSite.pageUrl); // 访问下一页 URL 获取
  4593. }
  4594. }
  4595. }
  4596. // [古风漫画网] 插入数据
  4597. function gufengmh_insertE(pageE, type) {
  4598. if (pageE) {
  4599. let url = curSite.pageUrl;
  4600. pageE = getOne(curSite.pager.pageE, pageE, pageE);
  4601. let chapterImages, chapterPath;
  4602. getOne(curSite.pager.pageE).innerText = pageE.textContent; // 将当前网页内的数据所在元素内容改为刚刚获取的下一页数据内容,以便循环获取下一页 URL
  4603. pageE.textContent.split(';').forEach(function (one){ // 分号 ; 分割为数组并遍历
  4604. //console.log(one)
  4605. if (one.indexOf('chapterImages') > -1) { // 图片文件名数组
  4606. chapterImages = one.replace(/^.+\[/, '').replace(']', '').replaceAll('"', '').split(',')
  4607. } else if (one.indexOf('chapterPath') > -1) { // 图片文件路径
  4608. chapterPath = one.split('"')[1];
  4609. } else if (one.indexOf('pageTitle') > -1) { // 网页标题
  4610. addHistory(pageE, one.split('"')[1]);
  4611. }
  4612. })
  4613. if (chapterImages && chapterPath) {
  4614. let _img = '';
  4615. chapterImages.forEach(function (one2){_img += '<img src="https://res.xiaoqinre.com/' + chapterPath + one2 + '" data-index="0" style="display: inline-block;">';})
  4616. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  4617. pageNum.now = pageNum._now + 1
  4618. }
  4619. }
  4620. }
  4621.  
  4622.  
  4623. // [Mangabz 漫画] 初始化(调整本话图片)
  4624. function mangabz_init() {
  4625. let showimage = getCSS('#showimage'),
  4626. cp_img = getCSS('#cp_img'),
  4627. cp_image = getCSS('#cp_image');
  4628. if (showimage) {showimage.removeAttribute('oncontextmenu');}
  4629. if (cp_img) {cp_img.removeAttribute('oncontextmenu');}
  4630. if (cp_image) {
  4631. cp_image.removeAttribute('oncontextmenu');
  4632. cp_image.removeAttribute('id');
  4633. cp_image.removeAttribute('style');
  4634. }
  4635. }
  4636. // [Mangabz 漫画] 获取下一页地址
  4637. function mangabz_nextL() {
  4638. var url = '';
  4639. if (MANGABZ_PAGE === MANGABZ_IMAGE_COUNT) { // 下一话
  4640. if (getNextE('//a[./img[contains(@src, "icon_xiayizhang")]]')) getPageE_(curSite.pageUrl); // 访问下一话 URL 获取
  4641. } else { // 下一页
  4642. if (!mkey) var mkey = '';
  4643. 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}`
  4644. if (url === curSite.pageUrl) return
  4645. curSite.pageUrl = url
  4646. //console.log(curSite.pageUrl)
  4647. getPageE_(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
  4648. }
  4649. }
  4650. // [Mangabz 漫画] 插入数据
  4651. function mangabz_insertE(pageE, type) {
  4652. if (pageE) {
  4653. if (type === 'Next') { // 下一页
  4654. let imgArr = eval(pageE),
  4655. _img = '';
  4656. for (let now of imgArr) {_img += `<img src="${now}">`;}
  4657. if (_img) {
  4658. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  4659. MANGABZ_PAGE += imgArr.length;
  4660. addHistory(pageE, document.title, location.origin + MANGABZ_CURL.substring(0, MANGABZ_CURL.length - 1) + '-p' + MANGABZ_PAGE + '/');
  4661. }
  4662. } else { // 下一话
  4663. // 插入 <script> 标签
  4664. insScript('html:not([dir]) > head > script:not([src])', document.body, pageE);
  4665. addHistory(pageE);
  4666. pageNum.now = pageNum._now + 1
  4667. replaceElems(pageE)
  4668. MANGABZ_PAGE = 0;
  4669. mangabz_nextL();
  4670. }
  4671. }
  4672. }
  4673.  
  4674.  
  4675. // [动漫屋] 获取下一页地址
  4676. function dm5_nextL() {
  4677. var url = '';
  4678. if (DM5_PAGE === DM5_IMAGE_COUNT) { // 下一话
  4679. if (getNextE('//div[@class="view-paging"]//a[text()="下一章"]')) getPageE_(curSite.pageUrl); // 访问下一话 URL 获取
  4680. } else { // 下一页
  4681. if (!mkey) var mkey = '';
  4682. 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}`
  4683. if (url === curSite.pageUrl) return
  4684. curSite.pageUrl = url
  4685. //console.log(curSite.pageUrl)
  4686. getPageE_(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
  4687. }
  4688. }
  4689. // [动漫屋] 插入数据
  4690. function dm5_insertE(pageE, type) {
  4691. if (pageE) {
  4692. if (type === 'Next') { // 下一页
  4693. let imgArr = eval(pageE),
  4694. _img = '';
  4695. for (let now of imgArr) {_img += `<img src="${now}">`;}
  4696. if (_img) {
  4697. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  4698. DM5_PAGE += imgArr.length;
  4699. addHistory(pageE, document.title, location.origin + DM5_CURL.substring(0, DM5_CURL.length - 1) + '-p' + DM5_PAGE + '/');
  4700. }
  4701. } else { // 下一话
  4702. // 插入 <script> 标签
  4703. insScript('html:not([dir]) > head > script:not([src])', document.body, pageE);
  4704. addHistory(pageE);
  4705. pageNum.now = pageNum._now + 1
  4706. replaceElems(pageE)
  4707. DM5_PAGE = 0;
  4708. dm5_nextL();
  4709. }
  4710. }
  4711. }
  4712.  
  4713.  
  4714. // [Xmanhua 漫画] 获取下一页地址
  4715. function xmanhua_nextL() {
  4716. var url = '';
  4717. if (XMANHUA_PAGE === XMANHUA_IMAGE_COUNT) { // 下一话
  4718. if (getNextE('//a[./img[contains(@src, "reader-bottom-right-2.png")]]')) getPageE_(curSite.pageUrl); // 访问下一话 URL 获取
  4719. } else { // 下一页
  4720. if (!mkey) var mkey = '';
  4721. 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}`
  4722. if (url === curSite.pageUrl) return
  4723. curSite.pageUrl = url
  4724. //console.log(curSite.pageUrl)
  4725. getPageE_(curSite.pageUrl, 'text', 'GET', '', 'Next'); // 访问下一页 URL 获取
  4726. }
  4727. }
  4728. // [Xmanhua 漫画] 插入数据
  4729. function xmanhua_insertE(pageE, type) {
  4730. if (pageE) {
  4731. if (type === 'Next') { // 下一页
  4732. let imgArr = eval(pageE),
  4733. _img = '';
  4734. for (let now of imgArr) {_img += `<img src="${now}">`;}
  4735. if (_img) {
  4736. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  4737. XMANHUA_PAGE += imgArr.length;
  4738. addHistory(pageE, document.title, location.origin + XMANHUA_CURL.substring(0, XMANHUA_CURL.length - 1) + '-p' + XMANHUA_PAGE + '/');
  4739. }
  4740. } else { // 下一话
  4741. // 插入 <script> 标签
  4742. insScript('html:not([dir]) > head > script:not([src])', document.body, pageE);
  4743. addHistory(pageE);
  4744. pageNum.now = pageNum._now + 1
  4745. replaceElems(pageE)
  4746. XMANHUA_PAGE = 0;
  4747. xmanhua_nextL();
  4748. }
  4749. }
  4750. }
  4751.  
  4752.  
  4753. // [COCOMANGA 漫画] 初始化(调整本话图片)
  4754. function cocomanga_init() {
  4755. let last = getCSS('.mh_comicpic:last-of-type');
  4756. if (last && last.getAttribute('p')) {
  4757. getOne(curSite.pager.insertP[0]).innerHTML = ''; // 删除旧图片元素
  4758. cocomanga_img(parseInt(last.getAttribute('p'))) // 插入新图片元素
  4759. }
  4760. }
  4761. // [COCOMANGA 漫画] 生成图片元素并插入网页
  4762. function cocomanga_img(totalImageCount) {
  4763. if (totalImageCount < 1) return
  4764. let _img = '';
  4765. for (let i=1; i<=totalImageCount; i++) {_img += `<div class="mh_comicpic" p="${i}"><img src="${__cr.getPicUrl(i)}"></div>`;}
  4766. getOne(curSite.pager.insertP[0]).insertAdjacentHTML(getAddTo(curSite.pager.insertP[1]), _img); // 将 img 标签插入到网页中
  4767. }
  4768. // [COCOMANGA 漫画] 插入数据
  4769. function cocomanga_insertE(pageE, type) {
  4770. if (pageE) {
  4771. // 插入 <script> 标签
  4772. insScript('head > script:not([src]), script[src*="custom.js"], script[src*="dynamicjs.js"]', document.body, pageE);
  4773.  
  4774. // 插入新图片元素
  4775. setTimeout(function() {
  4776. let totalImageCount = __cdecrypt('fw122587mkertyui', CryptoJS.enc.Base64.parse(mh_info.enc_code1).toString(CryptoJS.enc.Utf8));
  4777. if (!totalImageCount) totalImageCount = __cdecrypt('fw12558899ertyui', CryptoJS.enc.Base64.parse(mh_info.enc_code1).toString(CryptoJS.enc.Utf8));
  4778. cocomanga_img(parseInt(totalImageCount));
  4779. }, 100)
  4780. addHistory(pageE);
  4781. pageNum.now = pageNum._now + 1
  4782. replaceElems(pageE)
  4783. }
  4784. }
  4785.  
  4786.  
  4787. // [国家自然科学基金] 获取下一页地址
  4788. function nsfc_nextL() {
  4789. let id = decodeURIComponent(document.location.href.split('/')[document.location.href.split('/').length - 1]), data
  4790. if (!document.nowPageNum) document.nowPageNum = 2
  4791. data = `id=${id}&index=${document.nowPageNum}`
  4792. if (data === curSite.pageUrl) return
  4793. curSite.pageUrl = data
  4794. getPageE_(location.origin + '/baseQuery/data/completeProjectReport', 'json', 'POST', data); // 访问下一页 URL 获取
  4795. }
  4796. // [国家自然科学基金] 插入数据
  4797. function nsfc_insertE(pageE, type) {
  4798. if (!pageE || pageE.code != 200) {curSite.SiteTypeID = 0; return}
  4799. if (!pageE.data.hasnext) {curSite.SiteTypeID = 0} else {document.nowPageNum++}
  4800. pageNum.now = pageNum._now + 1
  4801. 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}">`);
  4802. }
  4803.  
  4804.  
  4805.  
  4806. // [酷科研] 获取下一页地址
  4807. function coolkeyan_nextL() {
  4808. if (!getCSS('.q-img__image')) return
  4809. let id = getCSS('.q-breadcrumbs--last > span.q-breadcrumbs__el'), data
  4810. if (id && id.textContent) {id=parseInt(id.textContent)} else {return}
  4811. if (!document.nowPageNum) document.nowPageNum = 2
  4812. data = `ratify_no=${id}&index=${document.nowPageNum}`
  4813. if (data === curSite.pageUrl) return
  4814. curSite.pageUrl = data
  4815. getPageE_(location.origin + '/api/funds/nsfc/creport?' + data, 'json', 'GET'); // 访问下一页 URL 获取
  4816. }
  4817. // [酷科研] 插入数据
  4818. function coolkeyan_insertE(pageE, type) {
  4819. if (!pageE || pageE == {}) {curSite.SiteTypeID = 0; return}
  4820. if (!pageE.url) {curSite.SiteTypeID = 0; return} else {document.nowPageNum++}
  4821. pageNum.now = pageNum._now + 1
  4822. getCSS('.q-img>div[style*="padding-bottom"]').style.paddingBottom = `${(document.nowPageNum * 1000) - 1000}px`
  4823. 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>`);
  4824. }
  4825.  
  4826.  
  4827. // --------------------------------------------------------
  4828.  
  4829.  
  4830. // 自动无缝翻页
  4831. function pageLoading() {
  4832. if (curSite.SiteTypeID == 0) return
  4833. windowScroll(function (direction, e) {
  4834. // 下滑 且 未暂停翻页 且 SiteTypeID > 0 时,才准备翻页
  4835. if (direction != 'down' || !pausePage || curSite.SiteTypeID == 0) return
  4836. if (!curSite.pager.type) curSite.pager.type = 1; // 默认翻页模式 1
  4837. if (!curSite.pager.scrollD) curSite.pager.scrollD = 1500; // 默认翻页触发线 1500
  4838. // 翻页模式 5 且为框架内时,要判断顶层是否通过页码暂停翻页了
  4839. if (curSite.pager.type == 5 && self != top && window.top.document.xiu_pausePage == false) return
  4840.  
  4841. let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop,
  4842. scrollHeight = window.innerHeight || document.documentElement.clientHeight,
  4843. scrollD = curSite.pager.scrollD;
  4844. // <<<<< 翻页类型 3(依靠 [基准元素] 与 [浏览器可视区域底部] 之间的距离缩小来触发翻页)>>>>>
  4845. if (curSite.pager.type === 3) {
  4846. if (!curSite.pager.scrollE) curSite.pager.scrollE = curSite.pager.replaceE; // 默认基准元素是页码
  4847. let scrollE = getOne(curSite.pager.scrollE);
  4848. //console.log(scrollE.offsetTop, scrollE.offsetTop - (scrollTop + scrollHeight), scrollD, scrollTop + scrollHeight, curSite.SiteTypeID)
  4849. if (scrollE.offsetTop - (scrollTop + scrollHeight) <= scrollD) {intervalPause(); checkURL(getPageE);}
  4850.  
  4851. } else if (document.documentElement.scrollHeight <= scrollHeight + scrollTop + scrollD) {
  4852. // <<<<< 翻页类型 1(由脚本实现自动无缝翻页)>>>>>
  4853. if (curSite.pager.type === 1) {
  4854. intervalPause(); checkURL(getPageE);
  4855.  
  4856. // <<<<< 翻页类型 2(网站自带了自动无缝翻页功能,只需要点击下一页按钮即可)>>>>>
  4857. } else if (curSite.pager.type === 2) {
  4858. let autopbn = getOne(curSite.pager.nextL);
  4859. if (!autopbn) return
  4860. if (curSite.pager.isHidden && isHidden(autopbn)) return // 如果 isHidden = true,那么需要判断元素是否隐藏
  4861. if (curSite.pager.nextText) {
  4862. // 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页
  4863. if (autopbn.innerText === curSite.pager.nextText) {autopbn.click(); pageNum.now = pageNum._now + 1;}
  4864. } else if (curSite.pager.nextTextOf) {
  4865. // 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页
  4866. if (autopbn.innerText.indexOf(curSite.pager.nextTextOf) > -1) {autopbn.click(); pageNum.now = pageNum._now + 1;}
  4867. } else if (curSite.pager.nextHTML) {
  4868. // 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页
  4869. if (autopbn.innerHTML === curSite.pager.nextHTML) {autopbn.click(); pageNum.now = pageNum._now + 1;}
  4870. } else {
  4871. // 对于没有按钮文字变化的按钮,可以指定间隔时间(默认 300ms)
  4872. if (!curSite.pager.interval) curSite.pager.interval = 300;
  4873. intervalPause();
  4874. // 如果没有指定按钮文字就直接点击
  4875. autopbn.click(); pageNum.now = pageNum._now + 1;
  4876. }
  4877.  
  4878. // <<<<< 翻页类型 4(部分简单的动态加载类网站)>>>>>
  4879. } else if (curSite.pager.type === 4) {
  4880. // 为百度贴吧的发帖考虑,预留底部一小部分...
  4881. if (!(curSite.SiteTypeID === SiteType.BAIDU_TIEBA && document.documentElement.scrollHeight <= scrollHeight + scrollTop + 200)) {
  4882. intervalPause(); if (typeof curSite.pager.nextL == 'function') {curSite.pager.nextL();} else if (getNextE(curSite.pager.nextL)) {getPageE_(curSite.pageUrl);}
  4883. }
  4884.  
  4885. // <<<<< 翻页类型 5(插入 iframe 方式来加载下一页)>>>>>
  4886. } else if (curSite.pager.type === 5) {
  4887. checkURL(insIframe);
  4888.  
  4889. // <<<<< 翻页类型 6(通过 iframe 获取下一页动态加载内容)>>>>>
  4890. } else if (curSite.pager.type === 6) {checkURL(insIframe_);}
  4891. }
  4892. });
  4893.  
  4894. function intervalPause() {
  4895. if (curSite.pager.interval) {
  4896. pausePage = false
  4897. setTimeout(function(){pausePage = true;}, curSite.pager.interval)
  4898. }
  4899. }
  4900. }
  4901.  
  4902. // 翻页类型 1/3
  4903. function getPageE(url) {
  4904. GM_xmlhttpRequest({
  4905. url: url,
  4906. method: 'GET',
  4907. overrideMimeType: 'text/html; charset=' + document.charset,
  4908. headers: {
  4909. 'Referer': location.href,
  4910. 'User-Agent': navigator.userAgent
  4911. },
  4912. timeout: 10000,
  4913. onload: function (response) {
  4914. try {
  4915. //console.log('URL:' + url, '最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  4916. processElems(createDocumentByString(response.responseText));
  4917. } catch (e) {
  4918. console.error('[自动无缝翻页] - 处理获取到的下一页内容时出现问题,请检查!', e);
  4919. }
  4920. }
  4921. });
  4922. }
  4923. // 翻页类型 4
  4924. function getPageE_(url, type = '', method = 'GET', data = '', type2) {
  4925. let mimeType;
  4926. switch (type) {
  4927. case 'json':
  4928. mimeType = 'application/json; charset=' + document.charset; break;
  4929. case 'text':
  4930. mimeType = 'text/plain; charset=' + document.charset; break;
  4931. default:
  4932. mimeType = 'text/html; charset=' + document.charset;
  4933. }
  4934.  
  4935. GM_xmlhttpRequest({
  4936. url: url,
  4937. method: method,
  4938. data: data,
  4939. responseType: type,
  4940. overrideMimeType: mimeType,
  4941. headers: {
  4942. 'Referer': location.href,
  4943. 'Content-Type': (method === 'POST') ? 'application/x-www-form-urlencoded':'',
  4944. 'User-Agent': navigator.userAgent
  4945. },
  4946. timeout: 10000,
  4947. onload: function (response) {
  4948. try {
  4949. //console.log('最终 URL:' + response.finalUrl, '返回内容:' + response.responseText)
  4950. switch (type) {
  4951. case 'json':
  4952. curSite.pager.insertE(response.response, type2);
  4953. break;
  4954. case 'text':
  4955. curSite.pager.insertE(response.responseText, type2)
  4956. break;
  4957. default:
  4958. curSite.pager.insertE(createDocumentByString(response.responseText), type2)
  4959. }
  4960. } catch (e) {
  4961. console.log(e);
  4962. }
  4963. }
  4964. });
  4965. }
  4966. // 翻页类型 5(插入 iframe 方式加载下一页,无限套娃)
  4967. function insIframe(src) {
  4968. // 停用当前页面翻页
  4969. if (curSite.SiteTypeID == 0) return
  4970. curSite.SiteTypeID = 0;
  4971.  
  4972. // 创建 iframe
  4973. let iframe = document.createElement('iframe');
  4974. iframe.style = 'position: absolute; width: 100%; height: 100%; border: none;';
  4975. iframe.id = 'xiu_iframe';
  4976. iframe.src = src;
  4977.  
  4978. var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop
  4979. // 当滚动条到底部时(即完全显示 iframe 框架),隐藏当前页面的滚动条
  4980. window.addEventListener('scroll', function () {
  4981. let scrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  4982. clientHeight = document.documentElement.clientHeight || document.body.clientHeight,
  4983. scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight,
  4984. afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  4985. delta = afterScrollTop - beforeScrollTop;
  4986. if (delta == 0) return false;
  4987. beforeScrollTop = afterScrollTop;
  4988.  
  4989. //console.log(delta, (scrollTop + clientHeight + 10), scrollHeight, '1111')
  4990. if (delta > 0 && scrollTop + clientHeight + 10 >= scrollHeight && !getCSS('#xiu-scroll')) {
  4991. let newStyle = document.createElement('style'); newStyle.id = 'xiu-scroll';
  4992. newStyle.textContent = 'html::-webkit-scrollbar, body::-webkit-scrollbar {width: 0 !important;height: 0 !important;} html, body {scrollbar-width: none !important;}';
  4993. if (curSite.pager.style) newStyle.textContent += curSite.pager.style;
  4994. document.documentElement.appendChild(newStyle);
  4995. iframe.focus();
  4996. iframe.document.body.focus();
  4997. //iframe.document.body.click();
  4998. } else if (delta < 0 && getCSS('#xiu-scroll')) {
  4999. getCSS('#xiu-scroll').remove();
  5000. }
  5001. }, false);
  5002.  
  5003. // 加载完成后才继续
  5004. iframe.onload = function() {
  5005. // 添加历史记录
  5006. if (curSite.history !== false) addHistory(iframe.contentWindow.document, iframe.contentWindow.document.title);
  5007. // 当前页码 + 1
  5008. if (!curSite.hiddenPN) {
  5009. let autopageNumber = getCSS('#Autopage_number', window.top.document)
  5010. if (autopageNumber) {autopageNumber.textContent = parseInt(autopageNumber.textContent) + 1;}
  5011. }
  5012. }
  5013.  
  5014. // 插入 iframe
  5015. document.documentElement.appendChild(iframe);
  5016. }
  5017. // 翻页类型 6(通过 iframe 获取下一页动态加载内容,只有一个娃)
  5018. function insIframe_(src) {
  5019. // 暂停翻页
  5020. if (!pausePage) return
  5021. pausePage = false
  5022. //console.log(src)
  5023. // 如果不存在,则创建一个 iframe
  5024. let iframe = document.getElementById('xiu_iframe');
  5025. if (!iframe) {
  5026. iframe = document.createElement('iframe');
  5027. iframe.style = 'position: absolute; top: -9999px; left: -9999px; width: 100%; height: 100%; border: none; z-index: -999; /*visibility: hidden;*/';
  5028. iframe.id = 'xiu_iframe';
  5029. iframe.src = src;
  5030. }
  5031.  
  5032. // 加载完成后才继续
  5033. iframe.onload = function() {
  5034. //iframe.contentWindow.scrollTo(0, 999999); // 滚动到底部,以触发网页的滚动条相关加载事件
  5035. //iframe.contentWindow.scrollTo({top: 9999999, behavior: 'smooth'});
  5036. if (!curSite.pager.loadTime) curSite.pager.loadTime = 100; // 默认 100ms
  5037. //console.log(curSite.pager.loadTime, curSite.pager.loadTime/30)
  5038. //console.time('sort');
  5039. let time1 = 0 ,time2 = setInterval(function(){
  5040. let scrollHeight = (iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight)/10
  5041. iframe.contentWindow.scrollTo(0, 999999);
  5042. iframe.contentWindow.scrollTo(0, scrollHeight*time1);
  5043. //console.log(time1, iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight)
  5044. if (++time1 == 10) {
  5045. //console.timeEnd('sort');
  5046. clearInterval(time2);
  5047. processElems(iframe.contentWindow.document); // 插入/替换元素等
  5048. //console.log(iframe.contentWindow.document.documentElement.scrollHeight || iframe.contentWindow.document.body.scrollHeight)
  5049. pausePage = true; // 恢复翻页
  5050. }
  5051. }, curSite.pager.loadTime/10)
  5052. }
  5053.  
  5054. // 插入 iframe(如果已存在则直接改 src)
  5055. if (document.getElementById('xiu_iframe')) {
  5056. iframe.src = src;
  5057. } else {
  5058. document.documentElement.appendChild(iframe);
  5059. }
  5060. }
  5061.  
  5062.  
  5063. // XHR 后处理结果,插入、替换元素等(适用于翻页类型 1/3/6)
  5064. function processElems(response) {
  5065. if (!curSite.pager.insertP) {curSite.pager.insertP = [curSite.pager.pageE, 5]}
  5066. let pageE = getAll(curSite.pager.pageE, response, response), toE;
  5067. if (curSite.pager.insertP[1] === 5) { // 插入 pageE 列表最后一个元素的后面
  5068. toE = getAll(curSite.pager.insertP[0]).pop();
  5069. } else {
  5070. toE = getOne(curSite.pager.insertP[0]);
  5071. }
  5072. //console.log(curSite.pager.pageE, pageE, curSite.pager.insertP, toE)
  5073.  
  5074. if (pageE.length > 0 && toE) {
  5075. // 如果有插入前函数就执行函数
  5076. if (curSite.function && curSite.function.bF) {
  5077. if (curSite.function.bFp) { // 如果指定了参数
  5078. if (typeof(curSite.function.bF) == 'string') { // 如果是字符串,说明是自定义规则
  5079. pageE = new Function('pageE', 'bFp', 'fun', curSite.function.bF)(pageE, curSite.function.bFp, window.autoPage)
  5080. } else {
  5081. pageE = curSite.function.bF(pageE, curSite.function.bFp);
  5082. }
  5083. } else {
  5084. if (typeof(curSite.function.bF) == 'string') { // 如果是字符串,说明是自定义规则
  5085. pageE = new Function('pageE', 'fun', curSite.function.bF)(pageE, window.autoPage)
  5086. } else {
  5087. pageE = curSite.function.bF(pageE);
  5088. }
  5089. }
  5090. }
  5091.  
  5092. // 插入位置
  5093. let addTo = getAddTo(curSite.pager.insertP[1]);
  5094.  
  5095. // 插入新页面元素
  5096. if (curSite.pager.insertP[1] === 6) { // 插入到目标内部末尾(针对文本,比如小说网页)
  5097. let afterend = '';
  5098. if (curSite.pager.insertP6Br) afterend += '<br/><br/>'
  5099. pageE.forEach(function (one) {afterend += one.innerHTML;});
  5100. toE.insertAdjacentHTML(addTo, afterend);
  5101. } else {
  5102. if (curSite.pager.insertP[1] === 2 || curSite.pager.insertP[1] === 4 || curSite.pager.insertP[1] === 5) pageE.reverse(); // 插入到 [元素内头部]、[目标本身后面] 时,需要反转顺序
  5103. pageE.forEach(function (one) {toE.insertAdjacentElement(addTo, one);});
  5104. }
  5105.  
  5106. // 当前页码 + 1
  5107. pageNum.now = pageNum._now + 1
  5108.  
  5109. // 添加历史记录
  5110. if (curSite.history !== false) addHistory(response);
  5111.  
  5112. // 替换待替换元素
  5113. if (curSite.pager.replaceE) replaceElems(response);
  5114.  
  5115. // 插入 <script> 标签
  5116. if (curSite.pager.scriptT || curSite.pager.scriptT == 0) {
  5117. switch (curSite.pager.scriptT) {
  5118. case 0: // 下一页的所有 <script> 标签
  5119. insScript('script', toE, response); break;
  5120. case 1: // 下一页的所有 <script> 标签(不包括 src 链接)
  5121. insScript('script:not([src])', toE, response); break;
  5122. case 2: // 下一页主体元素 (pageE) 的同级 <script> 标签
  5123. insScript(null, toE, pageE); break;
  5124. case 3: // 下一页主体元素 (pageE) 的子元素 <script> 标签
  5125. insScript('script:not([src])', toE, pageE); break;
  5126. }
  5127. }
  5128.  
  5129. // 如果有插入后函数就执行函数
  5130. if (curSite.function && curSite.function.aF) {
  5131. if (curSite.function.aFp) { // 如果指定了参数
  5132. if (typeof(curSite.function.aF) == 'string') { // 如果是字符串,说明是自定义规则
  5133. new Function('aFp', 'fun', curSite.function.aF)(curSite.function.aFp, window.autoPage)
  5134. } else {
  5135. curSite.function.aF(curSite.function.aFp);
  5136. }
  5137. } else {
  5138. if (typeof(curSite.function.aF) == 'string') { // 如果是字符串,说明是自定义规则
  5139. new Function('fun', curSite.function.aF)(window.autoPage);
  5140. } else {
  5141. curSite.function.aF();
  5142. }
  5143. }
  5144. }
  5145. } else { // 获取主体元素失败后,尝试重新获取
  5146. console.log(curSite.pager.pageE, pageE, curSite.pager.insertP, toE)
  5147. if (curSite.retry) {
  5148. console.warn('[自动无缝翻页] 获取主体元素失败,尝试重新获取...')
  5149. setTimeout(function(){curSite.pageUrl = '';}, curSite.retry)
  5150. } else { // 尝试替换元素看能不能继续翻页下去
  5151. if (curSite.pager.replaceE) {
  5152. if (replaceElems(response)) { // 如果替换成功
  5153. console.log('[自动无缝翻页] 获取主体元素失败,尝试替换元素成功!')
  5154. pageNum.now = pageNum._now + 1; // 当前页码 + 1
  5155. if (curSite.history !== false) addHistory(response); // 添加历史记录
  5156. } else {console.error('[自动无缝翻页] 获取主体元素失败,尝试替换元素失败...')}
  5157. }
  5158. }
  5159. }
  5160. }
  5161. // 通用型插入前函数(加载图片)
  5162. function src_bF(pageE, css) {
  5163. pageE.forEach(function (one) {
  5164. if (css[0] == 0) { // src 图片
  5165. if (one.tagName == 'IMG' && one.getAttribute(css[2])) one.src = one.getAttribute(css[2]);
  5166. one.querySelectorAll(css[1]).forEach(function (now) {
  5167. now.src = now.getAttribute(css[2]);
  5168. });
  5169. } else if (css[0] == 1) { // 背景图片
  5170. if (one.tagName == 'IMG' && one.getAttribute(css[2])) one.style.backgroundImage = 'url("' + one.getAttribute(css[2]) + '")';
  5171. one.querySelectorAll(css[1]).forEach(function (now) {
  5172. now.style.backgroundImage = 'url("' + now.getAttribute(css[2]) + '")';
  5173. });
  5174. }
  5175. });
  5176. return pageE
  5177. }
  5178. // 文字型插入前函数(正则过滤)
  5179. function xs_bF(pageE, reg) {
  5180. pageE.forEach(function (one) {
  5181. one.innerHTML = one.innerHTML.replace(reg[0], reg[1])
  5182. });
  5183. return pageE
  5184. }
  5185.  
  5186. // 通用型获取下一页地址(从 元素 中获取页码)
  5187. function getNextE(css) {
  5188. if (!css) css = curSite.pager.nextL;
  5189. let next = getOne(css);
  5190. if (next && next.nodeType === 1 && next.href && next.href.slice(0,4) === 'http' && next.href != curSite.pageUrl) {
  5191. if (curSite.pager.forceHTTPS && location.protocol === 'https:') {
  5192. curSite.pageUrl = next.href.replace(/^http:/,'https:');
  5193. } else {
  5194. curSite.pageUrl = next.href;
  5195. }
  5196. //console.log(curSite.pageUrl)
  5197. return true
  5198. }
  5199. return false
  5200. }
  5201. // 通用型获取下一页地址(从 元素 中获取页码,URL 替换 page= 参数)
  5202. function getNextEP(css, pf, reg) {
  5203. let nextNum = getOne(css), url = '';
  5204. if (nextNum && nextNum.textContent) {
  5205. nextNum = nextNum.textContent.replaceAll(' ','');
  5206. if (location.search) {
  5207. if (indexOF(pf, 's')) {
  5208. url = location.search.replace(reg, pf + nextNum);
  5209. } else {
  5210. url = location.search + '&' + pf + nextNum;
  5211. }
  5212. } else {
  5213. url = '?' + pf + nextNum;
  5214. }
  5215. url = location.origin + location.pathname + url;
  5216. }
  5217. return url
  5218. }
  5219. // 通用型获取下一页地址(从 元素 中获取页码,URL 替换 pathname 路径)
  5220. function getNextEPN(css, reg, a, b = '') {
  5221. let nextNum = getOne(css), url = '';
  5222. if (nextNum && nextNum.textContent) {
  5223. nextNum = nextNum.textContent.replaceAll(' ','');
  5224. if (location.pathname) {
  5225. if (indexOF(reg)) {
  5226. url = location.pathname.replace(reg, a + nextNum + b);
  5227. } else {
  5228. url = location.pathname + a + nextNum + b;
  5229. }
  5230. } else {
  5231. url = location.pathname + a + nextNum + b;
  5232. }
  5233. url = location.origin + url;
  5234. }
  5235. return url
  5236. }
  5237. // 通用型获取下一页地址(从 URL 中获取页码,URL 替换 pathname 路径)
  5238. function getNextUPN(reg1, reg, a, b = '', initP = '2', endP) {
  5239. let nextNum = reg1.exec(location.pathname);
  5240. if (nextNum) {
  5241. nextNum = String(parseInt(nextNum[0])+1);
  5242. if (endP && (parseInt(nextNum[0]) > parseInt(endP))) return ''
  5243. } else {
  5244. nextNum = initP;
  5245. if (endP && (parseInt(nextNum[0]) >= parseInt(endP))) return ''
  5246. }
  5247. let url = '';
  5248. if (location.pathname) {
  5249. if (indexOF(reg)) {
  5250. url = location.pathname.replace(reg, a + nextNum + b);
  5251. } else {
  5252. url = location.pathname + a + nextNum + b;
  5253. }
  5254. } else {
  5255. url = location.pathname + a + nextNum + b;
  5256. }
  5257. url = location.origin + url;
  5258. return url
  5259. }
  5260. // 通用型获取下一页地址(从 URL 中获取页码,URL 替换 page= 参数)
  5261. function getNextUP(pf, reg, lp = location.pathname, initP = '2', endP) {
  5262. let nextNum = getSearch(pf.replace('=',''));
  5263. if (nextNum) {
  5264. nextNum = String(parseInt(nextNum)+1);
  5265. if (endP && (parseInt(nextNum) > parseInt(endP))) return ''
  5266. } else {
  5267. nextNum = initP;
  5268. if (endP && (parseInt(nextNum) >= parseInt(endP))) return ''
  5269. }
  5270. let url = '';
  5271. if (location.search) {
  5272. if (indexOF(pf, 's')) {
  5273. url = location.search.replace(reg, pf + nextNum);
  5274. } else {
  5275. url = location.search + '&' + pf + nextNum;
  5276. }
  5277. } else {
  5278. url = '?' + pf + nextNum;
  5279. }
  5280. url = location.origin + lp + url;
  5281. return url
  5282. }
  5283. // 通用型获取下一页地址(从 form input 中获取,返回 GET URL)
  5284. function getNextF(css) {
  5285. let form = getOne(css), value = '';
  5286. if (form) {
  5287. form.querySelectorAll('input[name]').forEach(function(input) {value += input.name + '=' + input.value + '&';}) // 生成表单参数
  5288. value = encodeURI(value.replace(/&$/,'')); // 清理最后一个 & 符号
  5289. if (form.action && value) return (form.action + '?' + value)
  5290. }
  5291. return '';
  5292. }
  5293.  
  5294.  
  5295. // 检查 URL
  5296. function checkURL(func) {
  5297. if (typeof curSite.pager.nextL == 'function') {
  5298. let tempUrl = curSite.pager.nextL();
  5299. if (!tempUrl || (tempUrl && tempUrl.slice(0,4) != 'http') || tempUrl === curSite.pageUrl) return;
  5300. curSite.pageUrl = tempUrl;
  5301. func(curSite.pageUrl);
  5302. } else if (curSite.pager.nextL && curSite.pager.nextL.search(/^js;/i) === 0) { // 自定义翻页规则中执行 JavaScript 代码的
  5303. try {
  5304. let tempUrl = new Function('fun', curSite.pager.nextL.slice(3))(window.autoPage);
  5305. if (!tempUrl || (tempUrl && tempUrl.slice(0,4) != 'http') || tempUrl === curSite.pageUrl) return;
  5306. curSite.pageUrl = tempUrl;
  5307. func(curSite.pageUrl);
  5308. } catch (e) {
  5309. console.error('[自动无缝翻页] - 当前网页规则 "nextL" 内 JS 代码有误,请检查!', e);
  5310. }
  5311. } else if (getNextE()) {
  5312. func(curSite.pageUrl);
  5313. }
  5314. //console.log(curSite.pageUrl);
  5315. }
  5316. // 替换元素
  5317. function replaceElems(pageE, o = curSite.pager.replaceE, r = curSite.pager.replaceE) {
  5318. let oE = getAll(o),
  5319. rE = getAll(r, pageE, pageE);
  5320. //console.log(oE, rE)
  5321. if (oE.length != 0 && rE.length != 0 && oE.length === rE.length) {
  5322. for (let i = 0; i < oE.length; i++) {
  5323. oE[i].outerHTML = rE[i].outerHTML;
  5324. }
  5325. return true
  5326. }
  5327. return false
  5328. }
  5329. // 添加历史记录
  5330. function addHistory(pageE, title, url) {
  5331. if (!curSite.pageUrl) return
  5332. // 对于自带类似功能 或者 覆盖了 history 原生函数的网站,则跳过不再添加历史记录
  5333. if (window.top.history.toString() !== '[object History]') return
  5334.  
  5335. //console.log(pageE.querySelector('title'), curSite.pageUrl)
  5336. title = title || pageE.querySelector('title').textContent || window.top.document.title;
  5337. url = url || curSite.pageUrl;
  5338. window.top.document.title = title;
  5339. window.top.document.xiu_nowUrl = curSite.pageUrl;
  5340. window.top.history.pushState('xiu_history', title, url);
  5341. }
  5342. // 插入 <Script>
  5343. function insScript(selector, toE = document.body, contextNode = document) {
  5344. let scriptElems = contextNode;
  5345. if (selector) {
  5346. if (contextNode instanceof Array) {
  5347. scriptElems = []; contextNode.forEach(function (one) {scriptElems = scriptElems.concat(getAll(selector, one, one));})
  5348. } else {
  5349. scriptElems = getAll(selector, contextNode, contextNode);
  5350. }
  5351. }
  5352. scriptElems.forEach(function (one) {
  5353. if (one.tagName === 'SCRIPT') {
  5354. if (one.src) {
  5355. toE.appendChild(document.createElement('script')).src = one.src;
  5356. } else {
  5357. toE.appendChild(document.createElement('script')).textContent = one.textContent;
  5358. }
  5359. }
  5360. });
  5361. }
  5362. // 插入 <Style>
  5363. function insStyle(style) {
  5364. document.documentElement.appendChild(document.createElement('style')).textContent = style;
  5365. }
  5366.  
  5367.  
  5368. // 获取元素(CSS/Xpath)来自:https://github.com/machsix/Super-preloader
  5369. function getCSS(css, contextNode = document) {
  5370. return contextNode.querySelector(css);
  5371. }
  5372. function getAllCSS(css, contextNode = document) {
  5373. return [].slice.call(contextNode.querySelectorAll(css));
  5374. }
  5375. function getXpath(xpath, contextNode, doc = document) {
  5376. contextNode = contextNode || doc;
  5377. try {
  5378. const result = doc.evaluate(xpath, contextNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  5379. // 应该总是返回一个元素节点
  5380. return result.singleNodeValue && result.singleNodeValue.nodeType === 1 && result.singleNodeValue;
  5381. } catch (err) {
  5382. throw new Error(`无效 Xpath: ${xpath}`);
  5383. }
  5384. }
  5385. function getAllXpath(xpath, contextNode, doc = document) {
  5386. contextNode = contextNode || doc;
  5387. const result = [];
  5388. try {
  5389. const query = doc.evaluate(xpath, contextNode, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  5390. for (let i = 0; i < query.snapshotLength; i++) {
  5391. const node = query.snapshotItem(i);
  5392. // 如果是 Element 节点
  5393. if (node.nodeType === 1) result.push(node);
  5394. }
  5395. } catch (err) {
  5396. throw new Error(`无效 Xpath: ${xpath}`);
  5397. }
  5398. return result;
  5399. }
  5400. function getOne(selector, contextNode = undefined, doc = document) {
  5401. if (!selector) return;
  5402. contextNode = contextNode || doc;
  5403. if (selector.slice(0,1) === '/' || selector.slice(0,2) === './' || selector.slice(0,3) === 'id(') {
  5404. return getXpath(selector, contextNode, doc);
  5405. } else {
  5406. return getCSS(selector, contextNode);
  5407. }
  5408. }
  5409. function getAll(selector, contextNode = undefined, doc = document) {
  5410. if (!selector) return [];
  5411. contextNode = contextNode || doc;
  5412. if (selector.slice(0,1) === '/' || selector.slice(0,2) === './' || selector.slice(0,3) === 'id(') {
  5413. return getAllXpath(selector, contextNode, doc);
  5414. } else {
  5415. return getAllCSS(selector, contextNode);
  5416. }
  5417. }
  5418. function createDocumentByString(e) {
  5419. if (e) {
  5420. if ('HTML' !== document.documentElement.nodeName) return (new DOMParser).parseFromString(e, 'application/xhtml+xml');
  5421. var t;
  5422. try { t = (new DOMParser).parseFromString(e, 'text/html');} catch (e) {}
  5423. if (t) return t;
  5424. if (document.implementation.createHTMLDocument) {
  5425. t = document.implementation.createHTMLDocument('ADocument');
  5426. } else {
  5427. 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) {}
  5428. }
  5429. if (t) {
  5430. var r = document.createRange(),
  5431. n = r.createContextualFragment(e);
  5432. r.selectNodeContents(document.body);
  5433. t.body.appendChild(n);
  5434. 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);
  5435. return t;
  5436. }
  5437. } else console.error('没有找到要转成 DOM 的字符串');
  5438. }
  5439.  
  5440.  
  5441. // 强制新标签页打开链接(翻页模式 5/6)
  5442. function forceTarget() {
  5443. document.body.addEventListener('click', function(e) {
  5444. if (e.target.tagName === 'A') {
  5445. forceTarget_(e.target, e);
  5446. } else {
  5447. let path = e.path || e.composedPath();
  5448. for (let i = 1; i < path.length - 3; i++) {
  5449. //console.log(path[i])
  5450. if (path[i].tagName === 'A') {
  5451. forceTarget_(path[i], e);
  5452. break;
  5453. }
  5454. }
  5455. }
  5456. });
  5457.  
  5458. function forceTarget_(target, e){
  5459. if (target.href && target.target != '_blank' && !(target.getAttribute('onclick')) && target.href.slice(0,4) == 'http' && target.getAttribute('href').slice(0,1) != '#') {
  5460. e.preventDefault(); // 阻止默认打开链接事件
  5461. //console.log(target.href);
  5462. //window.top.location.href = target.href;
  5463. window.GM_openInTab(target.href, {active: true,insert: true,setParent: true});
  5464. }
  5465. }
  5466. //document.head.appendChild(document.createElement('base')).target = '_top';
  5467. }
  5468. // 判断元素是否隐藏(隐藏返回 true)
  5469. function isHidden(el){
  5470. return (el.offsetParent === null);
  5471. }
  5472. // 判断是否为手机版(是则返回 true)
  5473. function isMobile(){
  5474. 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));
  5475. }
  5476. // 判断 URL 是否存在指定文本
  5477. function indexOF(e, l = 'p', low = false){
  5478. switch (l) {
  5479. case 'h':
  5480. l = location.href; break;
  5481. case 'p':
  5482. l = location.pathname; break;
  5483. case 's':
  5484. l = location.search; break;
  5485. }
  5486. //console.log(l,e,l.indexOf(e))
  5487. if (low) {e = e.toLowerCase(); l = l.toLowerCase();} // 全部转为小写
  5488. if (e instanceof RegExp) {
  5489. if (e.test(l)) return true
  5490. } else {
  5491. if (l.indexOf(e) > -1) return true
  5492. }
  5493. return false
  5494. }
  5495. // 获取 Search 指定参数
  5496. function getSearch(variable) {
  5497. let query = window.location.search.substring(1),
  5498. vars = query.split('&');
  5499. for (var i=0;i<vars.length;i++) {
  5500. var pair = vars[i].split('=');
  5501. if(pair[0] == variable){return pair[1];}
  5502. }
  5503. return '';
  5504. }
  5505. // 启用/禁用 (当前网站)
  5506. function menu_disable(type) {
  5507. switch(type) {
  5508. case 'check':
  5509. return check(); break;
  5510. case 'add':
  5511. add(); break;
  5512. case 'del':
  5513. del(); break;
  5514. }
  5515.  
  5516. function check() { // 存在返回真,不存在返回假
  5517. if (GM_getValue('menu_disable').indexOf(location.hostname) == -1) return false // 不存在返回假
  5518. return true
  5519. }
  5520.  
  5521. function add() {
  5522. if (check()) return
  5523. let list = GM_getValue('menu_disable'); // 读取网站列表
  5524. list.push(location.hostname); // 追加网站域名
  5525. GM_setValue('menu_disable', list); // 写入配置
  5526. location.reload(); // 刷新网页
  5527. }
  5528.  
  5529. function del() {
  5530. if (!check()) return
  5531. let list = GM_getValue('menu_disable'), // 读取网站列表
  5532. index = list.indexOf(location.hostname);
  5533. list.splice(index, 1); // 删除网站域名
  5534. GM_setValue('menu_disable', list); // 写入配置
  5535. location.reload(); // 刷新网页
  5536. }
  5537. }
  5538. // 左键双击网页空白处暂停翻页
  5539. function pausePageEvent() {
  5540. if (!GM_getValue('menu_pause_page')) return
  5541. if (curSite.SiteTypeID === 0) return
  5542. if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
  5543. document.body.addEventListener('dblclick', function () {
  5544. if (pausePage) {GM_notification({text: `❌ 已暂停本页 [自动无缝翻页]\n (再次双击可恢复)`, timeout: 2000});} else {GM_notification({text: `✅ 已恢复本页 [自动无缝翻页]\n (再次双击可暂停)`, timeout: 2000});}
  5545. pausePage = !pausePage;
  5546. if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
  5547. });
  5548. }
  5549. // 自定义翻页规则
  5550. function customRules() {
  5551. if (getCSS('#Autopage_customRules')) return
  5552. // 改名过渡,过段时间将其移除
  5553. let customRules = JSON.stringify(GM_getValue('menu_customRules', {}), null, '\t').replaceAll('functionS', 'url').replaceAll('css;', '');
  5554. if (customRules == '{}') customRules = '{\n\t\n}'; // 引导用户插入位置
  5555. 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;">
  5556. <h3 style="font-size: 22px !important;"><strong># 自定义翻页规则(优先级最高,但前提是 "规则名" 不能重复)-【将规则插入默认的 <code>{ }</code> 中间】</strong></h3>
  5557. <details>
  5558. <summary><kbd><strong>「 点击展开 查看示例 」(我把常用规则都塞进去了,方便需要的时候可直接复制一份修改使用)</strong></kbd></summary>
  5559. <ul style="list-style: disc !important; margin-left: 35px !important;">
  5560. <li>翻页规则为 JSON 格式,因此大家需要多少<strong>了解一点 JSON 的基本格式</strong>(主要就是逗号、转义、双引号等)。</li>
  5561. <li>具体的翻页规则说明、示例,为了方便更新及补充,我都写到 <strong><a href="https://github.com/XIU2/UserScript/issues/176" target="_blank">Github</a></strong> 里面了。</li>
  5562. <li>脚本会自动格式化规则,因此<strong>无需手动缩进、换行</strong>,只需把规则<strong>插入默认的 { } 中间</strong>即可。</li>
  5563. <li style="color: #ff3535 !important;">注意:目前自定义翻页规则处于 Beta 阶段,随时可能调整规则格式/语法,具体请关注上面的 Github 链接。</li>
  5564. </ul>
  5565. <pre>
  5566. // 大多数网站一般都只需要像第一个 "aaa" 这样的规则(注意,不要连带着复制这几行注释说明)
  5567. // "aaa" 是规则名,唯一!不能重复!否则会被 外置/内置规则 覆盖,支持中文等各种字符
  5568. // "url" 是用来控制哪些网站中页面适用该规则,省略后代表该规则应用于全站
  5569. // "scrollD" 是用来控制翻页敏感度的(越大就越早触发翻页,访问速度慢的网站需要调大,可省略(注意逗号),默认 1500)
  5570. {
  5571. "aaa": {
  5572. "host": "aaa.com",
  5573. "url": "/xxx/",
  5574. "pager": {
  5575. "nextL": "xxx",
  5576. "pageE": "xxx",
  5577. "replaceE": "xxx",
  5578. "scrollD": 1000
  5579. }
  5580. },
  5581. "bbb": {
  5582. "host": ["bbb1.com", "bbb2.com"],
  5583. "url": "/^\\/s$/",
  5584. "style": ".aaaa {display: none !important;}",
  5585. "pager": {
  5586. "type": 1,
  5587. "nextL": "id('page')//a[contains(text(),'下一页') or text()='下一页']",
  5588. "pageE": "aaa",
  5589. "insertP": [".bbb",3],
  5590. "replaceE": ".page",
  5591. "scriptT": 1,
  5592. "interval": 500,
  5593. "scrollD": 1500
  5594. },
  5595. "function": {
  5596. "bF": "return fun.src_bF(pageE, [0,'img[data-src]','data-src'])",
  5597. "aF": "document.body.appendChild(document.createElement('script')).textContent = 'xxx'"
  5598. }
  5599. },
  5600. "这里也可以用中文": {
  5601. "host": "/\\.ccc\\.com/",
  5602. "url": "return (fun.lp() == '/' || fun.indexOF('/s'))",
  5603. "pager": {
  5604. "type": 2,
  5605. "nextL": "#autopbn",
  5606. "nextText": "下一页",
  5607. "nextTextOf": "下一页",
  5608. "interval": 1000,
  5609. "scrollD": 1500
  5610. }
  5611. }
  5612. }
  5613. </pre>
  5614. </details>
  5615.  
  5616. <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>
  5617. <button id="Autopage_customRules_save" style="margin-right: 20px !important;">保存并刷新</button><button id="Autopage_customRules_cancel">取消修改</button>
  5618. </div>`
  5619. document.documentElement.insertAdjacentHTML('beforeend', _html);
  5620. document.documentElement.style.overflow = document.body.style.overflow = 'hidden';
  5621. // 点击事件
  5622. getCSS('#Autopage_customRules_save').onclick = function () {
  5623. // 改名过渡,过段时间将其移除
  5624. customRules = getCSS('#Autopage_customRules_textarea').value.replaceAll('functionS', 'url').replaceAll('css;', '');
  5625. //console.log(customRules)
  5626. if (!customRules) customRules = '{}'
  5627. try {
  5628. customRules = JSON.parse(customRules)
  5629. //console.log(customRules)
  5630. GM_setValue('menu_customRules', customRules)
  5631. location.reload();
  5632. } catch (e) {
  5633. console.error('自定义规则存在格式错误:\n' + e + '\n\n格式错误一般为:\n· 逗号:每组 {} 中的最后一个值末尾不能加逗号\n\n· 转义:如果正则表达式中含有转义符 \\ 那就要对其再次转义为 \\\\\n\n· 双引号:规则中冒号左右的内容都需要加上双引号,如果内容中含有双引号则需要对双引号转义(即 \\" 这样),或改为单引号')
  5634. window.alert('自定义规则存在格式错误:\n' + e + '\n\n格式错误一般为:\n· 逗号:每组 {} 中的最后一个值末尾不能加逗号\n\n· 转义:如果正则表达式中含有转义符 \\ 那就要对其再次转义为 \\\\\n\n· 双引号:规则中冒号左右的内容都需要加上双引号,如果内容中含有双引号则需要对双引号转义(即 \\" 这样),或改为单引号');
  5635. }
  5636. }
  5637. getCSS('#Autopage_customRules_cancel').onclick = function () {document.documentElement.style.overflow = document.body.style.overflow = ''; getCSS('#Autopage_customRules').remove();}
  5638. }
  5639. // 显示页码
  5640. function pageNumber(type) {
  5641. 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}
  5642. let status = getCSS('#Autopage_number');
  5643. switch (type) {
  5644. case 'add':
  5645. add(); break;
  5646. case 'del':
  5647. del(); break;
  5648. case 'set':
  5649. set(); break;
  5650. }
  5651.  
  5652. function add(){
  5653. if (status) {
  5654. if (status.style.display === 'none') {status.style.display = 'flex';}
  5655. return
  5656. }
  5657. // 插入网页
  5658. 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>`,
  5659. _html = `<div id="Autopage_number" title="1. 此处数字为 [当前页码] (可在脚本菜单中关闭)&#10;&#10;2. 鼠标左键点击此处可 [临时暂停翻页](再次点击可恢复)">${pageNum._now}</div>`
  5660. document.documentElement.insertAdjacentHTML('beforeend', _style + _html);
  5661. // 解决 远景论坛 会清理掉前面插入的 CSS 样式的问题
  5662. if (location.hostname === 'bbs.pcbeta.com') {setTimeout(function(){document.documentElement.insertAdjacentHTML('beforeend', _style);}, 500);}
  5663. if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
  5664. // 点击事件(临时暂停翻页)
  5665. getCSS('#Autopage_number').onclick = function () {
  5666. if (pausePage) {this.style = 'color: #FF5722 !important; font-style: italic !important;';} else {this.style = '';}
  5667. pausePage = !pausePage;
  5668. if (curSite.pager && curSite.pager.type == 5) window.top.document.xiu_pausePage = pausePage
  5669. };
  5670. status = getCSS('#Autopage_number');
  5671. set();
  5672. }
  5673. // 监听储存当前页码的对象值的变化
  5674. function set(){
  5675. Object.defineProperty(pageNum, 'now', {
  5676. set: function(value) {
  5677. this._now = value;
  5678. if (status) status.textContent = value;
  5679. }
  5680. });
  5681. }
  5682. function del(){
  5683. if (!status) return
  5684. status.style.display = 'none';
  5685. }
  5686. }
  5687. // 菜单开关
  5688. function menu_switch(menu_status, Name, Tips) {
  5689. if (menu_status === true){
  5690. GM_setValue(Name, false);
  5691. } else {
  5692. GM_setValue(Name, true);
  5693. }
  5694. if (Name === 'menu_page_number') {
  5695. if (menu_status === true){pageNumber('del');} else {pageNumber('add');}
  5696. registerMenuCommand(); // 重新注册脚本菜单
  5697. } else {
  5698. location.reload();}
  5699. };
  5700. // 生成 SiteTypeID
  5701. function setSiteTypeID() {
  5702. let num = 0
  5703. for (let val in DBSite) {
  5704. DBSite[val].SiteTypeID = num = num + 1;
  5705. }
  5706. }
  5707. // 获取 Cookie
  5708. function getCookie(name) {
  5709. if (!name) return ''
  5710. let arr = document.cookie.split(';');
  5711. name += '='
  5712. for (let i=0; i<arr.length; i++) {
  5713. let now = arr[i].trim();
  5714. if (now.indexOf(name) == 0) return now.substring(name.length, now.length);
  5715. }
  5716. return '';
  5717. }
  5718. // 插入位置
  5719. function getAddTo(num) {
  5720. switch (num) {
  5721. case 1:
  5722. return 'beforebegin'; break;
  5723. case 2:
  5724. return 'afterbegin'; break;
  5725. case 3:
  5726. case 6:
  5727. return 'beforeend'; break;
  5728. case 4:
  5729. case 5:
  5730. return 'afterend'; break;
  5731. }
  5732. }
  5733. // 滚动条事件
  5734. function windowScroll(fn1) {
  5735. var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  5736. fn = fn1 || function () {};
  5737. setTimeout(function () { // 延时 1 秒执行,避免刚载入到页面就触发翻页事件
  5738. window.addEventListener('scroll', function (e) {
  5739. var afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  5740. delta = afterScrollTop - beforeScrollTop;
  5741. if (delta == 0) return false;
  5742. fn(delta > 0 ? 'down' : 'up', e);
  5743. beforeScrollTop = afterScrollTop;
  5744. }, false);
  5745. }, 1000)
  5746. }
  5747. // 自定义 urlchange 事件(用来监听 URL 变化)
  5748. function addUrlChangeEvent() {
  5749. history.pushState = ( f => function pushState(){
  5750. var ret = f.apply(this, arguments);
  5751. window.dispatchEvent(new Event('pushstate'));
  5752. window.dispatchEvent(new Event('urlchange'));
  5753. return ret;
  5754. })(history.pushState);
  5755.  
  5756. history.replaceState = ( f => function replaceState(){
  5757. var ret = f.apply(this, arguments);
  5758. window.dispatchEvent(new Event('replacestate'));
  5759. window.dispatchEvent(new Event('urlchange'));
  5760. return ret;
  5761. })(history.replaceState);
  5762.  
  5763. window.addEventListener('popstate',()=>{
  5764. window.dispatchEvent(new Event('urlchange'))
  5765. });
  5766. }
  5767. })();