aichattings Private album unblur.

removes blurring from chatbot images

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         aichattings Private album unblur.
// @namespace    https://aichattings.com/
// @version      1.1
// @description  removes blurring from chatbot images
// @author       r_0_b_3_3
// @match        *://*.aichattings.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to override the zoom property in CSS (only once)
    function overrideZoom() {
        const appElement = document.querySelector('#app');
        if (appElement) {
            appElement.style.zoom = '0.9';
        }
    }

    // Function to modify the HTML structure
    function modifyHtmlStructure() {
        const messageItems = document.querySelectorAll('.message-item.bot');
        messageItems.forEach(item => {
            const imgContent = item.querySelector('.img-content.private-albums');
            if (imgContent) {
                imgContent.classList.remove('private-albums');

                // Remove the 'blur' class from the image
                const img = imgContent.querySelector('.img.blur');
                if (img) {
                    img.classList.remove('blur');
                }

                // Remove the lock element
                const lockElement = imgContent.querySelector('.lock');
                if (lockElement) {
                    lockElement.remove();
                }
            }
        });
    }

    // Observer to watch for new elements
    function observeNewElements() {
        const observer = new MutationObserver(mutations => {
            mutations.forEach(mutation => {
                if (mutation.addedNodes.length > 0) {
                    modifyHtmlStructure();
                }
            });
        });

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

    // Run the zoom function once on page load
    window.addEventListener('load', () => {
        overrideZoom();
    });

    // Run the observer to watch for new elements
    observeNewElements();

})();