YouTube - Remove Comments on Others' Videos

Dramatically reduce the stress that watching videos causes by getting rid of the comments down below.

目前为 2022-10-18 提交的版本。查看 最新版本

// ==UserScript==
// @name         YouTube - Remove Comments on Others' Videos
// @namespace    https://gf.qytechs.cn/en/users/761164
// @version      2.0.0
// @description  Dramatically reduce the stress that watching videos causes by getting rid of the comments down below.
// @homepage     https://gf.qytechs.cn/en/users/761164
// @author       XerBlade
// @match        https://www.youtube.com/watch*
// @icon         https://www.google.com/s2/favicons?domain=youtube.com
// @require      https://gitcdn.xyz/repo/CoeJoder/waitForKeyElements.js/3439cbc6f49da5bfc4c3597a7906f1c5203a260d/waitForKeyElements.js
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    waitForKeyElements("#subscribe-button a", (subButton) => {
        // Check if is your own video first
        // If this is not one of your videos, there shouldn't be an Edit button, in theory
        /*if (!!document.querySelector('#subscribe-button a[href$="/edit"]')) {
            return;
        }*/
        console.log(subButton);
        if (subButton.href.endsWith("/edit")) {
            console.log("user");
            return;
        }
        console.log("not user");

        // Comments go bye bye
        waitForKeyElements("#comments", (comments) => {
            console.log("comments");
            comments.remove();
        });
        waitForKeyElements("#comment-teaser", (teaser) => {
            console.log("comment-teaser");
            teaser.remove();
        });
    });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址