Turn OFF window.alert in Firefox

Tags: 

Here is an example of a Firefox security policy that turns OFF javaScript window.alerts for a specific domain:

user_pref("capability.policy.policynames", "strict");
user_pref("capability.policy.strict.sites", "yourdomain.com");
user_pref("capability.policy.strict.Window.alert", "noAccess");
user_pref("capability.policy.strict.Window.confirm", "noAccess");
user_pref("capability.policy.strict.Window.prompt", "noAccess");

I use this policy to get around javaScript alert messages fired during the pages onload event handler, which Selenium IDE and RC cannot handle (webdriver can).