LinkJust Bypass

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

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