Merge pull request #155 from bakulf/delete
Comment applied - issue #151
This commit is contained in:
commit
4b3892f38e
1 changed files with 16 additions and 17 deletions
33
index.js
33
index.js
|
@ -236,6 +236,18 @@ const ContainerService = {
|
||||||
return Promise.resolve(null);
|
return Promise.resolve(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return this._recentBrowserWindow().then(browserWin => {
|
||||||
|
browserWin.gBrowser.addTab();
|
||||||
|
|
||||||
|
for (let tab of tabsToClose) { // eslint-disable-line prefer-const
|
||||||
|
tab.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Promise.resolve(null);
|
||||||
|
}).catch(() => null);
|
||||||
|
},
|
||||||
|
|
||||||
|
_recentBrowserWindow() {
|
||||||
const browserWin = windowUtils.getMostRecentBrowserWindow();
|
const browserWin = windowUtils.getMostRecentBrowserWindow();
|
||||||
|
|
||||||
// This should not really happen.
|
// This should not really happen.
|
||||||
|
@ -243,13 +255,7 @@ const ContainerService = {
|
||||||
return Promise.resolve(null);
|
return Promise.resolve(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
browserWin.gBrowser.addTab();
|
return Promise.resolve(browserWin);
|
||||||
|
|
||||||
for (let tab of tabsToClose) { // eslint-disable-line prefer-const
|
|
||||||
tab.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
return Promise.resolve(null);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Tabs management
|
// Tabs management
|
||||||
|
@ -456,14 +462,7 @@ const ContainerService = {
|
||||||
},
|
},
|
||||||
|
|
||||||
openTab(args) {
|
openTab(args) {
|
||||||
return new Promise(resolve => {
|
return this._recentBrowserWindow().then(browserWin => {
|
||||||
const browserWin = windowUtils.getMostRecentBrowserWindow();
|
|
||||||
|
|
||||||
// This should not really happen.
|
|
||||||
if (!browserWin || !browserWin.gBrowser) {
|
|
||||||
return Promise.resolve(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
let userContextId = 0;
|
let userContextId = 0;
|
||||||
if ("userContextId" in args) {
|
if ("userContextId" in args) {
|
||||||
userContextId = args.userContextId;
|
userContextId = args.userContextId;
|
||||||
|
@ -471,8 +470,8 @@ const ContainerService = {
|
||||||
|
|
||||||
const tab = browserWin.gBrowser.addTab(args.url || null, { userContextId });
|
const tab = browserWin.gBrowser.addTab(args.url || null, { userContextId });
|
||||||
browserWin.gBrowser.selectedTab = tab;
|
browserWin.gBrowser.selectedTab = tab;
|
||||||
resolve(true);
|
return true;
|
||||||
});
|
}).catch(() => false);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Identities management
|
// Identities management
|
||||||
|
|
Loading…
Add table
Reference in a new issue