Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

window.open height includes size of browser bars

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>

Posted on Jul 17, 2012 3:12 PM

Reply
7 replies

Jul 19, 2012 8:31 AM in response to Neville Hillyer

Not sure which is more interesting, Apple development making the error of creating this bug, or me making the error of posting to the wrong forum.


As to the latter, I was hoping that in lieu of a fix, someone in the user community might be able to offer a hack or workaround to the problem. resizeTo after window creation seems the best option right now.

Jul 19, 2012 10:51 AM in response to mickeyfromny

If you want to report this issue to Apple's engineering, send a bug report to Apple via its Bug Reporter system. To do this, register as an Apple Developer—it's free and available for all Mac users and gets you a look at some development software. Since you already have an Apple username/ID, use that. Once a member, go to Apple BugReporter and file your bug report. You'll get a response and a follow-up number; thus, starting a dialog with engineering.

window.open height includes size of browser bars

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.