Restrict auto-refresh

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

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==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;
    });
})();