Skip to content

Instantly share code, notes, and snippets.

@plugnburn
Created Mar 26, 2015
Embed
What would you like to do?
BarBust - a JS hack to hide mobile browser's address bar on load or handheld rotation
if('addEventListener'in self && 'pageYOffset'in self && !location.hash.substr(1)) {
(function(c){
self.addEventListener('DOMContentLoaded',c,!1);
self.addEventListener('orientationchange',c,!1)
})(function(){
setTimeout(function(P){
P=self.pageYOffset;
self.scrollTo(0,1);
if(self.pageYOffset) self.scrollTo(0,0);
if(P>20) self.scrollTo(0,P)
},1)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment