Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do browsers detect a JS script is not responding?

Sometimes in web development the browser warns that some js script is not responding. We generally call that a freeze effect. I generally work around it by being less aggressive in term of data size or client-side processing. But I don't really know how the most popular browsers detect this. Is it based on memory consumption or kind of timeout? Is there any tool to measure that?

like image 464
François Wauquier Avatar asked Nov 11 '22 11:11

François Wauquier


1 Answers

It's mainly timeouts-based detection. In Firefox timeouts are user-defined, http://kb.mozillazine.org/Unresponsive_Script_Warning

IE decides that script isn't responding after 5 billion executed JS statements.

For more information you could check out this article: http://www.nczonline.net/blog/2009/01/05/what-determines-that-a-script-is-long-running/

like image 137
Tim Marinin Avatar answered Nov 15 '22 10:11

Tim Marinin