From e75ec2c2897aadcd7b6c29ba3502e32c8227674a Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Tue, 7 May 2013 16:19:13 +0900 Subject: [PATCH] Update tabsDragUtils.js --- content/treestyletab/res/tabsDragUtils.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/content/treestyletab/res/tabsDragUtils.js b/content/treestyletab/res/tabsDragUtils.js index 6ce6b703..dca644ea 100644 --- a/content/treestyletab/res/tabsDragUtils.js +++ b/content/treestyletab/res/tabsDragUtils.js @@ -15,7 +15,7 @@ http://github.com/piroor/fxaddonlib-tabs-drag-utils */ (function() { - const currentRevision = 26; + const currentRevision = 27; if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {}; @@ -41,6 +41,18 @@ // https://developer.mozilla.org/en/Creating_Custom_Events_That_Can_Pass_Data EVENT_TYPE_TABS_DROP : 'nsDOMMultipleTabsDrop', + get SessionStoreNS() { + delete this.SessionStoreNS; + try { + // resource://app/modules/sessionstore/SessionStore.jsm ? + this.SessionStoreNS = Components.utils.import('resource:///modules/sessionstore/SessionStore.jsm', {}); + } + catch(e) { + this.SessionStoreNS = {}; + } + return this.SessionStoreNS; + }, + init : function TDU_init() { window.addEventListener('load', this, false); @@ -796,6 +808,8 @@ // Firefox 4.0- if (aTab.linkedBrowser.__SS_restoreState == 1) { let data = aTab.linkedBrowser.__SS_data; + if (!data && this.SessionStoreNS.RestoringTabsData) // Firefox 23- + data = this.SessionStoreNS.RestoringTabsData.get(aTab); let entry = data.entries[Math.min(data.index, data.entries.length-1)]; if (entry) return entry.url; }