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
  • 337,827
  • 72
  • 505
  • 443
aneuryzm
  • 63,052
  • 100
  • 273
  • 488

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
  • 37,689
  • 7
  • 52
  • 71
  • @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
  • 337,827
  • 72
  • 505
  • 443
  • @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