Dom.max script run time: Difference between revisions
(→Possible values and their effects: add bug#) |
m (→Possible values and their effects: default value) |
||
Line 5: | Line 5: | ||
==Possible values and their effects== | ==Possible values and their effects== | ||
The value is a positive integer, determining the number of seconds of execution. 0 and negative values are considered "forever." (Default value is 5 | The value is a positive integer, determining the number of seconds of execution before warning. 0 and negative values are considered "forever." (Default value is 10; 5 in nightly builds prior to 2006-07-27) ({{bug|335058}}) | ||
==Previous effects== | ==Previous effects== |
Revision as of 18:24, 3 January 2011
Background
“[JavaScript] that executes for whole seconds is probably doing something wrong...” says Brendan Eich, creator of JavaScript. When a script is executing, Mozilla's UI will be unresponsive until the script’s thread ends. Correspondingly, Mozilla will alert you when a script is taking a long time to run and let you stop the script. This preference lets you define what “a long time” is.
Possible values and their effects
The value is a positive integer, determining the number of seconds of execution before warning. 0 and negative values are considered "forever." (Default value is 10; 5 in nightly builds prior to 2006-07-27) (bug 335058)
Previous effects
In builds prior to 2005-10-11, values less than 0 were assumed to be the default (then, 5). In builds prior to 2006-07-27 (e.g., Firefox 1.5), this preference affected scripts running in content and chrome; the limit on scripts running in chrome is now determined by dom.max_chrome_script_run_time.
Caveats
- This preference was not dynamic (i.e., only read at startup) until recently (2005-10-11). The new dynamic behavior is available in Mozilla Firefox 1.5 branch builds, Mozilla Thunderbird branch builds, and SeaMonkey.
- This preference was subject to some bugs (see below) that made the true time limit somewhat unpredictable for certain scripts.
Recommended settings
If you’re encountering the “A script on this page is causing Mozilla to run slowly” dialog often and you’d like to disable it, setting this preference to 0 will allow the script to run for as long as it needs. A large number may be more appropriate, though, to avoid locking the entire UI forever as the script executes.
First checked in
Has an effect in
- Mozilla Suite (all versions since 1.7a)
- Mozilla Thunderbird (all versions since 0.6)
- Camino (all versions since 0.8b)
- Mozilla Firefox (all versions since 0.9)
- SeaMonkey (all versions)
Related bugs
- Bug 13350 - DOM needs to police JS infinite loops, schedule garbage collection
- Bug 230909 - ability to disable "this script is running slowly" dialog
- Bug 247225 - dom.max_script_run_time parameter doesn't work as expected
- Bug 302333 - Inappropriate 'Unresponsive Script' warning
- Bug 335058 - script timeout too small in firefox