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)

Daniel Vassallo
  • 326,724
  • 71
  • 495
  • 436
aneuryzm
  • 59,888
  • 97
  • 265
  • 479

2 Answers2

2

Only by breaking the long running script into pieces.

See my answer to Show javascript execution progress for a solution for this.

Community
  • 1
  • 1
Sean Kinsey
  • 36,831
  • 7
  • 50
  • 70
  • @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 Jun 08 '10 at 11:46
1

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
  • 326,724
  • 71
  • 495
  • 436
  • @Patrick: Just be aware that this is very new stuff and not supported in, you know, That Other Browser. :-) – T.J. Crowder Jun 08 '10 at 11:50
  • 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 Jun 08 '10 at 11:53