Difference between revisions of "User:Hendy:Noscript"

From Camino Wiki
Jump to navigation Jump to search
Line 18: Line 18:
  
 
a reload is necessary after a setPref
 
a reload is necessary after a setPref
 +
 +
[http://www.mozilla.org/projects/security/components/ConfigPolicy.html CAPS reference]

Revision as of 19:24, 13 November 2008

Request for "No Script"-like Java Script whitelist in Camino.

To set up a system to block javascript by default, set javascript.enabled = true and have

user_pref("capability.policy.policynames", "jsok");

user_pref("capability.policy.default.javascript.enabled", "noAccess");

user_pref("capability.policy.jsok.javascript.enabled", "allAccess");

in user.js, or with PreferenceManager

to add sites to the whitelist:

[[PreferenceManager sharedInstance] setPref:"capability.policy.jsok.sites" toString:@"http://www.ballcocknuts.com"];

where the string is a space-delimited list of the sites to have in the whitelist

a reload is necessary after a setPref

CAPS reference