aichattings Private album unblur.

removes blurring from chatbot images

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo 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         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();

})();