summaryrefslogtreecommitdiffstats
path: root/.local/share/qutebrowser/greasemonkey/youtube_shorts_blocker.js
blob: 8f94a1005b6a87572f967870bc9f5f6470cb3eda (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// ==UserScript==
// @name         YouTube Shorts Blocker
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  Blocks the YouTube shorts from appearing.
// @author       Aiden Charles
// @license      MIT
// @match        https://www.youtube.com/*
// @require      https://code.jquery.com/jquery-3.4.1.slim.min.js
// @grant        none
// ==/UserScript==
 
(function() {
    console.log("YouTube Shorts blocker script is running!");
 
    function hide() {
        $("ytd-reel-shelf-renderer").hide();
        $("a[title='Shorts']").hide();
        $('a[href^="/shorts/"]').closest('ytd-video-renderer').hide();
        $('span:contains("Shorts")').closest('#content.ytd-rich-section-renderer').hide();
    }

    hide();
    setInterval(hide, 1000);
})();