☰

World Art Uncensor

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

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