Skip to content

Commit c918134

Browse files
committed
Update pagetual.user.js
1 parent 56d3efe commit c918134

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Pagetual/pagetual.user.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4908,10 +4908,12 @@
49084908
getBody(doc).scrollTop = actualTop - 10;
49094909
doc.documentElement.scrollTop = actualTop - 10;
49104910
setTimeout(() => {
4911-
while (actualTop < maxHeight) {
4911+
if (actualTop < maxHeight) {
49124912
actualTop += 200;
49134913
getBody(doc).scrollTop = actualTop;
49144914
doc.documentElement.scrollTop = actualTop;
4915+
getBody(doc).scrollTop = maxHeight;
4916+
doc.documentElement.scrollTop = maxHeight;
49154917
}
49164918
}, 0);
49174919
return false;
@@ -4958,7 +4960,13 @@
49584960
runPageBar(pageBar) {
49594961
if (this.curSiteRule.pageBar && this.curSiteRule.pageBar !== 0) {
49604962
try {
4961-
((typeof this.curSiteRule.pageBar === 'function') ? this.curSiteRule.pageBar : Function("pageBar",'"use strict";' + this.curSiteRule.pageBar))(pageBar);
4963+
if (typeof this.curSiteRule.pageBar === 'function') {
4964+
this.curSiteRule.pageBar(pageBar);
4965+
} else if (/^pageBar\.className=['"][^'"]*['"];?$/.test(this.curSiteRule.pageBar)) {
4966+
pageBar.className = this.curSiteRule.pageBar.match(/^pageBar\.className=['"]([^'"]*)['"];?$/)[1];
4967+
} else {
4968+
Function("pageBar",'"use strict";' + this.curSiteRule.pageBar)(pageBar);
4969+
}
49624970
} catch(e) {
49634971
debug(e);
49644972
}

0 commit comments

Comments
 (0)