Last active
December 3, 2019 19:35
-
-
Save ipepe/0a1aaa388cbadd778529a838282ad076 to your computer and use it in GitHub Desktop.
This file contains 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
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