Merge pull request #621 from jonathanKingston/close-correct-assignment
Close correct assignment window on confirmation page. Fixes #606
This commit is contained in:
commit
51b804f96d
1 changed files with 11 additions and 4 deletions
|
@ -56,8 +56,15 @@ function confirmSubmit(redirectUrl, cookieStoreId) {
|
||||||
openInContainer(redirectUrl, cookieStoreId);
|
openInContainer(redirectUrl, cookieStoreId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCurrentTab() {
|
||||||
|
return browser.tabs.query({
|
||||||
|
active: true,
|
||||||
|
windowId: browser.windows.WINDOW_ID_CURRENT
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function denySubmit(redirectUrl) {
|
async function denySubmit(redirectUrl) {
|
||||||
const tab = await browser.tabs.query({active: true});
|
const tab = await getCurrentTab();
|
||||||
await browser.runtime.sendMessage({
|
await browser.runtime.sendMessage({
|
||||||
method: "exemptContainerAssignment",
|
method: "exemptContainerAssignment",
|
||||||
tabId: tab[0].id,
|
tabId: tab[0].id,
|
||||||
|
@ -73,12 +80,12 @@ async function denySubmit(redirectUrl) {
|
||||||
load();
|
load();
|
||||||
|
|
||||||
async function openInContainer(redirectUrl, cookieStoreId) {
|
async function openInContainer(redirectUrl, cookieStoreId) {
|
||||||
const tabs = await browser.tabs.query({active: true});
|
const tab = await getCurrentTab();
|
||||||
await browser.tabs.create({
|
await browser.tabs.create({
|
||||||
cookieStoreId,
|
cookieStoreId,
|
||||||
url: redirectUrl
|
url: redirectUrl
|
||||||
});
|
});
|
||||||
if (tabs.length > 0) {
|
if (tab.length > 0) {
|
||||||
browser.tabs.remove(tabs[0].id);
|
browser.tabs.remove(tab[0].id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue