YouTube Menu Apps Organizer

Move "More from YouTube" apps to the top navigation and remove from the right tab.

2025-04-03 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

// ==UserScript==
// @name         YouTube Menu Apps Organizer
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Move "More from YouTube" apps to the top navigation and remove from the right tab.
// @author       YourName
// @match        *://www.youtube.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function moveYouTubeApps() {
        let rightMenu = document.querySelector("ytd-guide-section-renderer:last-of-type"); // Likely the right menu
        let topNav = document.querySelector("ytd-masthead #buttons"); // YouTube's top bar

        if (!rightMenu || !topNav) return;

        let appLinks = rightMenu.querySelectorAll("ytd-guide-entry-renderer");

        appLinks.forEach(app => {
            let clonedApp = app.cloneNode(true);
            topNav.appendChild(clonedApp);
        });

        // Hide the original menu instead of removing it (prevents UI bugs)
        rightMenu.style.display = "none";
    }

    function observeMenu() {
        let observer = new MutationObserver(() => {
            if (document.querySelector("ytd-guide-section-renderer:last-of-type") && document.querySelector("ytd-masthead #buttons")) {
                moveYouTubeApps();
                observer.disconnect();
            }
        });

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

    observeMenu();
})();