зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1245277 pocket addon needs to respect prior set default prefs, r=Gijs
This commit is contained in:
Родитель
16881de41a
Коммит
930333e06e
|
@ -41,6 +41,10 @@ const PREFS = {
|
|||
function setDefaultPrefs() {
|
||||
let branch = Services.prefs.getDefaultBranch(PREF_BRANCH);
|
||||
for (let [key, val] in Iterator(PREFS)) {
|
||||
// If someone beat us to setting a default, don't overwrite it. This can
|
||||
// happen if distribution.ini sets the default first.
|
||||
if (branch.getPrefType(key) != branch.PREF_INVALID)
|
||||
continue;
|
||||
switch (typeof val) {
|
||||
case "boolean":
|
||||
branch.setBoolPref(key, val);
|
||||
|
@ -519,8 +523,7 @@ function startup(data, reason) {
|
|||
}
|
||||
// watch pref change and enable/disable if necessary
|
||||
Services.prefs.addObserver("extensions.pocket.enabled", prefObserver, false);
|
||||
if (Services.prefs.prefHasUserValue("extensions.pocket.enabled") &&
|
||||
!Services.prefs.getBoolPref("extensions.pocket.enabled"))
|
||||
if (!Services.prefs.getBoolPref("extensions.pocket.enabled"))
|
||||
return;
|
||||
PocketOverlay.startup(reason);
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче