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

wrong pop-up window size in Safari 5.1

Have other web developers noticed that Safari 5.1 opens pop-up windows at the wrong size? It opens windows about 86 pixels taller than specified, which is a problem when you have content that is meant to fit the pop-up window dimensions. This wasn't a problem in earlier versions of Safari, and it makes Safari 5.1 different from all other browsers and platforms. Surely 5.1 must be non-compliant now in this regard? I reported it as a 'bug' to Apple but it has not been fixed, and who knows if Apple considers it a bug. If anyone has a suggested workaround I'd appreciate it. Thanks.

Posted on Sep 22, 2011 5:26 PM

Reply
8 replies

Sep 28, 2011 5:40 AM in response to stepg

Have had exactly the same problem since upgrade to 5.1. Extremely frustrating. Have not reprogrammed anything as Apple definitely need to fix this. However had a weird experience last night when the sizes suddenly reverted to correct size on opening. Cannot explain this! Back to wrong tall size this morning.

Oct 5, 2011 5:19 AM in response to stepg

Using picturewindow Fever in Dreamweaver (which opens a popup containing an image and nothing else) for any image smaller than about 750x470px the popup window has scrollbars and hides a little of the image. Using the web inspector shows that the popup page computed width is 15 pixels smaller than the width of the image. Using images of 750x470px and greater, the image fills the popup, there are no scrollbars and the computed width is the same as the width of the image. The computed height is correct in all cases.


Also. The web inspector shows that Fever is correctly writing the name of the page in the <title> tags. It just will not show at the top of the page. It stays as 'Untitled'. All other browsers show the correct name.


Baffling and annoying.

Dec 26, 2011 8:14 AM in response to stepg

I've been encountering the same bug in Safari since 5.1 came out. I've done quite a bit of experimenting (using Snow Leopard; I haven't installed Lion) and this is what I found:


The child window opens much too tall if the parent window fills the vertical height of the screen. However, if the parent window is not that tall, then the child window only opens 2 pixels too tall.


You can't fix the problem by constraining the HTML and/or Body tags in CSS. Overflow=hidden and !important don't help either. That's because the problem isn't the contents of the window, it's the window itself.


This is a blatant bug, and is infuriating. You can't blame it simply on WebKit, because Chrome doesn't exhibit this bug (although I believe it uses a different version of WebKit). No other browser I've tested exhibits this bug. (I haven't tried Safari for Windows or Safari Mobile.) I suppose it might be possible to resize the window after the fact using JavaScript; I may try that.


The truth is that Safari 5.1 is buggy in general -- the buggiest version of Safari I've ever seen.

Jul 13, 2012 7:48 AM in response to Macrocosm

Updating this minor discussion with new discoveries should anyone stumble upon it...


If the site visitor's browser window is at 100% full screen height, pop-up windows open too tall. But if the visitor's browser window is even just slightly shorter than full screen height, then the pop-up windows open at the correct, coded size. It's a little infuriating and difficult to work-around. Perhaps a window resize to about 90% or 95% of full screen height (ideally only if their window is already at 100% height), would fix the pop-up window size problems.


I do wonder if somehow this has something to do with Lion's "full screen" app mode, and if so, it's unlikely Apple will ever "fix" this issue to suit what are admittedly older pop-up content window sites and early web design thinking. More modern "hover" in front content display may also be a better workaround.

Jul 13, 2012 1:27 PM in response to stepg

...if the visitor's browser window is even just slightly shorter than full screen height, then the pop-up windows open at the correct, coded size.

Actually, my experience is that in that case the popup is still 2px too tall, but that's hardly noticeable.

Perhaps a window resize to about 90% or 95% of full screen height (ideally only if their window is already at 100% height), would fix the pop-up window size problems.

Are you suggesting that we try resizing the user's main window just so our popup window comes up at the right size? That seems a little extreme, even if it's possible.

I do wonder if somehow this has something to do with Lion's "full screen" app mode...

I have this problem occurring in Snow Leopard, which doesn't even have that mode.


This whole thing has me wondering whether I should abandon popup windows and just move to JavaScript Modal Windows (faux windows) like almost everybody else -- I rarely see real popup windows anymore. Of course I don't use jQuery or any other JS framework (I like coding everything from scratch) so I couldn't just drop in a plugin to do that. But if someone knows of a stand-alone utility function to create JavaScript Modal Windows I'd love to hear of it.

Jul 13, 2012 2:00 PM in response to Macrocosm

Yes, resizing the window just for the right pop-up window size would be extreme, and even if doable, would only help with Mac. Safari 5 in Windows XP and Windows 7 still open the pop-ups too tall, regardless of the main window height. Shorter than full screen makes no difference.


And of course the pop-up windows open a different size too tall in Lion 10.7 than they do in Leopard 10.6.x


In a couple of weeks we'll find out what happens with Safari 6 in ML 10.8.


I'm looking for 'faux window' code too, but which will still play flash content, and launch even more small pop-up windows for movie trailers. These are "legacy" flash web sites which the clients have no budgets for or interest in completely doing over, and meanwhile NO other web browsers have this problem, just Safari.


This 'bug' seemed to appear when Apple released Lion, so I speculate some code they added to handle full screen in Lion ended up in Safari and now affects all systems, even Safari for Windows. Maddening!

Jul 15, 2012 3:51 PM in response to stepg

A footnote: the wrong popup window size problem is so erratic and unpredictable. One day they open the right size, regardless of the main window size, the next day they always open at the wrong size, regardless of the main window size. Then other days they do open the right size if the window is not full size.


I've caved and abandoned the popups. I'm incorporating http://fancyapps.com/fancybox/ and yes, lots of JavaScript and jQuery, but it's going well. Works with swf flash files and external links too.


Good luck.

Jul 28, 2012 8:34 AM in response to stepg

Safari 6 for Lion and Mountain Lion continue this wrong popup window size behavior if the parent browser window is full screen height.


Though results are occasionally just as erratic, sometimes you can never get the wrong size window, other times only the wrong size window.


Guess this is one of Apple's "advanced new features" (?)

wrong pop-up window size in Safari 5.1

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