Tag Archives: Calling Browser Function for Fullscreen window using Java Script

Calling Browser Function for Fullscreen window using Java Script on IE

Hi All,

In this article I will show how to call browser function to full screen the window using Java Script+ActiveX. This example is based on IE. although it is very easy to use Window.open method in Java script to achieve the same but sometime we might face the need to use the same behavior which IE browser F11 gives.

function fullScreenWindow()
{
try{
// Get the ActiveX object from the Window
var acvxObj= new ActiveXObject("Wscript.shell");
// Now sends a key to fullscreen
acvxObj.SendKeys("{F11}");
}catch(e){

}
}

You can use the same function for any toggling full screen effect.

[NOTE] Whenever you call this method you will get a confirmation from IE Browser for ActiveX use.

Hope this helps.


Thanks
R Vashi.