views:

177

answers:

3

I'm doing some work with the new Facebook js library, http://github.com/facebook/connect-js. There's one thing that bugs me, which is that when you are using Firefox and have the option "Open new windows in a new tab instead" enabled, the login popup opens in a new tab and then resizes the entire browser. It doesn't restore to the original size after successful login or cancel.

The popup window is being opened with window.open(). I'm curious to see if there's a way to detect if a window is opened as a tab or as a separate window. If so, I think I can come up with a work around to restore the window size in affected browsers.

A: 

If you do not specify window dimensions, you get a new tab.

Diodeus
A: 

I'd say submit a bug report to Mozilla. This is something they should detect and prevent.

Bart van Heukelom
+2  A: 

If you specify window dimensions in your call to window.open() , the page will open in a new window. If you don't specify window dimensions when calling to window.open(), then the page will open in a new tab (if the user have enabled the option "Open new windows in a new tab instead").

window.open(url,title,"width=1200,height=900"); // this call show the page in a new window
window.open(url,title); // this call show the page in a new tab (if Tab option is enabled)
Fernando Martínez