Open new tabs from the about:sync-tabs page as children correctly on lately Firefox

This commit is contained in:
YUKI Hiroshi 2015-08-28 18:22:19 +09:00
parent bea74f32ba
commit 01dab35627

View File

@ -1461,6 +1461,25 @@ TreeStyleTabWindowHelper.overrideExtensionsDelayed = function TSTWH_overrideExte
let manager = service.engineManager || service.Engines /* old name */; let manager = service.engineManager || service.Engines /* old name */;
let engine = manager.get('tabs'); let engine = manager.get('tabs');
if ('getOpenURLs' in engine) {
let parent = b.selectedTab;
window.setTimeout(function() {
let uri = tab.linkedBrowser.userTypedValue || tab.linkedBrowser.currentURI.spec;
for (let [guid, client] in Iterator(engine.getAllClients()))
{
if (client.tabs.some(function({ urlHistory }) {
return urlHistory[0] == uri;
})) {
if (parent.parentNode &&
tab.parentNode &&
!b.treeStyleTab.getParentTab(tab))
b.treeStyleTab.attachTabTo(tab, parent);
return;
}
}
}, 0);
}
else if ('locallyOpenTabMatchesURL' in engine) {
let uri = tab.getAttribute('label'); let uri = tab.getAttribute('label');
if (engine.locallyOpenTabMatchesURL(uri)) if (engine.locallyOpenTabMatchesURL(uri))
return; return;
@ -1478,6 +1497,7 @@ TreeStyleTabWindowHelper.overrideExtensionsDelayed = function TSTWH_overrideExte
return; return;
} }
} }
}
return; return;
case 'unload': case 'unload':