Update tabsDragUtils.js

This commit is contained in:
YUKI Hiroshi 2013-05-07 16:19:13 +09:00
parent 43e1813650
commit e75ec2c289

View File

@ -15,7 +15,7 @@
http://github.com/piroor/fxaddonlib-tabs-drag-utils http://github.com/piroor/fxaddonlib-tabs-drag-utils
*/ */
(function() { (function() {
const currentRevision = 26; const currentRevision = 27;
if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {}; 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 // https://developer.mozilla.org/en/Creating_Custom_Events_That_Can_Pass_Data
EVENT_TYPE_TABS_DROP : 'nsDOMMultipleTabsDrop', 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() init : function TDU_init()
{ {
window.addEventListener('load', this, false); window.addEventListener('load', this, false);
@ -796,6 +808,8 @@
// Firefox 4.0- // Firefox 4.0-
if (aTab.linkedBrowser.__SS_restoreState == 1) { if (aTab.linkedBrowser.__SS_restoreState == 1) {
let data = aTab.linkedBrowser.__SS_data; 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)]; let entry = data.entries[Math.min(data.index, data.entries.length-1)];
if (entry) return entry.url; if (entry) return entry.url;
} }