0

I want to automatically maximize the active browser window.

This example is working well with MS explorer:

How to auto maximize window screen when link is opened?

But it is not working with Chrome. How to do it compliant for Chrome?

Community
  • 1
  • 1

1 Answers1

0

try this piece of code from super user which uses the Chrome Fullscreen API

var el = document.documentElement
    , rfs = // for newer Webkit and Firefox
           el.requestFullScreen
        || el.webkitRequestFullScreen
        || el.mozRequestFullScreen
        || el.msRequestFullScreen
;
if(typeof rfs!="undefined" && rfs){
  rfs.call(el);
} else if(typeof window.ActiveXObject!="undefined"){
  // for Internet Explorer
  var wscript = new ActiveXObject("WScript.Shell");
  if (wscript!=null) {
     wscript.SendKeys("{F11}");
  }
}
Community
  • 1
  • 1
Rachel Gallen
  • 27,943
  • 21
  • 72
  • 81