No resize for you!

By Filip Salomonsson; published on March 07, 2007.

I don't know what the deal is with graphic originally-not-web designers and window resizing, but until they shape up, here's how to prevent web pages from resizing and/or moving your window around in Firefox.

Use your favorite text editor to put this into a file called user.js inside your firefox profile folder (the file may or may not exist already):

// No resizing, please
user_pref("capability.policy.default.Window.innerWidth.set", "noAccess");
user_pref("capability.policy.default.Window.innerHeight.set", "noAccess");
user_pref("capability.policy.default.Window.outerWidth.set", "noAccess");
user_pref("capability.policy.default.Window.outerHeight.set", "noAccess");
user_pref("capability.policy.default.Window.sizeToContent", "noAccess");
user_pref("capability.policy.default.Window.resizeTo", "noAccess");
user_pref("capability.policy.default.Window.resizeBy", "noAccess");

// and no moving.
user_pref("capability.policy.default.Window.screenX.set", "noAccess");
user_pref("capability.policy.default.Window.screenY.set", "noAccess");
user_pref("capability.policy.default.Window.moveTo", "noAccess");
user_pref("capability.policy.default.Window.moveBy", "noAccess");

Restart the fox, and thank me later. Chocolate will be fine, thanks.

Update: Alright, hold the chocolate. Henrik pointed out that there's an actual checkbox for this. Preferences ? Content ? Advanced (next to the Enable Javascript option) ? Move or resize existing windows. Still, though. You get leet points for editing user.js.

Related