There is already a privacy.item.siteprefs preference (bug 274712) it looks as if an alternate way would be to add |siteprefs: {...}| to 'items' and add the preference to the 'Clear Private Data' Dialog and Options. This would allow removing to be optional.
+ try {
+ var cps = Components.classes["@mozilla.org/content-pref/service;1"].
+ getService(Components.interfaces.nsIContentPrefService);
+ var dbConnection = cps.DBConnection;
+
+ try {
+ dbConnection.beginTransaction();
+ // Group records are the ones that contain hostnames, but we must
+ // remove pref records as well, since they depend on group records.
+ dbConnection.executeSimpleSQL("DELETE FROM prefs");
+ dbConnection.executeSimpleSQL("DELETE FROM groups");
+ dbConnection.commitTransaction();
+ }
+ catch(e) {
+ dbConnection.rollbackTransaction();
+ throw e;
+ }
+ }
+ catch (e) { Components.utils.reportError(e); }
I am not sure that I like sanatize.js to have to know about the database; I think that I would prefer this to be in nsIContentPrefService.
Applying both would give something like:
siteprefs: {
clear: function ()
{
var cps = Components.classes["@mozilla.org/content-pref/service;1"]. getService(Components.interfaces.nsIContentPrefService); cps.clear();
},
get canClear()
{
return true;
}
},
[Presumably bug 380852 could then add more calls into the clear function.]
There is already a privacy. item.siteprefs preference (bug 274712) it looks as if an alternate way would be to add |siteprefs: {...}| to 'items' and add the preference to the 'Clear Private Data' Dialog and Options. This would allow removing to be optional.
+ try { classes[ "@mozilla. org/content- pref/service; 1"]. Components. interfaces. nsIContentPrefS ervice) ; beginTransactio n(); executeSimpleSQ L("DELETE FROM prefs"); executeSimpleSQ L("DELETE FROM groups"); commitTransacti on(); rollbackTransac tion(); utils.reportErr or(e); }
+ var cps = Components.
+ getService(
+ var dbConnection = cps.DBConnection;
+
+ try {
+ dbConnection.
+ // Group records are the ones that contain hostnames, but we must
+ // remove pref records as well, since they depend on group records.
+ dbConnection.
+ dbConnection.
+ dbConnection.
+ }
+ catch(e) {
+ dbConnection.
+ throw e;
+ }
+ }
+ catch (e) { Components.
I am not sure that I like sanatize.js to have to know about the database; I think that I would prefer this to be in nsIContentPrefS ervice.
Applying both would give something like:
siteprefs: { classes[ "@mozilla. org/content- pref/service; 1"].
getService (Components. interfaces. nsIContentPrefS ervice) ;
cps.clear( );
clear: function ()
{
var cps = Components.
},
get canClear()
{
return true;
}
},
[Presumably bug 380852 could then add more calls into the clear function.]