Riddik Posted September 25, 2014 Share Posted September 25, 2014 Hi, How i can hide the browsers address-bar on mobile devices? This code don't work. window.onload = function(){ setTimeout("window.scrollTo(0, 1)", 10); game = new Phaser.Game(...);} Link to comment Share on other sites More sharing options...
sharbelfs Posted September 25, 2014 Share Posted September 25, 2014 the game do it automaticaly, dont need the timeout Link to comment Share on other sites More sharing options...
sharbelfs Posted September 25, 2014 Share Posted September 25, 2014 sorry, but actually you need to call this.scale.setScreenSize(true); for the game to hide the bar Link to comment Share on other sites More sharing options...
chg Posted September 25, 2014 Share Posted September 25, 2014 I believe this has an allpurpose routine: https://github.com/scottjehl/Hide-Address-Bar the only thing it does that you may not want is not scroll to hide the address bar if the url has a fragment identifier (#), though I've seen it mentioned that you may need extra space on iOS8 or else it may not scroll - I don't have any way to test/verify this Link to comment Share on other sites More sharing options...
lewster32 Posted September 25, 2014 Share Posted September 25, 2014 I'm pretty sure there are no tricks at the moment for iOS 8 to hide or reduce the address bar. The scrolling down by one pixel trick doesn't work anymore, and hasn't for a while. Link to comment Share on other sites More sharing options...
chg Posted September 25, 2014 Share Posted September 25, 2014 So not much hope for the answers here working then Lewster? http://stackoverflow.com/questions/24889100/ios-8-removed-minimal-ui-viewport-property-are-there-other-soft-fullscreen Link to comment Share on other sites More sharing options...
lewster32 Posted September 25, 2014 Share Posted September 25, 2014 I think your mileage may vary, but definitely worth testing I guess. Link to comment Share on other sites More sharing options...
AshleyScirra Posted September 25, 2014 Share Posted September 25, 2014 It seems browser makers really don't like people doing that, and over time there's been an arms race between developers working out the next hack that hides the address bar, and then browser updates that block the latest hack. That's part of the reason the scrollTo hack doesn't work any more. Basically you shouldn't do this. On Chrome for Android, just use the standards-compliant fullscreen API, and it hides everything. Link to comment Share on other sites More sharing options...
Riddik Posted September 26, 2014 Author Share Posted September 26, 2014 sorry, but actually you need to call this.scale.setScreenSize(true); for the game to hide the bar Unfortunately it's not work. I'm pretty sure there are no tricks at the moment for iOS 8 to hide or reduce the address bar. The scrolling down by one pixel trick doesn't work anymore, and hasn't for a while. And what about iOS 7 and Android? I believe this has an allpurpose routine: https://github.com/scottjehl/Hide-Address-Bar the only thing it does that you may not want is not scroll to hide the address bar if the url has a fragment identifier (#), though I've seen it mentioned that you may need extra space on iOS8 or else it may not scroll - I don't have any way to test/verify this on iOS 8 and Android (Opera) don't work too. Link to comment Share on other sites More sharing options...
lewster32 Posted September 26, 2014 Share Posted September 26, 2014 iOS 7.1 has the viewport meta minimal-ui declaration, but it's not on any version before that, and was removed in iOS 8. The stackoverflow link above is probably worth watching but like AshleyScirra says above: It seems browser makers really don't like people doing that, and over time there's been an arms race between developers working out the next hack that hides the address bar, and then browser updates that block the latest hack. Link to comment Share on other sites More sharing options...
kiwi Posted October 1, 2015 Share Posted October 1, 2015 hi, any news about this issue? Is there a way to hide the address bar? thanks Link to comment Share on other sites More sharing options...
Recommended Posts