Reputation: 16248
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?
Upvotes: 3
Views: 2976
Reputation: 1889
Here's some related information that may help users reading this post.
Firefox has been pressured to remove support for window.resizeTo, and it appears for a short while did. See http://kb.mozillazine.org/Resizing_oversize_window#JavaScript_no_longer_allowed_to_resize_windows
You can disable window resizing in Firefox: http://www.howtogeek.com/howto/internet/firefox/disable-web-site-window-resizing-in-firefox/
If you've enabled JavaScript window resizing and it's still not working, then you probably have Firebug installed. Disable Firebug and restart Firefox, and window.resizeTo will function again. See here: https://bugzilla.mozilla.org/show_bug.cgi?id=565541#c47
As for whether window resizing should occur, I can't think of many cases, but I know of one so I'll share it. I code a help window that has an optional navigation pane. I have a button that allows users to show/hide the navigation pane. When they show it, I resize the window for them to allow space for the navigation pane. In this case it's user initiated, so it doesn't annoy users. However, disabling resizeTo would make that impossible and thus diminish the user experience (in this case). What it boils down to in most cases is that most tools can be used for good or bad. The more considerate people are, the less problem there is with cool tools.
Upvotes: 0
Reputation: 6954
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.
Upvotes: 2
Reputation: 34129
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.
Upvotes: 4
Reputation: 190
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/
Upvotes: 2
Reputation: 190
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
Upvotes: 1
Reputation: 41152
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.
Upvotes: 2
Reputation: 159668
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.
Upvotes: 4