tags:

views:

38

answers:

2

Is there any way to disable browsers popups about long running scripts (i.e. in Firefox and Safari) directly from the website?

(And not from the browser settings)

+2  A: 

Only by breaking the long running script into pieces.

See my answer to http://stackoverflow.com/questions/2995805/show-javascript-execution-progress/2995896#2995896 for a solution for this.

Sean Kinsey
@Patrick: And if the code is triggering those pop-ups, it almost wants to be refactored in this way (broken into discrete chunks and chained) *anyway*.
T.J. Crowder
+1  A: 

Since you mentioned Firefox and Safari, you may want to use Web Workers (Firefox 3.5 and Safari 4). Execution of Web Workers happens in a separate process, and does not block the UI thread:

Daniel Vassallo
@Patrick: Just be aware that this is very new stuff and not supported in, you know, That Other Browser. :-)
T.J. Crowder
Yes, definitely. However it's probably the future of complex JavaScript processing. And not only in the browser - even [Node.js](http://nodejs.org/) (on the server-side) is planning to use the Web Workers API to fork new processes.
Daniel Vassallo