YouTube Menu Apps Organizer

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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();
})();