ChatGPT adjust height of source bar

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==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();