How to programmatically change the value about: config dom.max_script_run_time in Firefox?

I'm just wondering if there is a way to programmatically change the value of dom.max_script_run_time in the Firefox about: config window.

When the default values ​​in my Firefox are 10, I think its too small to run the script for a longer time on my website. When the value is set to the default value (i.e. .10), my firefox goes Not responding , and I get a warning message, for example Warning: Do not respond Script I just need to set the value to 20 or 30 to avoid such warnings, and so that the script runs for a longer time.

So I just need to change dom.max_script_run_time every time the page loads.

I tested this in other browsers like Firefox, Chrome, Safari, Palemoon and Opera.

I have this problem only in Firefox

Or is there another way, not changing the settings and loading the page?

Any solution would be appreciated.

+4
source share
3 answers

In any case, I found another solution to solve this problem. And thats deferred loading of the JS concept for page speed reasons. Got help from here . I added the code below to load the javascript file asynchronously after the page loads. This stops the display of an unresponsive script warning in Firefox.

Now all my javascript functions stored in someScript.js are called immediately after the page has stopped loading and with a short period of time elapsed between them. But this is not a problem since I am not getting a debug script error.

Deferred JS Download:

<script type="text/javascript"> // Add a script element as a child of the body function downloadJSAtOnload() { var element = document.createElement("script"); element.src = "/js/someScript.js"; document.body.appendChild(element); } // Check for browser support of event handling capability if (window.addEventListener) window.addEventListener("load", downloadJSAtOnload, false); else if (window.attachEvent) window.attachEvent("onload", downloadJSAtOnload); else window.onload = downloadJSAtOnload; </script> 
+2
source

Certainly, you cannot change this value through the network. I am 100% sure.

you should try redesigning your scripts and making your pages brighter

for example, you should unfortunately avoid firefox as much as you can

  • radius border
  • box shadow
  • shadow text
  • dynamic gradients like -moz-linear-gradient -moz-radial-gradient etc.
  • transitions / animations and transformations
  • frequent rendering and re-rendering of text
  • huge backgrounds, especially with reference to the background: fixed
  • flash objects, canvas, svg
+2
source

Set the integer to 1000 or approximately 0: config dom.max.script_run_time .

I found this a reliable solution, and Firefox no longer has

Warning: Script error message is much faster and

immediate fix.

0
source

All Articles