If you are seeing the “Stop running this script?� error in Internet Explorer 11, it means a script on the page is taking too long to complete, and IE11 is asking if you want to keep waiting or stop it. The fix is usually to adjust the IE11 registry setting that controls the script timeout, or to update the page’s code if you are the developer. Below is a complete guide to understanding and fixing this issue.
Formula
The registry value that controls the script timeout in IE11 is called HangTimeout and it is measured in milliseconds. The default value is 10000 (10 seconds). To calculate the timeout in minutes, divide the milliseconds by 60,000. The formula is:
Timeout (minutes) = HangTimeout (ms) / 60000
Where HangTimeout is the DWORD value in the registry path HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Styles.
Worked Example
If you set HangTimeout to 1,000,000 milliseconds, the timeout becomes:
- 1,000,000 ms / 60,000 = 16.67 minutes
That means IE11 will wait about 16.7 minutes before showing the “Stop running this script?� prompt. The calculator above uses 1,000,000 ms as the default and returns 16.67 minutes.
Why Does IE11 Show “Long Running Script�?
IE11 has a built-in safeguard that detects when a JavaScript loop or a single function has been executing for longer than a set threshold (default 10 seconds). The browser assumes the script is stuck in an infinite loop or is otherwise unresponsive, and it gives the user the option to stop it. This is a feature, not a bug – it prevents a malicious or broken script from freezing the entire browser. However, legitimate scripts that perform heavy processing (e.g., data parsing, complex DOM manipulation, or large AJAX responses) can also trigger the warning.
How to Increase the Script Timeout in IE11
You can increase the timeout by editing the Windows registry. This is a permanent fix for your own browser. Follow these steps carefully:
- Close all Internet Explorer windows.
- Press Windows + R, type
regedit, and press Enter. - Navigate to
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Styles. - If the
Styleskey does not exist, right-click onInternet Explorer, select New → Key, and name itStyles. - In the right pane, right-click and select New → DWORD (32-bit) Value.
- Name it
HangTimeout. - Double-click
HangTimeout, select Decimal, and enter a value in milliseconds (e.g., 1000000 for about 16.7 minutes). - Click OK and close the Registry Editor.
- Restart IE11 for the change to take effect.
If you are in a corporate environment, you can deploy this registry change via Group Policy. The same path applies to both 32-bit and 64-bit Windows because IE11 is 32-bit by default.
What If You Cannot Edit the Registry?
If you do not have administrator rights, or if the registry edit does not help, there are a few alternatives:
- Use a different browser – Edge, Chrome, or Firefox do not have this specific timeout limit and handle long scripts better.
- Update the page code – If you are the developer, break the long script into smaller chunks using
setTimeout()orrequestAnimationFrame()to yield to the browser. - Disable script debugging – In IE11, go to Internet Options → Advanced and uncheck “Disable script debugging (Internet Explorer)� – this does not fix the timeout but can suppress some related prompts.
- Use a registry file – If you have a .reg file provided by IT, you can merge it without opening regedit.
Common Mistakes and Misconceptions
- Setting HangTimeout too high – If you set it to the maximum 2,147,483,647 ms (about 24 days), a truly stuck script will freeze the browser for a very long time. A value between 30,000 and 1,000,000 ms is usually safe.
- Editing the wrong registry key – Some guides mention
HKEY_LOCAL_MACHINE– that is for system-wide settings, but the per-user key is the one that works for most cases. - Thinking the error means a virus – While a malicious script can cause it, most occurrences are from heavy but legitimate web apps like old CRM systems or data dashboards.
- Using the calculator above for the registry value – The calculator converts milliseconds to minutes, but the registry value must be in milliseconds. Do not enter minutes directly.
How to Fix the Script on Your Own Website
If you are a web developer and your users are seeing this error on your site, the best fix is to optimize your JavaScript. Here are concrete approaches:
- Break up long loops – If you have a loop that processes thousands of items, process them in batches of 100 and use
setTimeout(fn, 0)between batches to let the browser breathe. - Use Web Workers – For heavy data processing, move the work to a background thread using
new Worker('script.js'). This does not block the UI and will not trigger the timeout. - Reduce DOM access – Accessing the DOM is slow. Cache elements in variables and use
document.createDocumentFragment()for bulk updates. - Optimize loops – Avoid
for...inon arrays; use standardforloops. Store array length in a variable. - Use async/defer – Load scripts with the
asyncordeferattribute so they do not block page rendering.
Frequently Asked Questions
What is the default script timeout in IE11?
The default is 10 seconds (10,000 ms). If a script runs longer than that, IE11 shows the “Stop running this script?� prompt.
Will increasing the timeout slow down my browser?
No, it only changes how long the browser waits before asking you. It does not affect normal browsing speed. However, if a script is truly stuck, you will have to wait longer before you can stop it.
Can I disable the script timeout completely?
Yes, you can set HangTimeout to a very high value like 2,147,483,647, but that is not recommended because you will lose the ability to stop a runaway script quickly.
Does this fix work for IE10 or older versions?
Yes, the same registry key works for IE10 and IE9. The path is the same, but older versions may also require a separate HangTimeout for VBScript (which is rarely used now).
Why does the error keep appearing even after I increased the timeout?
Make sure you restarted IE11 completely. Also check that you edited the correct registry key – the Styles key must be under HKEY_CURRENT_USER, not HKEY_LOCAL_MACHINE.
Is there a way to suppress the prompt without increasing the timeout?
You can use a group policy setting called “Turn off script errors� but that only affects error dialogs, not the long script prompt. The only reliable way is to increase HangTimeout.
Related
Formula used
in t | Timeout (seconds) | s | 1000000 | 1 | 2147483647 out minutes | Timeout in minutes | min | t / 60 | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Google Assistant IFTTT Recipes: 7 Useful Automations
- OLED TVs in Dark Rooms: Why They Look Better and When They Don’t
- Philips DST7060/20 7000 Series Iron: Specs & Fit
- Coal Fueled Jet Aircraft: Could It Work?675 L
- Remote Desktop on Raspberry Pi: How to Enable It
- Word Select Last Line in Paragraph?