Restrict auto-refresh

Обновление на всех страницах откладывается по движению курсора/задержанию тапа на моб. устройстве

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Restrict auto-refresh
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  Обновление на всех страницах откладывается по движению курсора/задержанию тапа на моб. устройстве
// @author       Something begins
// @license      none
// @include     /^https{0,1}:\/\/((www|my)\.(heroeswm|lordswm)\.(ru|com)|178\.248\.235\.15)\/.+/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=heroeswm.ru
// @grant        none
// ==/UserScript==
const timeout = 3;

(function() {
    if (!Delta) return;
    document.addEventListener("mousemove", event =>{
        if (Delta <= timeout) Delta = timeout;
    });
    document.addEventListener("scroll", event =>{
        if (Delta <= timeout) Delta = timeout;
    });
    let tapHoldInterval;
    let isHolding = false;
    element.addEventListener('touchstart', (e) => {

        isHolding = true;
        tapHoldInterval = setInterval(() => {
            if (isHolding) {
                if (Delta <= timeout) Delta = timeout;
            }
        }, 100);
    });


    element.addEventListener('touchend', (e) => {
        // Stop the interval when the touch ends
        clearInterval(tapHoldInterval);
        isHolding = false;
    });
})();