fix #2603: remember choice when choosing 'previous' (deny) container option
This commit is contained in:
parent
cd343ab8c3
commit
6bde0a78d7
2 changed files with 9 additions and 3 deletions
|
@ -175,6 +175,7 @@ window.assignManager = {
|
||||||
this.storageArea.get(pageUrl).then((siteSettings) => {
|
this.storageArea.get(pageUrl).then((siteSettings) => {
|
||||||
if (siteSettings) {
|
if (siteSettings) {
|
||||||
siteSettings.neverAsk = true;
|
siteSettings.neverAsk = true;
|
||||||
|
siteSettings.userContextId = backgroundLogic.getUserContextIdFromCookieStoreId(m.cookieStoreId);
|
||||||
this.storageArea.set(pageUrl, siteSettings);
|
this.storageArea.set(pageUrl, siteSettings);
|
||||||
}
|
}
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
|
|
|
@ -7,11 +7,13 @@ async function load() {
|
||||||
redirectUrlElement.textContent = redirectUrl;
|
redirectUrlElement.textContent = redirectUrl;
|
||||||
appendFavicon(redirectUrl, redirectUrlElement);
|
appendFavicon(redirectUrl, redirectUrlElement);
|
||||||
|
|
||||||
|
// Option for staying on the previous container
|
||||||
document.getElementById("deny").addEventListener("click", (e) => {
|
document.getElementById("deny").addEventListener("click", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
denySubmit(redirectUrl, currentCookieStoreId);
|
denySubmit(redirectUrl, currentCookieStoreId);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Option for going to the default container (no container)
|
||||||
document.getElementById("deny-no-container").addEventListener("click", (e) => {
|
document.getElementById("deny-no-container").addEventListener("click", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
denySubmit(redirectUrl, currentCookieStoreId);
|
denySubmit(redirectUrl, currentCookieStoreId);
|
||||||
|
@ -27,6 +29,7 @@ async function load() {
|
||||||
el.textContent = browser.i18n.getMessage(elementData.messageId, containerName);
|
el.textContent = browser.i18n.getMessage(elementData.messageId, containerName);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Option for going to newly selected container
|
||||||
document.getElementById("confirm").addEventListener("click", (e) => {
|
document.getElementById("confirm").addEventListener("click", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
confirmSubmit(redirectUrl, cookieStoreId);
|
confirmSubmit(redirectUrl, cookieStoreId);
|
||||||
|
@ -59,6 +62,7 @@ function confirmSubmit(redirectUrl, cookieStoreId) {
|
||||||
browser.runtime.sendMessage({
|
browser.runtime.sendMessage({
|
||||||
method: "neverAsk",
|
method: "neverAsk",
|
||||||
neverAsk: true,
|
neverAsk: true,
|
||||||
|
cookieStoreId: cookieStoreId,
|
||||||
pageUrl: redirectUrl
|
pageUrl: redirectUrl
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -77,12 +81,13 @@ async function denySubmit(redirectUrl, currentCookieStoreId) {
|
||||||
const currentContainer = currentCookieStoreId ? await browser.contextualIdentities.get(currentCookieStoreId) : null;
|
const currentContainer = currentCookieStoreId ? await browser.contextualIdentities.get(currentCookieStoreId) : null;
|
||||||
const neverAsk = document.getElementById("never-ask").checked;
|
const neverAsk = document.getElementById("never-ask").checked;
|
||||||
|
|
||||||
if (neverAsk && !currentContainer) {
|
if (neverAsk) {
|
||||||
await browser.runtime.sendMessage({
|
await browser.runtime.sendMessage({
|
||||||
method: "neverAsk",
|
method: "neverAsk",
|
||||||
neverAsk: true,
|
neverAsk: true,
|
||||||
defaultContainer: true,
|
cookieStoreId: currentCookieStoreId,
|
||||||
pageUrl: redirectUrl
|
pageUrl: redirectUrl,
|
||||||
|
defaultContainer: !currentContainer
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue