0

My client requires that the address bar of the browser get hidden as soon he accesses the project . I'm trying to figure out a way to trigger a full screen event on load . But apparently this can't be done since requestfullscreen can only be called with user event (click , keypressed...)

here's my code :

   function goFs(id) {
    var element = document.getElementById(id);

    if (element.mozRequestFullScreen) {
        element.mozRequestFullScreen();
    } else if (element.webkitRequestFullScreen) {
        element.webkitRequestFullScreen();
    }
}
//goFs('test');

Is there any hack to simulate a full screenmode on webapplication load ?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Genjuro
  • 7,405
  • 7
  • 41
  • 61

2 Answers2

4

This is impossible. Browsers are highly resistent to efforts to conceal the URL they are visiting from users (since this would greatly aid efforts to perform phishing attacks).

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
0

The only way I found for doing that is to use a window popup in your first page (index.hxtml for example)

<script type="text/javascript">
function popupAppli(){
    parent.opener = top;
    params = "menubar=no,toolbar=no,location=no,left=0,height=701,width=1016,top=0,scrollbars=no,status=no,resizable=yes";
    loc="(another xhtml page)";
    popsApp = window.open(loc,"My application",params);
    if(parent.location != popsApp.location){
        parent.close();
    }           
</script>

Then, you call the function on body onload

<body onload="popupAppli();"></body>

It's not really full screen but I didn't find another solution

tAft
  • 1