Question: 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)

Answer: 
Only by breaking the long running script into pieces.

See my answer to [Show javascript execution progress](https://stackoverflow.com/questions/2995805/show-javascript-execution-progress/2995896#2995896) for a solution for this.
Since you mentioned Firefox and Safari, you may want to use [Web Workers](http://www.whatwg.org/specs/web-workers/current-work/) (Firefox 3.5 and Safari 4). Execution of Web Workers happens in a separate process, and does not block the UI thread:

* [Mozilla Dev Center: Using web workers](https://developer.mozilla.org/En/Using_web_workers)
* [John Resig: Computing with JavaScript Web Workers](http://ejohn.org/blog/web-workers/)