Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding the address bar in mobile Firefox

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?

like image 903
Michael Avatar asked Apr 23 '13 23:04

Michael


People also ask

How do I hide the address bar in Firefox Android?

Select Menu > Settings. Select Customize on the page that opens. Locate the "scroll to hide toolbar" toggle on the page and flip it to set it to off (it is displayed in gray if it is off).

How do I remove the address bar from Firefox search?

You need to set keyword. enabled = false on the about:config page to disable searching via the location bar.

How do I turn off mobile view in Firefox?

Firefox for Android lets you switch between desktop and mobile view: Open the page you want to view in Firefox. Tap the menu button. Toggle the switch next to Desktop site to turn it on and off.


1 Answers

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();
    }
}
like image 128
alfadog67 Avatar answered Sep 23 '22 04:09

alfadog67