Infinity Scroll

automatically creates element if user is near of the page bottom.

Від 02.03.2022. Дивіться остання версія.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(У мене вже є менеджер скриптів, дайте мені встановити його!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name Infinity Scroll
// @namespace -
// @version 0.1
// @description automatically creates element if user is near of the page bottom.
// @author NotYou
// @include *
// @require https://code.jquery.com/jquery-3.3.1.min.js
// @run-at document-idle
// @license GPL-3.0-or-later
// @grant none
// ==/UserScript==

// NOTE //
// Doesn't work if you can't scroll page //

(function() {
let css = '.infinityScroll{padding: 0% 0% 100%;}';
if (typeof GM_addStyle !== "undefined") {
  GM_addStyle(css);
} else {
  let styleNode = document.createElement("style");
  styleNode.appendChild(document.createTextNode(css));
  (document.querySelector("head") || document.documentElement).appendChild(styleNode);
}
})();


window.onscroll = function(ev) {
    if((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 100) {
        $('body').append('<div class=infinityScroll></div>')
    }
};