Add an enabled property to redirects.

This commit is contained in:
Bauke 2022-10-26 14:47:42 +02:00
parent a93b5ed92d
commit 055be574c5
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 2 additions and 1 deletions

View File

@ -39,7 +39,7 @@ browser.webNavigation.onBeforeNavigate.addListener(async (details) => {
await browser.storage.local.get(), await browser.storage.local.get(),
)) { )) {
const redirect = parseRedirect(parameters, id); const redirect = parseRedirect(parameters, id);
if (redirect === undefined) { if (redirect === undefined || !redirect.parameters.enabled) {
continue; continue;
} }

View File

@ -15,6 +15,7 @@ export function narrowRedirectType(value: string): value is RedirectType {
} }
export type RedirectParameters = { export type RedirectParameters = {
enabled: boolean;
matcherType: MatcherType; matcherType: MatcherType;
matcherValue: string; matcherValue: string;
redirectType: RedirectType; redirectType: RedirectType;