MCPcopy Index your code
hub / github.com/hoothin/UserScripts / setPageTop

Method setPageTop

Pagetual/pagetual.user.js:7755–7766  ·  view source on GitHub ↗
(top)

Source from the content-addressed store, hash-verified

7753 }
7754
7755 setPageTop(top) {
7756 let bodyScroll = getBody(document).scrollTop;
7757 if (bodyScroll) {
7758 if (Math.abs(bodyScroll - top) > 50) {
7759 getBody(document).scrollTop = top;
7760 }
7761 } else {
7762 if (Math.abs(document.documentElement.scrollTop - top) > 50) {
7763 document.documentElement.scrollTop = top;
7764 }
7765 }
7766 }
7767
7768 async insertPage(doc, eles, url, callback, tried) {
7769 this.oldUrl = this.curUrl;

Callers

nothing calls this directly

Calls 1

getBodyFunction · 0.70

Tested by

no test coverage detected