YouTube Menu Apps Organizer

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         YouTube Menu Apps Organizer
// @namespace    http://tampermonkey.net/
// @version      1.0
// @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() {
        // Select the right-side menu where YouTube apps are currently placed
        let rightMenu = document.querySelector("#sections");  // Adjust based on actual HTML
        let topNav = document.querySelector("#top-level-buttons");  // Adjust based on actual HTML

        if (!rightMenu || !topNav) return;

        // Look for app links inside the right menu
        let appLinks = rightMenu.querySelectorAll("ytd-rich-grid-media");  // Adjust based on actual HTML element

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

        // Optionally, remove the original apps from the right menu
        rightMenu.remove();
    }

    function waitForMenu() {
        let checkExist = setInterval(() => {
            if (document.querySelector("#sections") && document.querySelector("#top-level-buttons")) {
                clearInterval(checkExist);
                moveYouTubeApps();
            }
        }, 1000);
    }

    waitForMenu();
})();