window.open width ignored in Chrome

Hadiyah Mujhid picture Hadiyah Mujhid · Mar 18, 2013 · Viewed 10.7k times · Source

I want to create a popup of a fixed size, however the width attribute is ignored in Chrome. But Works fine in FF.

Here's my code:

window.open('','','width=300');

The resultant popup is larger than the given width.

Any suggestions?

Answer

Andy Lorenz picture Andy Lorenz · Mar 25, 2014

it would seem to be some bizarre quirk in Chrome, that you have to specify both a width and a height to get it to observe the dimensions set. If you only specify a height, or a width, then that single dimension is ignored. Hence why in the other answer it worked fine for Jeff.