views:

95

answers:

2

I am just trying a simple application, to make the browser fullscreen. this is working for Internet Explorer, but not for firefox. Also I want to know, that can the same thing be done in Mac OC? do i have to make changes for Mac OS (using safari, firefox etc)

the code it below.

    <html>
<head>
<script type="text/javascript">

function fullScreen()
{
var obj = new ActiveXObject("Wscript.shell"); 
obj.SendKeys("{F11}"); 
}

</script>


</head>

<body>
<form>
<input type="button" value="Click me!" onclick="fullScreen()" />
</form>

<p>By pressing the button above, a function will be called. The function will alert a message.</p>

</body>
</html>

Regards Zeeshan

+2  A: 

All modern browsers, including IE8, allow the user to disallow a script's opening, moving or resizing a window. Also, IE allows you to prohibit activeX from untrusted (internet) sites, and the other browsers don't have native activeX. so your solution may have very few successes, and a lot of errors and security warnings.

Of course, users can press f-11 anytime- maybe you could suggest they do so.

kennebec
I get what you are saying, but still this is a requirement. And m still looking for an answer.
Zeeshan Rang
A: 

I believe ActiveXObject is IE specific so it will never work on FF.

dplass