replace furry

Уточка в диалогах и на странице 404.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

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

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

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

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         replace furry
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Уточка в диалогах и на странице 404.
// @author       Shadman
// @match        https://lolz.live/*
// @match        https://lzt.market/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=lolz.live
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const CONVERSATIONS_IMAGE_URL = "https://i.ibb.co/Rphyg3QH/utka-lolz.png";
    const ERROR_404_IMAGE_URL = "https://i.ibb.co/bMvVSTdV/utya-utya-duck.png";
    const style = document.createElement('style');
    style.innerHTML = `
        /* Правило для диалогов */
        img.conversationCapImage {
            content: url("${CONVERSATIONS_IMAGE_URL}") !important;
            object-fit: contain;
        }
        .error-container img {
            content: url("${ERROR_404_IMAGE_URL}") !important;
            object-fit: contain;
            width: 100%; /* На странице ошибки картинка может быть большой */
            max-height: 300px; /* Ограничим высоту, чтобы не была на весь экран */
        }
    `;
    document.head.appendChild(style);
    function replaceSources() {
        const convImg = document.querySelector('img.conversationCapImage');
        if (convImg && convImg.src !== CONVERSATIONS_IMAGE_URL) {
            convImg.src = CONVERSATIONS_IMAGE_URL;
        }
        const errorImg = document.querySelector('.error-container img');
        if (errorImg && errorImg.src !== ERROR_404_IMAGE_URL) {
            errorImg.src = ERROR_404_IMAGE_URL;
            errorImg.removeAttribute('width');
            errorImg.removeAttribute('height');
        }
    }

    const observer = new MutationObserver((mutations) => {
        replaceSources();
    });

    observer.observe(document.documentElement, {
        childList: true,
        subtree: true
    });

    replaceSources();
})();