Only process navigation events for HTTP.
This commit is contained in:
parent
3e59d0e13b
commit
a93b5ed92d
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue