The most annoying Firefox thing

If you can get this to work on your system, you’re a better person than I.

firefox -width 800 -height 600

I can’t remember the last time the command line height and width flags worked in Firefox. I don’t know why those flags are there, or if they’re broken, or if they’re deprecated, or if they’re a huge joke the Firefox brainiacs like to play on us normal people. Maybe I’m just using them wrong, or maybe it’s annoying regardless.

But I got tired of resizing the windows every time I moved a profile or changed a screen dimension. So I found two ways to convince Firefox that “me-Tarzan-you-Jane,” and start at the size I want.

The first is to manually edit the localstore.rdf file in your profile, and set the desired size. Of course, that file can be overwritten in the course of using Firefox, so unless you employ a script to open the browser and then restore your preferred sizes after Firefox closes, it might not work on a permanent basis.

Instead, what I’ve been doing is to change the prompt from Openbox or wbar to this:

firefox javascript:%20resizeTo\(800,600\)

Note the two backslashes in that line, to escape the parentheses. No matter what your last dimensions were, the screen should bounce back to 800×600. You could conceivably set your home page to that too, if you don’t mind opening Firefox to a blank page, or if you want a one-button size fixer.

Personally I prefer to keep that at the command line, because I can trigger different sizes depending on the situation. In any case, it always feels good to remind Firefox that I’m the boss, no matter how popular and big-headed it has become.


9 thoughts on “The most annoying Firefox thing

  1. eksith

    Those are the correct, and presumably current, arguments according to the command line KB, but it doesn’t seem to work in Windows either.

    There is an extension available to set specific window sizes. I don’t know that might be worth it though, since it’s more bloat.

    You could write up a little script to copy a profile file from a different location, overwrite the existing one and command FF to use that using the -profile argument.

    1. K.Mandla Post author

      Yes, I spotted the extension before I found the javascript trick. But since I generally eschew extensions and because I usually open Firefox to a blank page and because I use a bash script to trigger the program anyway … this is convenient. To each his own, of course. Funny how something like that doesn’t work, and yet is listed as a command-line option. 🙂

    1. K.Mandla Post author

      I remember using that plugin a few years ago, when I did a little web page design work. You’re right, it is convenient. It’s useful for previewing pages and the effect a window size has on the design.

      It would be a little too much to install, for me that is, when all I want is the same size window each time.

  2. Ted

    Thanks for the tip. This used to really annoy me.
    I also found this works even better. Type


    in the location box. These can be saved as bookmarks with different sizes & window positions to suit your needs/mood.

    This can also be embedded into a web page (like a browser start page) to automatically do this on Firefox startup.

    // Get the firefox window to behave nicely

  3. M Belsky

    I am trying to specify Firefox’s height and width for a batch file I’m making for myself to start a few apps at the same time.

    This is what I’ve gotten so far.

    @rem Open Some Firefox Windows With Settings & Sizes Remembered
    Start “” firefox.exe -no-remote -new-window -p “FirefoxProfileNameYouCreate1” -width 585 -height 520
    Start “” firefox.exe -no-remote -new-window -p “FirefoxProfileNameYouCreate2” -width 585 -height 520

    @rem Start 1st Program (Minimized option used. /min)
    cd “C:\Program Files\1st Program”
    Start /min “” 1stProgram.exe

    @rem Start Last Program
    cd “C:\Program Files\Last Program”
    Start “” LastProgram.exe

    Initially, I believe I was able to get the window sizes to stick using this command:
    Start “” firefox.exe -cache -p “FirefoxProfileNameYouCreate1” -width 585 -height 520

    the problem was that if i had a firefox window open before running the command, the profile (-p) would be ignored and firefox would use the current profiles settings. So I found the -no-remote switch to force firefox to use the specified profile but that caused the height and width to be ignored. For my uses this is okay because it is just for my convenience and each time I run my batch file, the windows open is the previous toolbar setup and window size and position.

    Basically, I was able to get multiple window sizes and positions remembered ance set up, but am still not able to specify that info in the command line format.

    If anyone who is better than me at batch files can play around with the switches ive mentioned in a way that will allow the windows sizes to be specified from the command line that works when an existing instance of firefox is already open, I would be very grateful.


    M Belsky

  4. Pingback: Cleaning up is hard to do « Motho ke motho ka botho

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s