LOLZ_Fix Nav Buttons

LOLZ Fix Navigation Buttons in Threads

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

You will need to install an extension such as Tampermonkey to install this 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!)

Advertisement:

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!)

Advertisement:

// ==UserScript==
// @name         LOLZ_Fix Nav Buttons
// @namespace    LOLZ_Fix Nav Buttons
// @description  LOLZ Fix Navigation Buttons in Threads
// @version      0.3
// @author       el9in
// @license      el9in
// @match        https://zelenka.guru/threads/*
// @match        https://lolz.guru/threads/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=zelenka.guru
// ==/UserScript==

(function() {
    'use strict';
    function initFixNav() {
        const elements = document.querySelectorAll('[href^="threads/"][href*="/page-"]');
        elements.forEach(function(element) {
            element.addEventListener('click', function(event) {
                var hrefValue = element.getAttribute('href');
                event.stopPropagation();
                window.location.href = hrefValue;
            });
        });
    }
    initFixNav();
    let _currentHref = window.location.href;
    function hrefChecker() {
        if(_currentHref != window.location.href) {
            initFixNav();
            _currentHref = window.location.href;
        }
    }
    setInterval(hrefChecker, 500);
})();