Remove YouTube Comments on Mobile Firefox

Removes the comments section on the YouTube mobile site.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Remove YouTube Comments on Mobile Firefox
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Removes the comments section on the YouTube mobile site.
// @author       nickm8
// @match        https://m.youtube.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const removeCommentsSection = () => {
        // Select the comments section by class
        const commentsSection = document.querySelector('.ytVideoMetadataCarouselViewModelTitleSection');
        if (commentsSection) {
            commentsSection.parentNode.remove();
            console.log('Comments section removed.');
        }
    };

    removeCommentsSection();

    // Observe DOM changes to handle dynamically loaded content
    const observer = new MutationObserver(() => {
        removeCommentsSection();
    });

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