6

I have tried the various scrollTo() solutions which hide the address bar in a mobile browser, but none of them seem to work at all in mobile Firefox.

Is there a different trick which needs to be used in that situation?

Ortomala Lokni
  • 56,620
  • 24
  • 188
  • 240
Michael
  • 9,060
  • 14
  • 61
  • 123
  • The scrollTo() solution works perfectly only if your page height is bigger than the device screen. The scrollto event is going to undisplay the top bar by scroling to the bottom of the page (30px for safari on iphone). But, if your page height is less than the screen the screen of your device + 30px, the event can't work. – Romain Apr 23 '13 at 23:28
  • 1
    page height doesn't seem to matter. the problem seems to be mobile firefox – Michael Apr 24 '13 at 03:56
  • There was a movement in browser development when almost all players added some form of uneditable URL bars to all popup windows which used to be completely clutter-free. I think it's meant as a security feature. – Zdenek Jun 20 '14 at 20:52
  • Try this one: http://stackoverflow.com/questions/5855969/hide-address-bar-in-mobile-device-browser – Rusher Jun 23 '14 at 23:20

3 Answers3

3

If you're in charge of writing the pages that you want fullscreen, you can run these littl bits of code to use the API:

function setFullScreen(el) {

    if (el.requestFullscreen) {
        el.requestFullscreen();
    } else if (el.msRequestFullscreen) {
        el.msRequestFullscreen();
    }else if (el.mozRequestFullScreen) {
        el.mozRequestFullScreen();
    }else if (el.webkitRequestFullscreen) {
        el.webkitRequestFullscreen();
    }
}

function exitFullScreen(){
    if (document.exitFullscreen) {
        document.exitFullscreen();
    } else if (document.msExitFullscreen) {
        document.msExitFullscreen();
    }else if (document.mozCancelFullScreen) {
        document.mozCancelFullScreen();
    }else if (document.webkitCancelFullScreen) {
        document.webkitCancelFullScreen();
    }
}

function toggleFullScreen(){
    if(!document.fullscreenElement && !document.msFullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement){
        setFullScreen(document.documentElement);
    }else{
        exitFullScreen();
    }
}
alfadog67
  • 831
  • 7
  • 28
  • Works a treat on an old Android 4.4 media stick once I set `full-screen-api.allow-trusted-requests-only` to `false` in firefox's about:config – lane Feb 23 '19 at 17:05
0

You have to make browser go to full screen mode to achieve that.

For mobile FF you have to create manifest and at there:

"fullscreen": "true"

https://developer.mozilla.org/en-US/Apps/Build/Manifest#fullscreen

Kinga
  • 386
  • 1
  • 8
  • 2
    The question is about firefox mobile (which is an android app) and your answer is about firefox OS. I tried it on a Google Tango with android 4.2 and firefox browser, but this fullscreen trick does not work. – Hacky Oct 19 '16 at 07:02
-2

No, there is no way at this moment to do this in mobile firefox. Not even the scrollTo() trick or a manifest file.

Hacky
  • 305
  • 4
  • 15