☰

World Art Uncensor

Блокує примусовий редирект на головну для прихованих сторінок World Art

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

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

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

// ==UserScript==
// @name         World Art Uncensor
// @namespace    http://tampermonkey.net
// @version      1.1
// @description  Блокує примусовий редирект на головну для прихованих сторінок World Art
// @author       You
// @include      http://www.world-art.ru*
// @include      https://www.world-art.ru*
// @include      http://world-art.ru*
// @include      https://world-art.ru*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Блокуємо спроби сайту змінити локацію через JS
    if (window.location.search.includes('id=')) {
        const originalReplace = window.location.replace;
        window.location.replace = function(url) {
            if (url.includes('/animation/') && !url.includes('id=')) {
                console.log('[World Art Uncensor] Заблоковано window.location.replace на:', url);
                return;
            }
            originalReplace.apply(this, arguments);
        };

        // Захист від зміни href
        let currentHref = window.location.href;
        setInterval(() => {
            if (window.location.pathname === '/animation/' || window.location.pathname === '/animation/index.php') {
                window.history.pushState(null, '', currentHref);
                window.stop();
            }
        }, 10);
    }
})();