Merge pull request #214 from bakulf/openTab
Open tab should show the hidden tabs first
This commit is contained in:
commit
4600d50dc7
2 changed files with 17 additions and 13 deletions
19
index.js
19
index.js
|
@ -649,7 +649,7 @@ const ContainerService = {
|
|||
const source = ("source" in args) ? args.source : null;
|
||||
|
||||
// Only send telemetry for tabs opened by UI - i.e., not via showTabs
|
||||
if (source) {
|
||||
if (source && userContextId) {
|
||||
this.sendTelemetryPayload({
|
||||
"event": "open-tab",
|
||||
"eventSource": source,
|
||||
|
@ -658,10 +658,19 @@ const ContainerService = {
|
|||
});
|
||||
}
|
||||
|
||||
const tab = browserWin.gBrowser.addTab(args.url || DEFAULT_TAB, { userContextId });
|
||||
browserWin.gBrowser.selectedTab = tab;
|
||||
browserWin.focusAndSelectUrlBar();
|
||||
return true;
|
||||
let promise;
|
||||
if (userContextId) {
|
||||
promise = this.showTabs(args);
|
||||
} else {
|
||||
promise = Promise.resolve(null);
|
||||
}
|
||||
|
||||
return promise.then(() => {
|
||||
const tab = browserWin.gBrowser.addTab(args.url || DEFAULT_TAB, { userContextId });
|
||||
browserWin.gBrowser.selectedTab = tab;
|
||||
browserWin.focusAndSelectUrlBar();
|
||||
return true;
|
||||
});
|
||||
}).catch(() => false);
|
||||
},
|
||||
|
||||
|
|
|
@ -247,14 +247,9 @@ Logic.registerPanel(P_CONTAINERS_LIST, {
|
|||
tr.addEventListener("click", e => {
|
||||
if (e.target.matches(".open-newtab")) {
|
||||
browser.runtime.sendMessage({
|
||||
method: "showTabs",
|
||||
userContextId: identity.userContextId
|
||||
}).then(() => {
|
||||
return browser.runtime.sendMessage({
|
||||
method: "openTab",
|
||||
userContextId: identity.userContextId,
|
||||
source: "pop-up"
|
||||
});
|
||||
method: "openTab",
|
||||
userContextId: identity.userContextId,
|
||||
source: "pop-up"
|
||||
}).then(() => {
|
||||
window.close();
|
||||
}).catch(() => {
|
||||
|
|
Loading…
Add table
Reference in a new issue