AI Chat WideScreen

Make the ChatGPT & DeepSeek conversation window wider.使ChatGPT和DeepSeek的聊天对话框更宽

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         AI Chat WideScreen
// @namespace    http://tampermonkey.net/
// @version      2.2
// @description  Make the ChatGPT & DeepSeek conversation window wider.使ChatGPT和DeepSeek的聊天对话框更宽
// @author       Xiong Yu
// @match        https://chat.openai.com/*
// @match        https://chatgpt.com/*
// @match        https://chat.deepseek.com/*
// @grant        none
// @homepageURL  https://greasyfork.org/zh-CN/scripts/473238
// ==/UserScript==

(function() {
    'use strict';

    function updateStyle(element) {
        element.style.maxWidth = '95%';
    }

    const nodes = [
        'body > div > div > main > div > div > div > div > div > div > article > div > div',
        'body > div > div > div > div > main > div > div > div > div > div > div > article > div > div',
        'body > div > div > div > div > main > div > div > div > div > article > div > div',
        'body > div > div > div > div > main > div > div > div > div > div > article > div > div',
        '#root > div > div > div > div > div > div > div > div'
    ];

    const observer = new MutationObserver(mutationsList => {
        mutationsList.forEach(mutation => {
            if (mutation.addedNodes.length > 0) {
                mutation.addedNodes.forEach(addedNode => {
                    if (addedNode.nodeType === Node.ELEMENT_NODE) {
                        if (nodes.some(selector => addedNode.matches(selector))) {
                            updateStyle(addedNode);
                        } else {
                            nodes.forEach(selector => {
                                addedNode.querySelectorAll(selector).forEach(updateStyle);
                            });
                        }
                    }
                });
            }
        });
    });

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