michael@0: var offlineByDefault = { michael@0: defaultValue: false, michael@0: prefBranch: SpecialPowers.Cc["@mozilla.org/preferences-service;1"].getService(SpecialPowers.Ci.nsIPrefBranch), michael@0: set: function(allow) { michael@0: try { michael@0: this.defaultValue = this.prefBranch.getBoolPref("offline-apps.allow_by_default"); michael@0: } catch (e) { michael@0: this.defaultValue = false michael@0: } michael@0: this.prefBranch.setBoolPref("offline-apps.allow_by_default", allow); michael@0: }, michael@0: reset: function() { michael@0: this.prefBranch.setBoolPref("offline-apps.allow_by_default", this.defaultValue); michael@0: } michael@0: } michael@0: michael@0: offlineByDefault.set(false);