views:

1917

answers:

6

I have a webapp which resizes its window to exactly fit its contents:

window.resizeTo(200,300)

People do like having the page fit its window in this way. However with Firefox the next browser window the user opens comes up at the same size, which is ridiculously small.

Is there a way to tell Firefox to resize the current window, but not change its notion of how large subsequent windows should be?

+3  A: 

People do like having the page fit its window in this way.

Which people?! I'd be seriously annoyed if a web page did anything to the size of my browser window. Fortunately, FF also allows users to disable moving or resizing existing windows, a feature i've taken advantage of for several years.

You should be able to open a new window at a specific size using window.open, so you could use that... or better yet, just allow your document to resize / reflow to fit into whatever window size the user prefers.

Shog9
which people == my product manager, which is therefore the prevailing opinion.
DGentry
:shrug: well, you gotta deal with that. Be aware though, this is a feature likely to see less-than-full support as time goes on.
Shog9
I reckon if you polled all of the stackoverflow userbase, you'd find that most of them would be seriously annoyed about websites resizing browser windows without permission.
different
+4  A: 

Two different questions at work here:

1. Specifying Window Dimensions-

Specifying window attributes using window.open will not affect the dimensions of other windows.
You are getting the expected behavior from Firefox with regards to the resizeTo function.

2. The User Experience-

What users value first and foremost is maintaining control of their environment and your product. It's important to let them resize their browser windows. The browser is an application on their desktop machine, and most windowed operating systems give the user general control over the size and placement of windows. Controlling the size of the window is a step into their personal workspace.

I'm in agreement with @Shog9, that you should reconsider your use of window.resizeTo.. It's probably not appropriate to force the window to any particular size, except perhaps in the case of a popup. Using Liquid layouts may help you achieve an acceptable design for any reasonable window dimension.

keparo
+2  A: 

Argh, I have a weather site doing that: trying to spawn a popup (which ends being a new tab) and resizing it (thus resizing the whole Firefox browser!).

No need to say I hate it.

Some popups are blocked, others manage to be displayed as popup, others go to a new tab. It depends on the method used to spawn them and the browser/extensions settings. Nearly impossible to control, even less in a cross-browser way.

The modern way (still very annoying for ads!) is to do div overlays, a bit less intrusive. Of course, it might not suit every need.

PhiLho
+1  A: 

The only way to do it as one of the poster already mentioned is to set width and height when you open new popup by window.open - window.open('http://www.google.com', 'Test', 'width=800, height=800'); Window.resizeTo never worked in Firefox for whatever reason, political ot technical. And apparently Firefox developers managed to broke window.open() in Firefox 3.01, refer to this blog post - http://tough-to-find.blogspot.com/2008/07/firefox-301-breaks-windowopen-width.html

+2  A: 

Just want to add that your best shot is to avoid using window.open and use instead some sort of LightWindow framework - much nicer, behaves the same on all browsers and not affected by browser options. You can see a sample framework here http://www.stickmanlabs.com/lightwindow/

+2  A: 

Strongly agree that in nearly every case, sites that resize the viewport totally suck.

The size of the app window is for the user to decide, and not for web site owners to screw with.

In very rare cases there may be a good argument for it, or a client might just insist on it cos "they know better", but it always sucks.

It is a huge annoyance for most users, especially when you have 17 tabs open at 1600 px wide, and some print designer decreed that the next tab you open, should force all your other ones to 300 px wide.

It is much more user friendly to use something like thick/light/grey/slim-box techniques.

I just find alternative web sites, or run a greasemonkey script to avoid sites doing that.

Just had to rant about that. Sorry.

seanb