unlimited scroll

scroll infinitely up and down

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         unlimited scroll
// @namespace    http://tampermonkey.net/
// @version      6.9
// @description  scroll infinitely up and down
// @author       therandomdude
// @match        *://*/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const contentDiv = document.createElement('div');
    contentDiv.style.width = '10000px';
    contentDiv.style.height = '10000px';
    document.body.appendChild(contentDiv);

    window.addEventListener('scroll', function() {
        const scrollX = window.scrollX;
        const scrollY = window.scrollY;

        if (scrollX + window.innerWidth >= contentDiv.offsetWidth) {
            contentDiv.style.width = (contentDiv.offsetWidth + window.innerWidth) + 'px';
        }

        if (scrollY + window.innerHeight >= contentDiv.offsetHeight) {
            contentDiv.style.height = (contentDiv.offsetHeight + window.innerHeight) + 'px';
        }
    });
})();