Fuck AI Overview

no more ai stuff for videos, buh bye

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey, Greasemonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да инсталирате разширение, като например Tampermonkey .

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Userscripts.

За да инсталирате скрипта, трябва да инсталирате разширение като Tampermonkey.

За да инсталирате този скрипт, трябва да имате инсталиран скриптов мениджър.

(Вече имам скриптов мениджър, искам да го инсталирам!)

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

(Вече имам инсталиран мениджър на стиловете, искам да го инсталирам!)

// ==UserScript==
// @name         Fuck AI Overview
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  no more ai stuff for videos, buh bye
// @author       tero (special thanks to my own brother for helping me btw)
// @match        https://www.youtube.com/*
// @grant        none
// @license MIT
// ==/UserScript==

(function () {
"use strict";

const SETTINGS_KEY = "yt_ai_overview_settings";

function getSettings() {
    const saved = localStorage.getItem(SETTINGS_KEY);
    return saved ? JSON.parse(saved) : { askButton: false };
}

function saveSettings(settings) {
    localStorage.setItem(SETTINGS_KEY, JSON.stringify(settings));
}

function removeAIStuff() {

    const summary = document.querySelector("#video-summary");
    if (summary) summary.remove();

    document
        .querySelectorAll("yt-video-description-youchat-section-view-model")
        .forEach(el => el.remove());
}

function updateAskButtons() {

    const settings = getSettings();

    const buttons = document.querySelectorAll(
        '#flexible-item-buttons button[aria-label="Ask"]'
    );

    buttons.forEach(button => {

        if (settings.askButton) {

            button.disabled = false;
            button.style.opacity = "";
            button.style.cursor = "";
            button.title = "";

        } else {

            button.disabled = true;
            button.setAttribute("aria-disabled", "true");
            button.style.opacity = "0.5";
            button.style.cursor = "not-allowed";
            button.title = "AI Overview is disabled.";

        }

    });
}

function updatePage() {
    removeAIStuff();
    updateAskButtons();
}

function openSettings() {

    if (document.getElementById("ai-script-settings")) return;

    const settings = getSettings();

    const panel = document.createElement("div");
    panel.id = "ai-script-settings";

    panel.style.position = "fixed";
    panel.style.top = "80px";
    panel.style.right = "20px";
    panel.style.background = "#0f0f0f";
    panel.style.color = "white";
    panel.style.padding = "16px";
    panel.style.borderRadius = "12px";
    panel.style.zIndex = "99999";
    panel.style.width = "260px";
    panel.style.fontFamily = "YouTube Sans,Roboto,Arial";

    const title = document.createElement("div");
    title.style.fontSize = "16px";
    title.style.marginBottom = "12px";
    title.textContent = "Fuck AI Overview Settings";

    const label = document.createElement("label");
    label.style.display = "flex";
    label.style.justifyContent = "space-between";
    label.style.alignItems = "center";
    label.style.margin = "10px 0";

    const span = document.createElement("span");
    span.textContent = "Enable 'Ask' button";

    const toggle = document.createElement("input");
    toggle.type = "checkbox";
    toggle.id = "askToggle";

    label.appendChild(span);
    label.appendChild(toggle);

    const footer = document.createElement("div");
    footer.style.marginTop = "14px";
    footer.style.paddingTop = "10px";
    footer.style.borderTop = "1px solid #303030";
    footer.style.fontSize = "11px";
    footer.style.color = "#888";
    footer.style.textAlign = "center";
    footer.style.lineHeight = "1.5";

    const footerText = document.createElement("div");
    footerText.textContent = "Made by Tero";

    const footerLink = document.createElement("a");
    footerLink.href = "https://tero.nekoweb.org/";
    footerLink.target = "_blank";
    footerLink.style.color = "#888";
    footerLink.style.textDecoration = "none";
    footerLink.textContent = "https://tero.nekoweb.org/";

    footer.appendChild(footerText);
    footer.appendChild(footerLink);

    panel.appendChild(title);
    panel.appendChild(label);
    panel.appendChild(footer);

    document.body.appendChild(panel);

    toggle.checked = settings.askButton;

    toggle.onchange = () => {
        settings.askButton = toggle.checked;
        saveSettings(settings);
        updateAskButtons();
    };
}

function addSettingsButton() {

    if (document.getElementById("ai-settings-btn")) return;

    const createButton = document.querySelector('button[aria-label="Create"]');
    if (!createButton) return;

    const button = document.createElement("button");

    button.id = "ai-settings-btn";
    button.textContent = "⚙️";

    button.style.marginLeft = "8px";
    button.style.padding = "6px 10px";
    button.style.borderRadius = "18px";
    button.style.border = "none";
    button.style.background = "#272727";
    button.style.color = "white";
    button.style.cursor = "pointer";

    button.onclick = () => {

        const panel = document.getElementById("ai-script-settings");

        if (panel) {
            panel.remove();
        } else {
            openSettings();
        }
    };

    createButton.parentElement.appendChild(button);
}

function init() {
    updatePage();
    addSettingsButton();
}

window.addEventListener("load", init);

const observer = new MutationObserver(() => {
    updatePage();
    addSettingsButton();
});

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

})();