Potentially use UrlFilters for matching #2

Closed
opened 2022-10-12 10:45:30 +00:00 by Bauke · 1 comment
Owner

If the current way of matching URLs on every onBeforeNavigate event proves to be too resource-intensive, one way of reducing it would be to add UrlFilters to the onBeforeNavigate.addListener call.

We'd have to restructure the background initialization script slightly since we'd have to also call removeListener whenever the user changes anything in local storage. This is easy enough with browser.storage.local.onChanged though.

But if the performance is fine this won't be necessary.

If the current way of matching URLs on every `onBeforeNavigate` event proves to be too resource-intensive, one way of reducing it would be to add [`UrlFilter`s](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/events/UrlFilter) to the `onBeforeNavigate.addListener` call. We'd have to restructure the background initialization script slightly since we'd have to also call `removeListener` whenever the user changes anything in local storage. This is easy enough with [`browser.storage.local.onChanged`](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/onChanged) though. But if the performance is fine this won't be necessary.
Bauke added the
Enhancement
label 2022-10-12 10:45:30 +00:00
Bauke self-assigned this 2022-10-12 10:45:30 +00:00
Bauke changed title from Possibly investigate using UrlFilters for matching to Potentially use UrlFilters for matching 2022-10-12 10:45:54 +00:00
Bauke added this to the Version 0.1.0 milestone 2022-11-02 11:21:14 +00:00
Author
Owner

After testing with several hundred redirects for a while, the performance looks to be completely fine. The highest time I found for checking was 150ms and most of the time it was between 20 to 60.

After testing with several hundred redirects for a while, the performance looks to be completely fine. The highest time I found for checking was 150ms and most of the time it was between 20 to 60.
Bauke closed this issue 2022-11-02 11:21:17 +00:00
Bauke added the
Not Implemented
label 2022-11-02 11:22:11 +00:00
Sign in to join this conversation.
No description provided.