☰

World Art Uncensor

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

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