YT - Premium and Trending removal

Removes Premium and Trending items from the menu

Click here to install Browse More Scripts
// ==UserScript==
// @name         YT - Premium and Trending removal
// @namespace    4f4b454523374eb33ce5dd96bbe61c0adb2fa576
// @version      0.6
// @description  Removes Premium and Trending items from the menu
// @author       /u/AyrA_ch
// @match        https://*.youtube.com/*
// @match        https://youtube.com/*
// @grant        none
// ==/UserScript==

// Changelog
// 0.6 Remove new "Shorts" button
// 0.5 Remove new "explore" button
// 0.4 New Design support
// 0.3 Fixed removal of wrong elements
// 0.2 Added YT TV link
// 0.1 Remove trending and premium

(function ($) {
    'use strict';
    var keys = [
        //New Design
        "[href='/feed/trending']",
        "[href='/feed/explore']",
        "[href='/premium']",
		"ytd-guide-entry-renderer [title='Shorts']",
        //Old Design
        "#unlimited-guide-item",
        "#trending-guide-item"
    ];
    var removeItems = function () {
        var removals = keys.map(function (v) {
            return $(v);
        });
        for (var i = 0; i < removals.length; i++) {
            if (removals[i]) {
                removals[i].remove();
            }
        }
        //Special removals
        var e = $(".guide-unplugged-icon");
        if (e) {
            e.parentNode.parentNode.parentNode.remove();
        }
    };
    var observer = new MutationObserver(removeItems);
    var config = {
        attributes: false,
        childList: true,
        characterData: false,
        subtree: true
    };
    observer.observe(document.body, config);
})(document.querySelector.bind(document));

/*
LICENSE:
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
The full license text can be found here: http://creativecommons.org/licenses/by-nc-sa/4.0/
The link has an easy to understand version of the license and the full license text.

DISCLAIMER:
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
*/

Copyright © 2018 by Kevin Gut 📧 | More services | Generated for 3.133.144.140