fix: make "never-ask" checkbox change behavior of deny case

This commit is contained in:
danjovich 2024-02-13 17:33:42 -03:00
parent a5ec9e2028
commit 0f6acd1316

View file

@ -74,6 +74,23 @@ function getCurrentTab() {
async function denySubmit(redirectUrl) { async function denySubmit(redirectUrl) {
const tab = await getCurrentTab(); const tab = await getCurrentTab();
const neverAsk = document.getElementById("never-ask").checked;
if (neverAsk) {
const searchParams = new URL(window.location).searchParams;
const currentCookieStoreId = searchParams.get("currentCookieStoreId");
await browser.runtime.sendMessage({
method: "setOrRemoveAssignment",
tabId: tab[0].id,
url: redirectUrl,
userContextId: currentCookieStoreId ? Utils.userContextId(
currentCookieStoreId
) : false,
value: !currentCookieStoreId,
});
}
await browser.runtime.sendMessage({ await browser.runtime.sendMessage({
method: "exemptContainerAssignment", method: "exemptContainerAssignment",
tabId: tab[0].id, tabId: tab[0].id,