I am looking for a way to prevent JavaScript on a webpage from resizing and repositioning my Internet Explorer window.

This option is available in Firefox, but I can't find anything similar in Internet Explorer:

Firefox Javascript Options window

I am using Internet Explorer 7 in Windows XP SP3.

For what it's worth, the script doing the resizing is:

<script language="JavaScript">
    function getFocus(){
    window.onload = getFocus;

and this script seems to not resize the window with Internet Explorer 8, but upgrading is not currently an option (work computer).


I emailed the Internet Explorer team at the IEBlog and received the following response:

No, IE doesn't have options that are that fine-grained.


On a browser with such option (like Firefox or Opera), you can just disable that option at the preferences. It seems you can't do that in IE.

On a browser with support for User Javascript (like Opera, or Firefox with Greasemonkey extension), you can write a script to replace window.moveTo and window.resizeTo functions with dummy versions (or just disable them). Of course, IE does not support that.

Then, you can try to inject JavaScript code in HTML by using any content-filtering program (in other words, a personal web proxy), like Proxomitron (old, abandonware) or Privoxy (free software, GPL). A software like this will intercept HTTP requests and modify them (according to some rules) before delivering the content back to the browser. This means you can not only inject content, but also remove that offending script from the page.

  • If you know how to write such a script or can get someone to write it for you or find one already written... AND you're willing to use an alternate shell for IE, you might look into IE7Pro (ie7pro.com), because it supports userscripts. – Nathaniel Sep 14 '09 at 2:46

This might help you IE7 Window Resize


The only way to do this would be to dissable JavaScript.

Click Tools Menu > Internet Options > Security Tab > Custom Level > Scripting > Active Scripting

  • 8
    Cures the disease by killing the patient. – Kevin Panko Sep 11 '09 at 16:32
  • Any brighter ideas? As far as I know you dont have this level of control in IE. It's all or nothing... Say good bye to the patient. – Greg B Sep 14 '09 at 14:45

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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