From 93665ed5ed3cc60c726c2d61bf75fcffd37d081f Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Mon, 17 Feb 2014 14:06:07 -0800 Subject: [PATCH] Don't share specially parsed option values across windows. --- common/content/modes.js | 3 ++- common/modules/options.jsm | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/content/modes.js b/common/content/modes.js index 40246f42..6666dc46 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -628,7 +628,8 @@ var Modes = Module("modes", { validator: function validator(vals) vals.map(v => v.replace(/^!/, "")) .every(k => hasOwnProperty(this.values, k)), - get values() array.toObject([[m.name.toLowerCase(), m.description] for (m in values(modes._modes)) if (!m.hidden)]) + get values() array.toObject([[m.name.toLowerCase(), m.description] + for (m in values(modes._modes)) if (!m.hidden)]) }; options.add(["passunknown", "pu"], diff --git a/common/modules/options.jsm b/common/modules/options.jsm index af16f43f..f973a453 100644 --- a/common/modules/options.jsm +++ b/common/modules/options.jsm @@ -95,7 +95,9 @@ var Option = Class("Option", { return this.globalValue = this.defaultValue; }, set globalValue(val) { - options.store.set(this.name, { value: val, time: Date.now() }); + options.store.set(this.name, + { value: this.parse(this.stringify(val)), + time: Date.now() }); }, /** @@ -140,6 +142,9 @@ var Option = Class("Option", { if ((scope & Option.SCOPE_GLOBAL) && (values == undefined)) values = this.globalValue; + if (hasOwnProperty(this, "_value")) + values = this._value; + if (this.getter) return util.trapErrors(this.getter, this, values); @@ -169,6 +174,7 @@ var Option = Class("Option", { */ if ((scope & Option.SCOPE_GLOBAL) && !skipGlobal) this.globalValue = newValues; + this._value = newValues; this.hasChanged = true; this.setFrom = null;