Move to new window should show hidden tabs as well - issue #257

This commit is contained in:
baku 2017-02-24 08:29:34 +01:00
parent c81851e3bd
commit 4ec371df6c

View file

@ -684,6 +684,11 @@ const ContainerService = {
return;
}
this._remapTabsIfMissing(args.userContextId);
if (!this._isKnownContainer(args.userContextId)) {
return Promise.resolve(null);
}
this.sendTelemetryPayload({
"event": "move-tabs-to-window",
"userContextId": args.userContextId,
@ -697,7 +702,8 @@ const ContainerService = {
});
// Nothing to do
if (list.length === 0) {
if (list.length === 0 &&
this._identitiesState[args.userContextId].hiddenTabs.length === 0) {
resolve(null);
return;
}
@ -713,6 +719,13 @@ const ContainerService = {
newBrowserWindow.gBrowser.adoptTab(viewFor(tab), pos++, false);
}
// Let's show the hidden tabs.
for (let object of this._identitiesState[args.userContextId].hiddenTabs) { // eslint-disable-line prefer-const
newBrowserWindow.gBrowser.addTab(object.url || DEFAULT_TAB, { userContextId: args.userContextId });
}
this._identitiesState[args.userContextId].hiddenTabs = [];
// Let's close all the normal tab in the new window. In theory it
// should be only the first tab, but maybe there are addons doing
// crazy stuff.