For example, the simple command "this.toggleCookieBehavior();" no longer works so I had to change it using prefBranch.getIntPref('network.cookie.cookieBehavior') instead. I also lost the ability for the button to change icons when cookies were toggled on or off.
This was the code that was used until today:
- Code: Select all
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var prefDomain = "network.cookie.cookieBehavior";
function pref() {
var p = prefService.getIntPref(prefDomain);
return p;
}
this.toggleCookieBehavior = function() {
if(pref() == 2) {
prefService.setIntPref(prefDomain, 1);
this.image = "icon code";
} else {
prefService.setIntPref(prefDomain, 2);
this.image = "icon code";
}
}
If someone could help me out and restore this ability I'd appreciate it. Believe it or not, it is almost impossible to find an addon that does this anymore in current versions.
Edit: this code is probably still good. With the latest FF update some buttons that use Initialization Code are broken. Hopefully the developer will give the addon a temporary reprieve before XUL is abandoned altogether.