Skip to content

Commit 94137d5

Browse files
committed
新增 [所有使用 DUX(WordPress) 主题的网站] 支持(原先支持的 APPHOT、亿破姐、福利吧、落尘之木 都合并了)
1 parent c7959cf commit 94137d5

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

Autopage.user.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// ==UserScript==
22
// @name 自动无缝翻页
3-
// @version 1.5.1
3+
// @version 1.5.2
44
// @author X.I.U
5-
// @description 自动无缝翻页,目前支持:所有「Discuz!、Flarum」论坛、百度、豆瓣、微博、千图网、3DM、游侠网、游民星空、Steam 创意工坊、423Down、APPHOT、不死鸟、亿破姐、小众软件、微当下载、落尘之木、异次元软件、老殁殁漂遥、异星软件空间、古风漫画网、砂之船动漫家、RARBG、PubMed、AfreecaTV、GreasyFork、AlphaCoders、Crackhub213、FitGirl Repacks...
5+
// @description 自动无缝翻页,目前支持:所有「Discuz!、Flarum、DUX(WP)」论坛/主题网站、百度、豆瓣、微博、千图网、3DM、游侠网、游民星空、Steam 创意工坊、423Down、不死鸟、小众软件、微当下载、异次元软件、老殁殁漂遥、异星软件空间、古风漫画网、砂之船动漫家、RARBG、PubMed、AfreecaTV、GreasyFork、AlphaCoders、Crackhub213、FitGirl Repacks...
66
// @match *://*/*
77
// @connect www.gamersky.com
88
// @icon https://i.loli.net/2021/03/07/rdijeYm83pznxWq.png
@@ -11,6 +11,7 @@
1111
// @grant GM_openInTab
1212
// @grant GM_getValue
1313
// @grant GM_setValue
14+
// @noframes
1415
// @license GPL-3.0 License
1516
// @run-at document-end
1617
// @namespace https://github.com/XIU2/UserScript
@@ -24,7 +25,7 @@
2425
// 目前支持的网站
2526
const websiteList = ['www.baidu.com', 'movie.douban.com', 'weibo.com', 'www.58pic.com',
2627
'www.3dmgame.com', 'www.ali213.net', 'gl.ali213.net', 'www.gamersky.com', 'steamcommunity.com',
27-
'www.423down.com', 'apphot.cc', 'iao.su', 'www.ypojie.com', 'www.appinn.com', 'www.weidown.com', 'www.luochenzhimu.com', 'www.iplaysoft.com', 'www.mpyit.com', 'www.yxssp.com',
28+
'www.423down.com', 'iao.su', 'www.appinn.com', 'www.weidown.com', 'www.iplaysoft.com', 'www.mpyit.com', 'www.yxssp.com',
2829
'www.gufengmh8.com', 'www.szcdmj.com',
2930
'rarbgprx.org', 'pubmed.ncbi.nlm.nih.gov', 'www.afreecatv.com', 'greasyfork.org',
3031
'art.alphacoders.com', 'wall.alphacoders.com', 'avatars.alphacoders.com', 'mobile.alphacoders.com',
@@ -38,13 +39,16 @@
3839
return
3940
} else {
4041
if (websiteList.indexOf(location.host) > -1) {
41-
webType = 1 // 其他网站
42+
webType = 1;console.info('[自动无缝翻页] - 其他网站'); // 其他网站
4243
} else if (document.querySelector('meta[name="author"][content*="Discuz!"], meta[name="generator"][content*="Discuz!"]') || document.getElementById('ft') && document.getElementById('ft').textContent.indexOf('Discuz!') > -1) {
43-
webType = 2 // 所有 Discuz! 论坛
44+
webType = 2;console.info('[自动无缝翻页] - Discuz! 论坛'); // 所有 Discuz! 论坛
4445
} else if (document.getElementById('flarum-loading')) {
45-
webType = 3 // 所有 Flarum 论坛
46+
webType = 3;console.info('[自动无缝翻页] - Flarum 论坛'); // 所有 Flarum 论坛
47+
} else if (document.querySelector('link[href*="themes/dux" i], script[src*="themes/dux" i]')) {
48+
webType = 4;console.info('[自动无缝翻页] - 使用 WordPress DUX 主题的网站'); // 所有使用 WordPress DUX 主题的网站
4649
} else {
4750
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});});
51+
console.info('[自动无缝翻页] - 不支持当前网站');
4852
return
4953
}
5054
GM_registerMenuCommand('✅ 已启用 (点击对当前网站禁用)', function(){menu_disable('add')});
@@ -156,7 +160,7 @@
156160
pageElement: 'css;.content > article',
157161
HT_insert: ['css;.content > .pagination', 1],
158162
replaceE: 'css;.content > .pagination',
159-
scrollDelta: 1000
163+
scrollDelta: 1500
160164
},
161165
function: {
162166
before: dux_beforeFunction
@@ -580,13 +584,6 @@
580584
// < 其他网站 >
581585
if (webType === 1) {
582586
switch (location.host) {
583-
case 'apphot.cc': // < APPHOT >
584-
case 'www.ypojie.com': // < 亿破姐 >
585-
case 'www.luochenzhimu.com': // < 落尘之木 >
586-
if (location.pathname.indexOf('.html') === -1) curSite = DBSite.dux;
587-
if (location.host === 'apphot.cc') curSite.pager.scrollDelta = 1600; // 对于速度慢的网站,需要增加翻页敏感度
588-
break;
589-
// 以上几个都是 WordPress 的 DUX 主题
590587
case 'www.baidu.com': // < 百度搜索 >
591588
if (location.pathname === '/s') curSite = DBSite.baidu;
592589
break;
@@ -755,7 +752,12 @@
755752
// < 所有 Flarum 论坛 >
756753
} else if (webType === 3) {
757754
curSite = DBSite.flarum;
755+
// < 所有使用 WordPress DUX 主题的网站 >
756+
} else if (webType === 4) {
757+
if (location.pathname.indexOf('.html') === -1) curSite = DBSite.dux;
758+
if (location.host === 'apphot.cc') curSite.pager.scrollDelta = 2500; // 对于速度慢的网站,需要增加翻页敏感度
758759
}
760+
759761
curSite.pageUrl = ''; // 下一页URL
760762
//console.log(curSite);
761763
pageLoading(); // 自动无缝翻页

0 commit comments

Comments
 (0)