Skip to content

Commit 5e500a8

Browse files
committed
优化 代码; 新增 [仙女图] 支持
1 parent 68b037f commit 5e500a8

3 files changed

Lines changed: 26 additions & 6 deletions

File tree

Autopage.user.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @name:zh-CN 自动无缝翻页
44
// @name:zh-TW 自動無縫翻頁
55
// @name:en AutoPager
6-
// @version 5.2.7
6+
// @version 5.2.8
77
// @author X.I.U
88
// @description ⭐无缝衔接下一页内容到网页底部(类似瀑布流)⭐,目前支持:【所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、NexusPHP...」论坛】【百度、谷歌(Google)、必应(Bing)、搜狗、微信、360、Yahoo、Yandex 等搜索引擎...】、贴吧、豆瓣、知乎、微博、NGA、V2EX、B 站(Bilibili)、煎蛋网、龙的天空、起点中文、IT之家、千图网、千库网、Pixabay、Pixiv、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、小众软件、【动漫狂、漫画猫、漫画屋、漫画 DB、动漫之家、拷贝漫画、HiComic、Mangabz、Xmanhua 等漫画网站...】、PubMed、Z-Library、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了...
99
// @description:zh-TW ⭐無縫銜接下一頁內容到網頁底部(類似瀑布流)⭐,支持各論壇、社交、遊戲、漫畫、小說、學術、搜索引擎(Google、Bing、Yahoo...) 等網站~
@@ -258,7 +258,7 @@ pager: {
258258
nextText: 按钮文本,当按钮文本 = 该文本时,才会点击按钮加载下一页(避免一瞬间加载太多次下一页,下同)
259259
nextTextOf: 按钮文本的一部分,当按钮文本包含该文本时,才会点击按钮加载下一页
260260
nextHTML: 按钮内元素,当按钮内元素 = 该元素内容时,才会点击按钮加载下一页
261-
interval: 点击间隔时间,对于没有按钮文字变化的按钮,可以手动指定间隔时间(单位 ms,默认 300,当指定上面三个时,会忽略 interval)
261+
interval: 点击间隔时间,对于没有按钮文字变化的按钮,可以手动指定间隔时间(单位 ms,默认 500,当指定上面三个时,会忽略 interval)
262262
isHidden: 只有下一页按钮可见时(没有被隐藏),才会点击
263263
264264
3 = 依靠 [基准元素] 与 [浏览器可视区域底部] 之间的距离缩小来触发翻页(适用于:主体元素下方内容太多 且 高度不固定时)
@@ -2867,7 +2867,7 @@ function: {
28672867
function getNextE(css) {
28682868
if (!css) css = curSite.pager.nextL;
28692869
let next = getOne(css);
2870-
if (next && next.nodeType === 1 && next.href && next.href.slice(0,4) === 'http') {
2870+
if (next && next.nodeType === 1 && next.href && next.href.slice(0,4) === 'http' && next.getAttribute('href').slice(0,1) !== '#') {
28712871
if (next.href != curSite.pageUrl) {
28722872
if (curSite.pager.forceHTTPS && location.protocol === 'https:') {
28732873
if (next.href.replace(/^http:/,'https:') === curSite.pageUrl) {
@@ -2983,13 +2983,13 @@ function: {
29832983
function checkURL(func) {
29842984
if (typeof curSite.pager.nextL == 'function') {
29852985
let tempUrl = curSite.pager.nextL();
2986-
if (!tempUrl || (tempUrl && tempUrl.slice(0,4) != 'http') || tempUrl === curSite.pageUrl) return;
2986+
if (!tempUrl || tempUrl === curSite.pageUrl || tempUrl.slice(0,4) !== 'http') return
29872987
curSite.pageUrl = tempUrl;
29882988
func(curSite.pageUrl);
29892989
} else if (curSite.pager.nextL && curSite.pager.nextL.search(/^js;/i) === 0) { // 自定义翻页规则中执行 JavaScript 代码的
29902990
try {
29912991
let tempUrl = new Function('fun', curSite.pager.nextL.slice(3))(window.autoPage);
2992-
if (!tempUrl || (tempUrl && tempUrl.slice(0,4) != 'http') || tempUrl === curSite.pageUrl) return;
2992+
if (!tempUrl || tempUrl === curSite.pageUrl || tempUrl.slice(0,4) !== 'http') return
29932993
curSite.pageUrl = tempUrl;
29942994
func(curSite.pageUrl);
29952995
} catch (e) {

other/Autopage/ruleUpdateTime.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1646789590
1+
1646977476

other/Autopage/rules.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5158,5 +5158,25 @@
51585158
"replaceE": ".page .pagelist",
51595159
"scrollD": 4500
51605160
}
5161+
},
5162+
"仙女图": {
5163+
"host": "www.xiannvtu.com",
5164+
"url": "/\\/v\\//",
5165+
"pager": {
5166+
"nextL": "//div[@class='page']//a[text()='下一页']",
5167+
"pageE": ".picbox img",
5168+
"replaceE": ".page",
5169+
"scrollD": 2000
5170+
}
5171+
},
5172+
"仙女图 - 手机版": {
5173+
"host": "m.xiannvtu.com",
5174+
"url": "/\\/v\\//",
5175+
"pager": {
5176+
"nextL": "//div[@class='fenye']//a[text()='下一页']",
5177+
"pageE": "#content > .post > .post-content img",
5178+
"replaceE": ".fenye",
5179+
"scrollD": 3500
5180+
}
51615181
}
51625182
}

0 commit comments

Comments
 (0)