|
|
@@ -18,7 +18,7 @@
|
|
|
* along with SingleFile. If not, see <http://www.gnu.org/licenses/>.
|
|
|
*/
|
|
|
|
|
|
-/* global window, screen, scrollBy, requestAnimationFrame, Element */
|
|
|
+/* global window, screen, scrollBy, requestAnimationFrame, Element, document, dispatchEvent, UIEvent */
|
|
|
|
|
|
(() => {
|
|
|
|
|
|
@@ -35,5 +35,14 @@
|
|
|
};
|
|
|
scrollBy(0, 1);
|
|
|
requestAnimationFrame(() => scrollBy(0, -1));
|
|
|
+ scroll(0);
|
|
|
+
|
|
|
+ function scroll(offsetY) {
|
|
|
+ document.documentElement.__defineGetter__("scrollTop", () => offsetY);
|
|
|
+ dispatchEvent(new UIEvent("scroll"));
|
|
|
+ if (offsetY < document.documentElement.offsetHeight) {
|
|
|
+ window._singleFile_timeoutScroll = setTimeout(() => scroll(offsetY + 100), 50);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
})();
|