AntiAnnoyingYTFunctions

Removes all YT mix playlist from your recommended videos, out of place looking loading spinners/animations will fix themselves

目前為 2022-04-30 提交的版本,檢視 最新版本

// ==UserScript==
// @name         AntiAnnoyingYTFunctions
// @namespace    https://github.com/RedCommander735
// @version      1.1
// @description  Removes all YT mix playlist from your recommended videos, out of place looking loading spinners/animations will fix themselves
// @author       RedCommander735
// @icon         https://www.google.com/s2/favicons?sz=64&domain=github.io
// @grant        none
// @match        *.youtube.com/*
// @license      WTFPL
// ==/UserScript==

(() => {
    "use strict";
    //download button
    var downloadButton = setInterval(function() {
        if (document.getElementsByTagName("ytd-download-button-renderer").length) {
            console.log("DB exists!");
            document.getElementsByTagName("ytd-download-button-renderer")[0].remove();
            clearInterval(downloadButton);
        }
    }, 100); // check every 100ms
    //mix playlists
    setInterval(function() {
        if (document.getElementsByTagName("ytd-thumbnail-overlay-bottom-panel-renderer").length) {
            console.log("MP exists!");
            document.getElementsByTagName("ytd-thumbnail-overlay-bottom-panel-renderer")[0].parentElement.parentElement.parentElement.parentElement.parentElement.remove();
        }
    }, 1000); // check every 1s

    setInterval(function() {
        const la = document.querySelector(".active .style-scope .tp-yt-paper-spinner").parentNode.parentNode.parentNode.parentNode;
        if (la.nextElementSibling != null) {
            console.log("LA exists!");
            la.remove();
        }
    }, 1000); // check every 1s
})();