ChatGPT UP DOWN buttons

up/down buttons for chatgpt

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey, Greasemonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals {tampermonkey_link:Tampermonkey}.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Userscripts.

Voor het installeren van scripts heb je een extensie nodig, zoals {tampermonkey_link:Tampermonkey}.

Voor het installeren van scripts heb je een gebruikersscriptbeheerder nodig.

(Ik heb al een user script manager, laat me het downloaden!)

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

(Ik heb al een beheerder - laat me doorgaan met de installatie!)

// ==UserScript==
// @name         ChatGPT UP DOWN buttons
// @namespace    http://tampermonkey.net/
// @version      2026-07-25
// @description  up/down buttons for chatgpt
// @author       Johann Nather
// @match        https://chatgpt.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=chatgpt.com
// @grant        none
// @license      GNU GPLv3
// ==/UserScript==
(function () {
    "use strict";

    // Mehrfaches Einfügen verhindern
    if (document.getElementById("chat-scroll-buttons")) return;

    // Chat-Container suchen
    function getScrollContainer() {
        let best = document.scrollingElement;
        let maxScroll = 0;

        document.querySelectorAll("*").forEach((el) => {
            const style = getComputedStyle(el);

            if (
                (style.overflowY === "auto" || style.overflowY === "scroll") &&
                el.scrollHeight > el.clientHeight + 50
            ) {
                const scroll = el.scrollHeight - el.clientHeight;
                if (scroll > maxScroll) {
                    maxScroll = scroll;
                    best = el;
                }
            }
        });

        return best;
    }

    function scrollTop() {
        getScrollContainer().scrollTo({
            top: 0,
            behavior: "smooth",
        });
    }

    function scrollBottom() {
        const c = getScrollContainer();
        c.scrollTo({
            top: c.scrollHeight,
            behavior: "smooth",
        });
    }
    // Container für Buttons
    const wrapper = document.createElement("div");
    wrapper.id = "chat-scroll-buttons";
wrapper.style.cssText = `
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 999999;
`;
    function createButton(symbol, onClick) {
        const btn = document.createElement("button");

        // btn.textContent = symbol;
        btn.innerHTML = symbol;
        btn.style.cssText = `
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 100, 0, 0.5);
    color: black;
    font-size: 19px;
    font-weight: bold;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 3px 8px rgba(0,0,0,.35);
    transition: transform .15s, background-color .2s;
`;
        //-----------------------------------------------------------------------------------
        //-----------------------------------------------------------------------------------
        //-----------------------------------------------------------------------------------
        btn.onmouseenter = () => {
            btn.style.transform = "scale(1.08)";
            btn.style.backgroundColor = "rgba(139, 0, 0, 0.5)"; // dunkelrot, 50% transparent
        };

        btn.onmouseleave = () => {
            btn.style.transform = "scale(1)";
            btn.style.backgroundColor = "rgba(0, 100, 0, 0.5)"; // dunkelgrün, 50% transparent
        };
        btn.onclick = onClick;
        return btn;
    }
    //wrapper.appendChild(createButton("⬆", scrollTop));
    //wrapper.appendChild(createButton("⬇", scrollBottom));

    wrapper.appendChild(createButton("▲", scrollTop));
    wrapper.appendChild(createButton("▼", scrollBottom));

    document.body.appendChild(wrapper);
})();