Last updated: November 4, 2025
The “Long Running Script” error occurs when a piece of JavaScript code on a webpage gets stuck in an infinite loop or takes an excessive amount of time to complete its execution. This often causes the browser tab to freeze, become unresponsive, and display a warning dialog.
While the fundamental cause is often poor website coding, the issue can also be caused by local browser settings, hardware limitations, or conflicting extensions.
Phase 1: General Troubleshooting Steps
These initial solutions apply to Google Chrome, Mozilla Firefox, and Microsoft Edge.
1. Clear Browser Cache and Data
Over time, accumulated cached files and cookies can interfere with how JavaScript executes on a website. Clearing this data often resolves conflicts.
- Press Ctrl + Shift + Delete (or Cmd + Shift + Delete on Mac) to open the clear browsing data menu.
- Set the Time Range to “All time.”
- Ensure that “Cookies and other site data” and “Cached images and files” are checked.
- Click the Clear data or Clear now button.
2. Isolate the Issue with Extensions
Browser extensions are a frequent cause of script slowdowns, as they inject their own code into every webpage.
- Open your browser’s Extensions or Add-ons page.
- Toggle off (disable) all third-party extensions.
- Restart the browser and attempt to load the problematic webpage.
- If the error is gone: Re-enable extensions one by one, testing the website after each one, until you identify the culprit.
- If the error persists: The problem is likely within the browser’s settings or the webpage itself.
3. Ensure Your Browser is Updated
Running an outdated browser can lead to incompatibility issues with modern website scripts.
- Go to your browser’s Settings menu.
- Navigate to About [Browser Name] (e.g., About Chrome or About Firefox).
- The browser will automatically check for and download any available updates. Restart when prompted.
Phase 2: Browser-Specific Solutions
Google Chrome & Microsoft Edge (Chromium-Based)
Since both Chrome and Edge are based on the Chromium engine, they share a similar advanced solution for handling slow scripts.
1. Disable JavaScript Debugging
Disabling script debugging can sometimes prevent the browser from pausing execution when it detects a long-running loop.
- Open Settings (or type
chrome://settingsoredge://settingsin the address bar). - Search for “debugger” or go to Privacy and security (or Privacy, search, and services in Edge).
- Ensure the setting related to debugging/developer tools is not preventing normal operation.
2. Reset Settings
If the issue is persistent, resetting the browser’s configuration can clear any corrupted settings without deleting history or passwords.
- Go to Settings.
- Search for “Reset” or navigate to Reset and clean up (Chrome) or Reset settings (Edge).
- Click Restore settings to their original defaults.
Mozilla Firefox
Firefox provides a specific configuration setting to increase the amount of time a script is allowed to run before the error dialog appears.
1. Modify the Script Execution Timeout
This solution allows the script more time to finish before Firefox concludes it’s “stuck.”
- Type
about:configinto the Firefox address bar and press Enter. - Click “Accept the Risk and Continue.”
- In the search bar, type:
dom.max_script_run_time - This value is typically set to 10 (seconds). Double-click the preference name or click the Edit pencil icon.
- Change the value to a higher number, such as 20 or 30.
- Note: Setting this too high may cause your browser to completely freeze on a genuinely stuck script.
- Click the Save checkmark icon and restart Firefox.
2. Disable Hardware Acceleration
In rare cases, a conflict between the graphics driver and the browser’s rendering engine can cause scripts to execute slowly.
- Go to Settings.
- Scroll down to the Performance section.
- Uncheck the box next to “Use recommended performance settings.”
- Uncheck the box next to “Use hardware acceleration when available.”
- Restart Firefox.
💡 Summary of Fixes
| Problem | Fixes |
| Interference | 1. Disable all browser Extensions. |
| Old Data | 2. Clear Cache and Cookies for all time. |
| Timing/Loops | 3. Increase script run time in Firefox (about:config). |
| System Conflict | 4. Disable Hardware Acceleration (especially in Firefox). |
| Configuration | 5. Reset the browser’s settings to default. |
See also: [Solved] Fix ‘4504 Message Not Found’ Error on Android (Latest Methods)




