View Full Version : How to disable fullscreen on a popup wondow?

06-12-2012, 12:36 PM
Hey, can anyone give me a hint how do I disable fullscreen button/possibility on a popup window?

I have a code like this:

<script type=text/javascript>
var win= null;
function NewWindow(mypage,myname,w,h,scroll){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars='+scroll+',';
settings +='resizable=no';
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}

function MM_openBrWindow(theURL,winName,features) {

and it is called like this:

<a href="popup.html" onClick="NewWindow(this.href,'name','600','300','yes');return false">Click here</a>

I tried adding settings +='fullscreen=no'; in the script after resizable=no, but it didn't hep. Is it even possible?

06-12-2012, 01:31 PM
You can't, for accessibility reasons.

Read https://developer.mozilla.org/en/DOM/window.open#Window_functionality_features

06-12-2012, 01:35 PM
Ok, thanks for letting me know that.

Will Bontrager
06-12-2012, 02:40 PM
I am a person for whom "can't" is an incentive to do it anyway :)

The viewing area of the browser window can be measured. The popup height and width variable values can be adjusted accordingly before the popup is displayed.

[Edit. Sorry. Misread the original post.

Haven't tried this, but onresize() might be utilized to determine when the popup window is resized and do whatever is appropriate to respond to the event.]


06-12-2012, 09:18 PM
You can't "disable" anything with JavaScript - anything you try to disable that way can be easily bypassed. At worst the person will turn off JavaScript on your page if there isn't a browser setting to ignore whatever you are trying to do.

06-13-2012, 12:32 AM
Is this what you want to do:

var IE = (document.all) ? 1 : 0;
var DOM = 0;
if (parseInt(navigator.appVersion) >=5) {DOM=1};

function keyDown(evt) {
if (DOM) {
if (evt.which == 122) {
evt.which = 0;
return false;
} else {
if (event.keyCode == 122) {
event.keyCode = 0;
return false;

or this:

<SCRIPT LANGUAGE=javascript>
document.onkeydown = function ()
if (122 == event.keyCode)
event.keyCode = 0;
return false;

will make return of full screen (false.)

06-14-2012, 03:52 PM
Hei bundled

Unfortunately these codes didn't do anything for some reason, I was still able to press maximize button on my pop up window :(