Skip to content

Commit bb4bfc3

Browse files
committed
优化 在网页内容撑不起来不显示滚动条时(特别是是竖屏显示屏)的使用体验
1 parent 9c4aec1 commit bb4bfc3

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

Autopage.user.js

Lines changed: 9 additions & 1 deletion
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.4.1
6+
// @version 5.4.2
77
// @author X.I.U
88
// @description ⭐无缝衔接下一页内容到网页底部(类似瀑布流)⭐,目前支持:【所有「Discuz!、Flarum、phpBB、Xiuno、XenForo、NexusPHP...」论坛】【百度、谷歌(Google)、必应(Bing)、搜狗、微信、360、Yahoo、Yandex 等搜索引擎...】、贴吧、豆瓣、知乎、微博、NGA、V2EX、煎蛋网、龙的天空、起点中文、千图网、千库网、Pixabay、Pixiv、3DM、游侠网、游民星空、NexusMods、Steam 创意工坊、CS.RIN.RU、RuTracker、BT之家、萌番组、动漫花园、樱花动漫、爱恋动漫、AGE 动漫、Nyaa、SrkBT、RARBG、SubHD、423Down、不死鸟、扩展迷、小众软件、【动漫狂、漫画猫、漫画屋、漫画 DB、动漫之家、拷贝漫画、HiComic、Mangabz、Xmanhua 等漫画网站...】、PubMed、Z-Library、GreasyFork、Github、StackOverflow(以上仅一小部分,更多的写不下了...
99
// @description:zh-TW ⭐無縫銜接下一頁內容到網頁底部(類似瀑布流)⭐,支持各論壇、社交、遊戲、漫畫、小說、學術、搜索引擎(Google、Bing、Yahoo...) 等網站~
@@ -3468,6 +3468,14 @@ function: {
34683468
var beforeScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
34693469
fn = fn1 || function () {};
34703470
setTimeout(function () { // 延时 1 秒执行,避免刚载入到页面就触发翻页事件
3471+
3472+
// 避免网页内容太少,高度撑不起来,不显示滚动条而无法触发翻页事件
3473+
let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop,
3474+
scrollHeight = window.innerHeight || document.documentElement.clientHeight
3475+
if (scrollTop === 0 && document.documentElement.scrollHeight === scrollHeight) {
3476+
insStyle(`html, body {min-height: ${document.documentElement.scrollHeight+10}px;}`)
3477+
}
3478+
34713479
window.addEventListener('scroll', function (e) {
34723480
var afterScrollTop = document.documentElement.scrollTop || document.body.scrollTop,
34733481
delta = afterScrollTop - beforeScrollTop;

other/Autopage/rules.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2737,7 +2737,6 @@
27372737
"哔哩轻小说 - 手机版": {
27382738
"host": "w.linovelib.com",
27392739
"url": "return (fun.indexOF(/\\/novel\\/\\d+\\/.+\\.html/))",
2740-
"style": "body {min-height: 1000px;}",
27412740
"pager": {
27422741
"nextL": "js;if (ReadParams) {return (location.origin + ReadParams.url_next)}; return '';",
27432742
"pageE": "id('apage')/div | //body/script[contains(text(), 'var ReadParams')]",
@@ -3746,7 +3745,7 @@
37463745
},
37473746
"OI-Wiki": {
37483747
"host": "oi-wiki.org",
3749-
"style": "blockquote.page-copyright, h2#__comments, form#gitalk-form {display: none !important;} article.md-content__inner{min-height: 700px;}",
3748+
"style": "blockquote.page-copyright, h2#__comments, form#gitalk-form {display: none !important;}",
37503749
"pager": {
37513750
"nextL": "li.md-nav__item.md-nav__item--active.md-nav__item--nested li.md-nav__item--active+li a",
37523751
"pageE": "article.md-content__inner",
@@ -4060,7 +4059,7 @@
40604059
"yande": {
40614060
"host": ["konachan.net","konachan.com","yande.re"],
40624061
"url": "if (fun.indexOF('/post')) {document.head.appendChild(document.createElement('base')).target = '_blank'; return true;}",
4063-
"style": "html, body {min-height: 1000px;} .javascript-hide {display: inline-block !important;} ul#post-list-posts img, ul#post-list-posts .inner{width: auto !important; height: auto !important;} ul#post-list-posts li {width: 33% !important;} a.directlink {margin: 0 !important;}",
4062+
"style": ".javascript-hide {display: inline-block !important;} ul#post-list-posts img, ul#post-list-posts .inner{width: auto !important; height: auto !important;} ul#post-list-posts li {width: 33% !important;} a.directlink {margin: 0 !important;}",
40644063
"pager": {
40654064
"nextL": "a.next_page",
40664065
"pageE": "ul#post-list-posts > li",

0 commit comments

Comments
 (0)