How to make Firefox always stop a script when it's not responding
You have to adjust dom.max_script_run_time
in about:config
to higher value.
As noted previously, this timeout also applies to add-ons using Javascript, as such it will be reached easily on slow computers using AdBlock, or even AJAX-rich websites like Google Docs etc.
This sounds like a job for YesScript!
This add-on will let you to create a blacklist of sites that are not allowed to run java script. Let me know how it works out for you.
Resources (please refer to this link for more solutions): Warning: Unresponsive Script