Don't redirect when disabled.

This commit is contained in:
Bauke 2022-11-15 12:56:27 +01:00
parent cd453b3e6f
commit a05f54306a
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 7 additions and 0 deletions

View File

@ -33,6 +33,13 @@ browser.runtime.onStartup.addListener(async () => {
}); });
browser.webNavigation.onBeforeNavigate.addListener(async (details) => { browser.webNavigation.onBeforeNavigate.addListener(async (details) => {
const {redirectsEnabled} = await browser.storage.local.get({
redirectsEnabled: true,
});
if (redirectsEnabled === false) {
return;
}
if (!details.url.startsWith('http') || details.frameId > 0) { if (!details.url.startsWith('http') || details.frameId > 0) {
return; return;
} }