Skip to content

Instantly share code, notes, and snippets.

@sshopov
Created September 3, 2014 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sshopov/fa39206d366915724ec6 to your computer and use it in GitHub Desktop.
Save sshopov/fa39206d366915724ec6 to your computer and use it in GitHub Desktop.
IE7 sometimes complains that a JavaScript script is running too slow and asks the user whether they want to terminate it or continue. To get rid of this annoying popup a few changes need to be made to the registry. ref: http://www.itwriting.com/blog/119-ie7-script-madness.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32;
namespace RegistryUpdateForIEScriptProblem
{
class Program
{
/// <summary>
/// IE7 sometimes complains that a JavaScript script is running too slow and asks the user whether they want to terminate it or continue.
/// To get rid of this annoying popup a few changes need to be made to the registry.
/// ref: http://www.itwriting.com/blog/119-ie7-script-madness.html
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
RegistryKey RegKeyWrite = Registry.CurrentUser;
RegKeyWrite = RegKeyWrite.CreateSubKey(@"Software\Microsoft\Internet Explorer\Styles");
RegKeyWrite.SetValue("MaxScriptStatements", 1000000000);
RegKeyWrite.Close();
RegistryKey RegKeyRead = Registry.CurrentUser;
RegKeyRead = RegKeyRead.OpenSubKey(@"Software\Microsoft\Internet Explorer\Styles");
Object regSuccessful = RegKeyRead.GetValue("MaxScriptStatements");
RegKeyRead.Close();
Console.WriteLine("IE7 will no longer complain about scripts running too slow");
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment