☰

World Art Uncensor

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

您需要先安裝使用者腳本管理器擴展,如 Tampermonkey、Greasemonkey 或 Violentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 Tampermonkey或 Violentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 Tampermonkey或 Userscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 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);
    }
})();