Fix false-positive error message

This commit is contained in:
2022-09-10 18:10:48 +02:00
parent 1a7c22ec0e
commit 6da0050df4
2 changed files with 18 additions and 6 deletions

View File

@ -1,5 +1,5 @@
import {getMatch} from "./match/match";
import {storageGet, storageSet} from "./store/store";
import {storageDelete, storageGet, storageSet} from "./store/store";
import {Match} from "./match/matches";
chrome.webRequest.onBeforeRedirect.addListener(async details => {
@ -9,6 +9,8 @@ chrome.webRequest.onBeforeRedirect.addListener(async details => {
if ((match = await getMatch(new URL(details.url).host)) !== undefined) {
await storageSet('redirect', match.id)
}
} else {
await storageDelete('redirect')
}
}, {
urls: ['<all_urls>'],