Bug 1291049 - Workaround to avoid failure when loading preferences
MozReview-Commit-ID: 3EstdroCPEG
--- a/devtools/client/shared/shim/Services.js
+++ b/devtools/client/shared/shim/Services.js
@@ -241,17 +241,17 @@ PrefBranch.prototype = {
_saveAndNotify: function () {
let store = {
type: this._type,
defaultValue: this._defaultValue,
hasUserValue: this._hasUserValue,
userValue: this._userValue,
};
- localStorage.setItem(PREFIX + this.fullName, JSON.stringify(store));
+ localStorage.setItem(PREFIX + this._fullName, JSON.stringify(store));
this._parent._notify(this._name);
},
/**
* Change this preference's value without writing it back to local
* storage. This is used to handle changes to local storage that
* were made externally.
*
@@ -417,17 +417,19 @@ PrefBranch.prototype = {
thePref._storageUpdated(type, userValue, hasUserValue, defaultValue);
}
},
/**
* Helper function to initialize the root PrefBranch.
*/
_initializeRoot: function () {
- if (localStorage.length === 0 && Services._defaultPrefsEnabled) {
+ // Only use the default prefs for now.
+ // if (localStorage.length === 0 && Services._defaultPrefsEnabled) {
+ if (Services._defaultPrefsEnabled) {
/* eslint-disable no-eval */
let devtools = require("raw!prefs!devtools/client/preferences/devtools");
eval(devtools);
let all = require("raw!prefs!modules/libpref/init/all");
eval(all);
/* eslint-enable no-eval */
}