Diskuse » Creation Requests

remove the youtube audio track setting

§
Posted: 25. 07. 2025

can someone make a script that removes the youtube audio track setting (it's the one in the middle)

§
Posted: 25. 07. 2025

For something as simple as hiding an element, the best way is to just write a filter rule. Please paste this rule into "My Filters" in uBlock Origin or "User rules" in AdGuard.

www.youtube.com##.ytp-audio-menu-item

If you'd rather use a UserScript, here you go:

// ==UserScript==
// @name         Hide YouTube Audio Track Selector
// @namespace    
// @version      0.1
// @description  Hides the 'Audio track' option in the YouTube player settings.
// @author       
// @match        https://www.youtube.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const hideAudioTrackElement = () => {
        const audioTrackMenuItem = document.querySelector('.ytp-audio-menu-item');
        if (audioTrackMenuItem && audioTrackMenuItem.style.display !== 'none') {
            audioTrackMenuItem.style.display = 'none';
        }
    };

    const observer = new MutationObserver(hideAudioTrackElement);

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();
§
Posted: 25. 07. 2025

thank you so much man

Post reply

Sign in to post a reply.

长期地址
遇到问题?请前往 GitHub 提 Issues。