Only process navigation events for HTTP.

This commit is contained in:
Bauke 2022-10-22 17:42:35 +02:00
parent 3e59d0e13b
commit a93b5ed92d
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,10 @@ browser.runtime.onInstalled.addListener(async () => {
}); });
browser.webNavigation.onBeforeNavigate.addListener(async (details) => { browser.webNavigation.onBeforeNavigate.addListener(async (details) => {
if (!details.url.startsWith('http')) {
return;
}
const {latestTime} = await browser.storage.local.get('latestTime'); const {latestTime} = await browser.storage.local.get('latestTime');
const redirectDelta = Date.now() - (latestTime ?? 0); const redirectDelta = Date.now() - (latestTime ?? 0);
if (redirectDelta < 100) { if (redirectDelta < 100) {