fix: pass the test

This commit is contained in:
gholk 2025-04-20 17:28:16 +08:00
parent 238930dcb0
commit 89b96fa5ae
4 changed files with 7 additions and 5 deletions

View file

@ -1,4 +1,4 @@
#!/bin/env bash #!/usr/bin/env bash
# This Source Code Form is subject to the terms of the Mozilla Public # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this

@ -1 +1 @@
Subproject commit bdaa01291b7367a5e815470fd263ea36c862fe32 Subproject commit 7df9158b9dfddab256285d8fb7f342dc8a3a8c1d

View file

@ -225,14 +225,16 @@ window.assignManager = {
return {}; return {};
} }
this.removeContextMenu(); this.removeContextMenu();
let [tab, siteSettings] = await Promise.all([ const a = await Promise.all([
browser.tabs.get(options.tabId), browser.tabs.get(options.tabId),
this.storageArea.get(options.url) this.storageArea.get(options.url)
]); ]);
const tab = a[0];
let siteSettings = a[1];
let container = false; let container = false;
let cookieStoreId = false; let cookieStoreId = false;
if (siteSettings) { if (siteSettings) {
cookieStoreId = backgroundLogic.cookieStoreId(siteSettings.userContextId) cookieStoreId = backgroundLogic.cookieStoreId(siteSettings.userContextId);
} }
try { try {
container = cookieStoreId && await browser.contextualIdentities container = cookieStoreId && await browser.contextualIdentities

View file

@ -218,7 +218,7 @@ const backgroundLogic = {
async setRedirectState(cookieStoreId, enable) { async setRedirectState(cookieStoreId, enable) {
const containerState = await identityState.storageArea.get(cookieStoreId); const containerState = await identityState.storageArea.get(cookieStoreId);
try { try {
containerState.redirectDisable = !enable containerState.redirectDisable = !enable;
return await identityState.storageArea.set(cookieStoreId, containerState); return await identityState.storageArea.set(cookieStoreId, containerState);
} catch (error) { } catch (error) {
// console.error(`No container: ${cookieStoreId}`); // console.error(`No container: ${cookieStoreId}`);