Last active
December 6, 2017 21:09
-
-
Save LunaSquee/914688a22fa5699069dac8335e55ff85 to your computer and use it in GitHub Desktop.
YouTube Trending is trash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name YouTube Trending is trash | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description YouTube Trending is trash | |
// @author Evert | |
// @match https://www.youtube.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var trash = '<svg width="24px" height="24px" viewBox="0 0 24 24" focusable="false" class="style-scope yt-icon"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg>'; | |
setTimeout(function () { | |
var elems = document.querySelectorAll("a[href=\"/feed/trending\"]"); | |
for (var i in elems) { | |
var elem = elems[i]; | |
if (!elem || !elem.innerHTML) continue; | |
if (elem.innerHTML.indexOf('Trending') !== -1) { | |
var contentTag = elem.querySelector(".title"); | |
var imageTag = elem.querySelector(".guide-icon"); | |
if (!contentTag || !imageTag) continue; | |
imageTag.innerHTML = trash; | |
contentTag.innerHTML = 'Trash Can'; | |
} | |
} | |
}, 2000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment