Last active
February 18, 2022 11:33
-
-
Save Mte90/ef375386e531fd41abeef4f3821b48b8 to your computer and use it in GitHub Desktop.
Hide Youtube video from Reddit
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 Hide Youtube video from Reddit | |
// @namespace Mte90 | |
// @match https://reddit.com/* | |
// @match https://www.reddit.com/* | |
// @grant none | |
// @version 1.0 | |
// @author - | |
// @description As per title | |
// ==/UserScript== | |
function remove_youtube() { | |
document.querySelectorAll('.styled-outbound-link').forEach(function(Item) { | |
if ( Item.href.includes('youtube.com') || Item.href.includes('youtu.be') ) { | |
Item.closest('.Post').parentNode.style.display = 'none'; | |
} | |
}); | |
} | |
setTimeout(function(){ | |
remove_youtube(); | |
}, 2500); | |
document.addEventListener('scroll', function(e) { | |
remove_youtube(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment