Issue #11 - Showing all the hidden tabs before opening a new one
This commit is contained in:
parent
4b92b775b4
commit
f87eece6cc
1 changed files with 22 additions and 18 deletions
|
@ -31,21 +31,23 @@ function hideContainerTabs(userContextId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showContainerTabs(userContextId) {
|
function showContainerTabs(userContextId) {
|
||||||
const hideorshowIcon = document.querySelector(`#uci-${userContextId}-hideorshow-icon`);
|
return new Promise((resolve, reject) => {
|
||||||
|
const hideorshowIcon = document.querySelector(`#uci-${userContextId}-hideorshow-icon`);
|
||||||
|
|
||||||
browser.runtime.sendMessage({
|
browser.runtime.sendMessage({
|
||||||
method: 'showTabs',
|
method: 'showTabs',
|
||||||
userContextId: userContextId
|
userContextId: userContextId
|
||||||
}).then(hiddenTabUrls=> {
|
}).then(hiddenTabUrls=> {
|
||||||
hiddenTabUrls.forEach(url=> {
|
hiddenTabUrls.forEach(url=> {
|
||||||
browser.runtime.sendMessage({
|
browser.runtime.sendMessage({
|
||||||
method: 'openTab',
|
method: 'openTab',
|
||||||
userContextId: userContextId,
|
userContextId: userContextId,
|
||||||
url: url
|
url: url
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}).then(() => {
|
||||||
}).then(() => {
|
hideorshowIcon.src = CONTAINER_HIDE_SRC;
|
||||||
hideorshowIcon.src = CONTAINER_HIDE_SRC;
|
}).then(resolve);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,11 +132,13 @@ browser.runtime.sendMessage({method: 'queryIdentities'}).then(identities=> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (e.target.matches('.newtab-icon')) {
|
} else if (e.target.matches('.newtab-icon')) {
|
||||||
browser.runtime.sendMessage({
|
showContainerTabs(userContextId).then(() => {
|
||||||
method: 'openTab',
|
browser.runtime.sendMessage({
|
||||||
userContextId: userContextId})
|
method: 'openTab',
|
||||||
.then(() => {
|
userContextId: userContextId})
|
||||||
window.close();
|
.then(() => {
|
||||||
|
window.close();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue