Skip navigation

window.open height includes size of browser bars

435 Views 7 Replies Latest reply: Jul 19, 2012 12:24 PM by Neville Hillyer RSS
mickeyfromny Level 1 Level 1 (0 points)
Currently Being Moderated
Jul 17, 2012 3:12 PM

There is apparently a bug in Safari whereby the window.open request height value is not handled correctly. Even though no browser bars are requested, additional vertical space is factored into the new window height. The amount of space added seems to be determined by which bars are enabled in the parent browser window.

 

This can be easily tested on Windows by comparing the results of the following simple script on various browsers (IE, Chrome, Firefox, Safari).

 

http://www.w3schools.com/js/tryit.asp?filename=tryjs_openwindow

 

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function open_win()
{
window.open("http://www.w3schools.com", "test", "height=200");
}
</script>
</head>

<body>
<form>
<input type="button" value="Open Window" onclick="open_win()">
</form>
</body>

</html>

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.