Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var h = function(selector){
document.querySelectorAll(selector).forEach(function(el){ el.style.display = 'none' })
}
var s = function(selector){
document.querySelectorAll(selector).forEach(function(el){ el.style.display = 'block' })
}
var pathContains = function(text){
return window.location.pathname.indexOf(text) !== -1
}
setInterval(function(){
if (pathContains('/feed/subscriptions') || pathContains('/results') || pathContains('/channel') || pathContains('/playlist')){
s('#related')
s('#comments')
s('#primary')
s('.videowall-endscreen')
}else if (window.location.pathname === '/'){
h('#related')
h('#comments')
h('#primary')
h('.videowall-endscreen')
}else{
s('#primary')
h('#related')
h('#comments')
h('.videowall-endscreen')
}
}, 300)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment