Comment 46 for bug 541951

Revision history for this message
In , Mozilla-kaply (mozilla-kaply) wrote :

To expound on what :glandium said:

Extensions can lock preferences with:

  Components.classes["@mozilla.org/preferences-service;1"]
            .getService(Components.interfaces.nsIPrefService)
            .getBranch(null)
            .lockPref("name_of_pref");

Locking a preference doesn't affect the value, it just locks the preference to the user. Obviously any extension could unlock a preference and do what they want with that value.

Locking preferences is not for the benefit of preventing other extensions from messing with things, it's to keep users from messing with things.

Oddly, this document:

https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/A_brief_guide_to_Mozilla_preferences

Says we already support lockPref in JS files?