Tuesday, February 18, 2014

"Unresponsive script" with Developer Console

The Developer Console for Salesforce.com is entirely Javascript based, so it's subject to all Javascript can offer in your browser, good and bad.  One annoying thing is that Javascript can be slow for certain things, for instance, enumerating a large list.  This is especially acute for me when listing the test classes available.  We probably have 250+ test classes in our main org (all namespaces included), and that always seems too much for the console's Javascript to handle no matter what computer I use (currently on an i7 with 8gb memory), which results in an "Unresponsive script" error in Firefox so I have to click "Continue" for it to finish loading.  So I deal with it this way:

  1. Type in about:config in the address bar and press Enter.  This gives you the master list of all settings you can manually adjust in Firefox. 
  2. After confirming that you'd be careful with the settings, search for this setting string: dom.max_script_run_time.  This controls when the browser will complain and give you a chance to terminate the script (in number of seconds). Change the value to a bigger number - default is 10 and I use 20.
I do this for all Firefox profiles I use often with the Developer Console.  Chrome seems to be more forgiving/patient with the script compared to Firefox, so there is no error message - you just have to wait until the screen is unfrozen.

UPDATE: I'm happy to report that this trick seems to be no longer necessary with Summer '14.  The test class list in the console seems to be much more speedy and non-blocking to start - kudos to the developers!

No comments:

Post a Comment