LOLZ_Fix Nav Buttons

LOLZ Fix Navigation Buttons in Threads

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

Advertisement:

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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