FUCK THE TIMER

FUCK 30 SEC TIMER

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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.

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

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

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.

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

// ==UserScript==
// @name         FUCK THE TIMER
// @namespace    http://tampermonkey.net/
// @version      666
// @license      opensource
// @description  FUCK 30 SEC TIMER
// @match        https://lzt.market/*
// @match        https://*.lzt.market/*
// @grant        none
// @author       lolz.live/rsz9
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    const AUTO_CONFIRM = true;

    const originalSetTimeout = window.setTimeout;
    const originalSetInterval = window.setInterval;

    window.setTimeout = function(fn, delay, ...args) {
        if (delay >= 900 && delay <= 31000) {
            delay = 1;
        }
        return originalSetTimeout.call(window, fn, delay, ...args);
    };

    window.setInterval = function(fn, delay, ...args) {
        if (delay >= 900 && delay <= 1100) {
            return originalSetTimeout.call(window, fn, 1, ...args);
        }
        return originalSetInterval.call(window, fn, delay, ...args);
    };

    function processForm() {
        const timer = document.querySelector('.RegTimer');
        if (timer) {
            timer.style.display = 'none';
        }

        const form = document.querySelector('form.xenForm.formOverlay.AutoValidator[action*="invoice"][action*="pay"]') ||
                     document.querySelector('form[action*="invoice"][action*="pay"]');

        const btn = form ? form.querySelector('input[type="submit"].SubmitButton') : null;

        if (btn && form) {
            btn.removeAttribute('disabled');
            btn.disabled = false;

            if (AUTO_CONFIRM) {
                setTimeout(() => btn.click(), 50);
                setTimeout(() => {
                    if (form) form.submit();
                }, 200);
                return;
            }

            const newBtn = btn.cloneNode(true);
            btn.parentNode.replaceChild(newBtn, btn);

            newBtn.addEventListener('click', function(e) {
                e.preventDefault();
                e.stopPropagation();
                e.stopImmediatePropagation();
                form.submit();
            }, true);
        }
    }

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', processForm);
    } else {
        processForm();
    }

    setTimeout(processForm, 100);
    setTimeout(processForm, 500);
    setTimeout(processForm, 1000);
    setTimeout(processForm, 2000);

    const observer = new MutationObserver(function(mutations) {
        for (let mutation of mutations) {
            for (let node of mutation.addedNodes) {
                if (node.nodeType === 1) {
                    if (node.classList && (node.classList.contains('xenOverlay') ||
                        node.classList.contains('confirmPayInvoice') ||
                        node.querySelector && node.querySelector('.RegTimer'))) {
                        setTimeout(processForm, 50);
                        setTimeout(processForm, 200);
                        setTimeout(processForm, 500);
                    }
                }
            }
        }
    });

    const waitForBody = setInterval(function() {
        if (document.body) {
            clearInterval(waitForBody);
            observer.observe(document.body, {
                childList: true,
                subtree: true
            });
        }
    }, 10);

})();