Hacker News new | ask | show | jobs
by sp332 4251 days ago
If a script hangs, Firefox has a little popup on that tab that asks if you want to kill it or let it keep running. So something in the browser knows which tabs are JS-intensive.
1 comments

Sure. That particular setup has pretty low overhead and hence also low granularity; it's not measuring intensive or not but just how long a script has been running when a timer on a background thread fires. So your script could be eating up all the CPU but just returning to the event loop every few seconds and the hung script dialog would never notice.