From fc11842f5ded88b210905ee1eae3fad45ae5e6cc Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 26 Apr 2013 20:26:49 -0700 Subject: [PATCH] [PWPBM] DTRT WRT titlemodifiers. --- common/content/dactyl.js | 3 ++- common/modules/storage.jsm | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/common/content/dactyl.js b/common/content/dactyl.js index c0cce9af..a54b577b 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1432,8 +1432,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { win.setAttribute("titlemodifier_normal", value); win.setAttribute("titlemodifier_privatebrowsing", value + suffix); - if (services.privateBrowsing.privateBrowsingEnabled) { + if (storage.privateMode) { updateTitle(oldValue + suffix, value + suffix); + win.setAttribute("titlemodifier", value + suffix); return value; } } diff --git a/common/modules/storage.jsm b/common/modules/storage.jsm index 6e5ed1c5..be31428d 100644 --- a/common/modules/storage.jsm +++ b/common/modules/storage.jsm @@ -246,9 +246,14 @@ var Storage = Module("Storage", { if (params == null || !isObject(params)) throw Error("Invalid argument type"); + if (!(key in this.keys) && this.privateMode && key in this.globalInstance.keys) { + let obj = this.globalInstance.keys[key]; + this.keys[key] = obj.clone ? obj.clone(this) : obj; + } + if (!(key in this.keys) || params.reload || this.alwaysReload[key]) { if (key in this && !(params.reload || this.alwaysReload[key])) - throw Error(); + throw Error("WTF? Hm..."); let load = function () self._loadData(key, params.store, params.type || myObject); this.keys[key] = new constructor(key, params.store, load, params);