Thursday, 17 July 2008

Firefox 3.0.1 breaks window.open() width

I've just noticed that the application I'm working on has started behaving strangely in Firefox. There's a pop-up window, where we specify the width to be 800, but Firefox is displaying that pop-up at a width of 600. The call looks like this (URLs changed to protect the innocent):-

<a href="#" onclick="window.open('http://www.google.com', 'Test', 'width=800, height=800'); return false;">Example - broken in Firefox 3.0.1</a>


Example - broken in Firefox 3.0.1

This was working fine this morning, so I'm assuming that it's a problem with the 3.0.1 patch release of Firefox, which I installed at lunch time.

This is annoying, and I expect it to be fixed by the Firefox developers soon, but in the mean-time an easy patch is to also set the outerwidth property in the window.open features (according to this Popup Window Reference, that's Firefox-specific so should be safe):-

<a href="#" onclick="window.open('http://www.google.com', 'Test', 'width=800, height=800, outerwidth=800'); return false;">Example - works in Firefox 3.0.1</a>

Example - works in Firefox 3.0.1

I hope this helps anyone else hitting the same issue!

Update: This bug may not be related specifically to Firefox 3.0.1. A colleague has tried both links and both links work (the window is opened with a width of 800). When I played around with my window size in Firefox 3.0.1, I found that sometimes the first link works, and sometimes it does not.
Firefox 2.0.0.14 seems to be fine, even when you play with the window size. Perhaps it's something to do with the myriad Add-ons I have installed!

5 comments:

Anonymous said...

Hello,

Since I have installed Firefox 3, the problem you are talking about showed up : Firefox 3 does not respect the "width" JavaScript specification of the window.open() method.

Although all the JavaScript "Advanced..." settings are enabled in the options of my Firefox 3.0.1., Firefox not only ignores the "width" specification, but also ignores the "resizable" specification...

This is really annoying and bound to Firefox 3. It did not occur in Firefox 2.x and does not happen in Internet Explorer 6.

I hope Mozilla will fix this soon.

Kind regards,

hughesgdp
Webdesigner / Webdeveloper.

Anonymous said...

I was digging how it happens and I found it's an Extended statusbar plugin issue.

Anonymous said...

Well, Mozilla has fixed it ! :-)
With latest Firefox version 3.0.8 everything cool ^^ :-)

Regards,
hughesgdp.
webdesigner/webdeveloper.

Anonymous said...

I don't know about that. On 3.0.9 (Ubuntu) the problem is still showing up.

Unknown said...

Sorry for Ubuntu, I do not know about Firefox running on Linux. I use and was talking about Firefox on Windows (XP).
All I can say is : Good luck !

Regards,
hughesgdp