Greasy Fork is available in English.

ShikiEmptyStylesRemoval

Позволяет оставлять чужие стили в профилях и заменять только "пустые" на свой стиль

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

You will need to install an extension such as Tampermonkey 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         ShikiEmptyStylesRemoval
// @namespace    http://shikimori.org/
// @version      1.0.1
// @description  Позволяет оставлять чужие стили в профилях и заменять только "пустые" на свой стиль
// @author       BadPurse
// @match        http://shikimori.org/*
// @match        https://shikimori.org/*
// @match        http://shikimori.one/*
// @match        https://shikimori.one/*
// @match        http://shikimori.me/*
// @match        https://shikimori.me/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=shikimori.me
// @grant        none
// @license MIT

// ==/UserScript==
(function() {
    const styleElementId = "custom_css"; // ID элемента с кастомным стилем
    const customStyle = `Ваш стиль`; // Ваш стиль(Его мы меняем на свой и меняем ковычки, если необходимо ' " `)

    let lastUrl = window.location.href; // Сохраняем последний URL

    const setCustomStyle = () => {
        const styleElement = document.getElementById(styleElementId);
        if (styleElement) {
            // Устанавливаем стиль, если его содержимое меньше 700 символов
            if (styleElement.innerHTML.length < 700) {
                styleElement.innerHTML = customStyle;
            }
        }
    };

   // Проверка изменения URL
    const checkUrlChange = () => {
        if (window.location.href !== lastUrl) {
            setTimeout(setCustomStyle, 600); // Применяем стиль с задержкой 600 мс
        }
    };

    // Устанавливаем интервал для проверки URL каждые 500 мс
    setInterval(checkUrlChange, 500);

    // Применяем стиль через 600 мс при загрузке страницы
    setTimeout(setCustomStyle, 600);
})();