ChatGPT adjust height of source bar

Sets height to revert on the first span ancestor of path elements with specific d attribute

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        ChatGPT adjust height of source bar
// @match       https://chatgpt.com/*
// @description Sets height to revert on the first span ancestor of path elements with specific d attribute
// @version 0.0.1.20250718195752
// @namespace https://greasyfork.org/users/1435046
// ==/UserScript==

function setSpanHeight() {
    const pathElements = document.querySelectorAll('path[d^="M14.0857 8.74999C14.0857 5.80355"]');
    pathElements.forEach(pathElement => {
        let currentElement = pathElement;
        while (currentElement && currentElement.tagName.toLowerCase() !== 'span') {
            currentElement = currentElement.parentElement;
        }
        if (currentElement) {
            currentElement.style.setProperty('height', 'revert', 'important');
        }
    });
}

const observer = new MutationObserver(setSpanHeight);
observer.observe(document.body, { childList: true, subtree: true });
setSpanHeight();