But how does a browser determine when a script has run for too long? As you’d expect, the top 5 vendors implement different techniques and limits…
Firefox uses a timed limit of 10 seconds.
Safari uses a timed limit of 5 seconds.
Chrome does not limit execution but detects when the browser crashes or becomes unresponsive.
Several of the browsers allow you to configure the execution limit parameters, but that’s not something I’d recommend. I won’t publish the details here because someone, somewhere will use it as a “fix” for their unresponsive page! Google it if you like, but tweaking browser settings for badly-behaved code does not address the root of the problem.
If you want to read more from Craig, subscribe to our weekly tech geek newsletter, Tech Times.