LinkJust Bypass

Automatically bypass linkjust.com short links — skips the 20s timer / ad wall and redirects straight to the destination.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, Greasemonkey alebo Violentmonkey.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie, ako napríklad Tampermonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, % alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey alebo Userscripts.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie, ako napríklad Tampermonkey.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie správcu používateľských skriptov.

(Už mám správcu používateľských skriptov, nechajte ma ho nainštalovať!)

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

(Už mám správcu používateľských štýlov, nechajte ma ho nainštalovať!)

// ==UserScript==
// @name         LinkJust Bypass
// @namespace    https://linkjust.com/
// @version      1.0
// @description  Automatically bypass linkjust.com short links — skips the 20s timer / ad wall and redirects straight to the destination.
// @author       Reverse Engineer
// @match        https://linkjust.com/*
// @match        *://*/*?GetArticle=*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=linkjust.com
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function () {
    'use strict';

    /* ── Strategy 1: Intercept the page before render ── */
    // If we're still on linkjust.com, the real destination is in the
    // canonical <link> or can be extracted from the shortcode directly.
    if (window.location.hostname === 'linkjust.com') {
        const shortCode = window.location.pathname.replace(/^\//, '');
        if (shortCode) {
            // Try fetching the destination via a HEAD request (follows redirects)
            fetch(window.location.href, { method: 'HEAD', redirect: 'follow' })
                .then(resp => {
                    if (resp.redirected && resp.url && !resp.url.includes('linkjust.com')) {
                        window.location.replace(resp.url);
                    }
                })
                .catch(() => {
                    // Fall through to DOM-based strategies below
                });
        }
    }

    /* ── Strategy 2: DOM-ready bypass ── */
    function bypass() {
        // 2a. Canonical link extraction (works when linkjust proxies content on its domain)
        const canonical = document.querySelector('link[rel="canonical"]');
        if (canonical && canonical.href) {
            const dest = canonical.href.split('?')[0]; // strip any query params
            if (!dest.includes(window.location.hostname) && dest !== window.location.href.split('?')[0]) {
                window.location.replace(dest);
                return;
            }
        }

        // 2b. Remove the GetArticle param from the URL query and reload clean
        const url = new URL(window.location.href);
        if (url.searchParams.has('GetArticle')) {
            url.searchParams.delete('GetArticle');
            const clean = url.toString();
            if (clean !== window.location.href) {
                window.location.replace(clean);
                return;
            }
        }

        // 2c. Kill the timer instantly
        const timerSpan = document.getElementById('timer_seconds');
        if (timerSpan) {
            timerSpan.textContent = '0';
        }

        // 2d. Expose and click the Next button immediately
        const nextBtnLink = document.getElementById('next-timer-btn');
        if (nextBtnLink) {
            nextBtnLink.style.display = 'block';
            nextBtnLink.click();
        }
        const nextBtn = nextBtnLink && nextBtnLink.querySelector('button');
        if (nextBtn) nextBtn.click();

        // 2e. Hide the timer/ad overlay div entirely
        const timerDiv = document.getElementById('linkjust-timer');
        if (timerDiv) {
            timerDiv.style.display = 'none';
        }

        // 2f. Remove any fixed overlays that might be blocking content
        const overlays = document.querySelectorAll('div[style*="position: fixed"], div[style*="position:fixed"]');
        overlays.forEach(el => {
            if (el.offsetParent !== null && el.innerText.includes('linkjust') || el.id === 'linkjust-timer') {
                el.remove();
            }
        });

        // 2g. Unhide the main content
        document.body.style.overflow = 'auto';
        const mainContent = document.getElementById('main') || document.querySelector('.site-main') || document.querySelector('.content-area') || document.querySelector('article');
        if (mainContent) {
            mainContent.style.display = 'block';
            mainContent.style.visibility = 'visible';
        }
    }

    // Run on DOMContentLoaded
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', bypass);
    } else {
        bypass();
    }

    // Also run a micro-delay version in case elements are injected dynamically
    setTimeout(bypass, 250);
    setTimeout(bypass, 500);

    /* ── Strategy 3: Intercept link clicks to show real destinations ── */
    document.addEventListener('mouseover', function (e) {
        const link = e.target.closest('a[href*="linkjust.com"]');
        if (link) {
            link.title = '🔄 LinkJust link — bypassing automatically';
        }
    });
})();