Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I usually use Firefox fully maximized, but occasionally I want to use it at a size which covers approximately half the screen. Unfortunately, when I Unmaximize the window, it shrinks to the size that I last used and then immediately resizes to cover the whole screen. Is there any way to make it stay at the size it was when I last had it Unmaximized?

EDIT: Just to clarify, it only does this if I have shut FireFox down since the last time I un-maximized - if it is still running, it works fine.

share|improve this question
1  
Interesting. Mine doesn't do that. Are you using any add-ons that might trigger this? –  Sasha Chedygov Jul 18 '09 at 5:37
    
Not that I know of –  a_m0d Aug 15 '09 at 7:20
add comment

3 Answers

I'll show you three solutions, each of which has its drawbacks, but I hope that at least one of them is acceptable to you.

JavaScript

This is probably the only useful application of window.resizeTo. Type

javascript:window.resizeTo(1280,512)

into the address bar. You can turn this in a bookmarklet easily.

Drawbacks

  • Doesn't work if you have JavaScript turned off.
  • JavaScript blockers may interfer (NoScript doesn't though)
  • Works with the default settings of Firefox but doesn't if you have removed the check mark from Allow scripts to: Move or resize existing windows under Edit/Preferences/Content/Enable JavaScript/Advanced...

Window Manager

wmctrl -r Firefox -e 0,-1,-1,1280,512

Drawbacks:

  • You'll have to have wmctrl installed (there is a wmctrl package for Fedora)
  • Requires EWMH/NetWM compatible X Window Manager (default window managers of KDE and GNOME are supported though)
  • If you have more than one Firefox window open you will have to specify exactly which one you want to resize. See wmctrl documentation on how you can do this, it's not difficult.

Command Line

The most obvious solution is to start Firefox with the desired window geometry. It'll start unmaximized but if you maximize and then again unmaximize, it'll shrink to the size that it had before.

Usually you can determine the window geometry for X Window applications like so:

firefox -geometry 1280x512+0+0

That didn't work for me, so I looked up the Firefox command line options (shortened):

Usage: firefox [ options ... ] [URL]
       where options include:

-height <value>     Set height of startup window to <value>.
-width <value>      Set width of startup window to <value>.
-no-remote      Open new instance, not a new window in running instance.

I tried

firefox -no-remote -height1280 -width 512 

but that didn't work either. I think this is a bug in Firefox, and maybe it works in other versions or on other platforms.

Drawbacks

  • Neither of the above worked for me with Firefox 3.0.12 on Ubuntu 9.04.
  • It only works as long as you don't change the window size manually.
share|improve this answer
add comment

That isn't the default behavior on Linux, Windows, or Mac OS X.

Try starting Firefox in safe mode or with a new profile. If it doesn't happen there, start disabling extensions until you find the culprit.

The Mozilla knowledge base has instructions on starting Firefox in safe mode.

You can easily create a new profile (without harming your current one) by following the Profile Manager instructions.

share|improve this answer
add comment

Several years later and still an unanswered question. I've written a small utility which allows me to specify Firefox window position at startup. Have a look at http://www.ipsec.info/w/t/override-gtk-geometry.c . Instructions for compilation and usage are included in the source.

Currently it only allows you to specify startup position and size. You can adjust the source to suit your needs, for example to resize the window on some event at runtime.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.