Last active
August 20, 2017 19:15
-
-
Save nalply/6bcb91154df56b58974a65ebb3f0b492 to your computer and use it in GitHub Desktop.
Youtube user script to hide recommendations and to redirect to a blank page after a video has ended. No guarantee given that it works.
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
// Remove sidebar repeatedly | |
setInterval(function() { | |
const sidebar = document.querySelector('#watch7-sidebar') | |
if (sidebar && sidebar.remove) sidebar.remove() | |
const sidebarModules = document.querySelector('#watch7-sidebar-modules') | |
if (sidebarModules && sidebarModules.remove) sidebarModules.remove() | |
console.log('test') | |
}, 500) | |
// Remove player after it has been stopped | |
const id = setInterval(function() { | |
const hasStopped = !!document.querySelector('.ytp-play-button').title | |
if (hasStopped) { | |
clearInterval(id) | |
location.replace('about:blank') | |
} | |
}, 200) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment