From 92d98ba51baf7febec1d50b8655697f7d57b6620 Mon Sep 17 00:00:00 2001 From: saneyuki_s Date: Wed, 2 Jan 2013 04:35:42 +0900 Subject: [PATCH 1/2] Fix typo. --- modules/window.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/window.js b/modules/window.js index 653489f6..c2c3c78e 100644 --- a/modules/window.js +++ b/modules/window.js @@ -405,7 +405,7 @@ TreeStyleTabWindow.prototype = { 'browser.tabs.insertRelatedAfterCurrent', 'extensions.stm.tabBarMultiRows' // Super Tab Mode ]; - for (let i = 0, maxi = pref.length; i < maxi; i++) + for (let i = 0, maxi = restorePrefs.length; i < maxi; i++) { let pref = restorePrefs[i]; let backup = prefs.getPref(pref+'.backup'); From 5042651b8187ac3456d190eedfef125d09686b1f Mon Sep 17 00:00:00 2001 From: saneyuki_s Date: Wed, 2 Jan 2013 04:45:01 +0900 Subject: [PATCH 2/2] Restore the backuped user pref when this addon is disabled or removed. --- modules/window.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/window.js b/modules/window.js index c2c3c78e..44aa96e7 100644 --- a/modules/window.js +++ b/modules/window.js @@ -410,7 +410,11 @@ TreeStyleTabWindow.prototype = { let pref = restorePrefs[i]; let backup = prefs.getPref(pref+'.backup'); if (backup === null) continue; - prefs.setPref(pref+'.override', backup); // we have to set to ".override" pref, to avoid unexpectedly reset by the preference listener. + // we have to set to ".override" pref, to avoid unexpectedly reset by the preference listener. + prefs.setPref(pref+'.override', backup); + // restore user preference. + prefs.setPref(pref, backup); + // clear backup pref. prefs.clearPref(pref+'.backup'); } };