-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watch for navigation via the new Navigation API #6649
Comments
This would reduce the reliance on the background page and the amount of messaging required during navigation. I'll mark this as |
NOTE: Chromium-only (not Firefox/Safari) is OK. Related discussion about SPA event detection: w3c/webextensions#446
Although, listening for navigation could be a good way to avoid the background worker being recycled |
If that actually helps we can keep the listeners enabled without having to also using the messaging channel. This has the added benefit that when the worker is eventually and necessarily restarted, the navigation doesn't have to wait for it to complete loading. |
Browsers now have access to all navigation events thanks to the navigation API.
https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API
We should drop the
browser.webNavigation
-based events from the background and just use the new API directly in the content scriptpixiebrix-extension/src/background/navigation.ts
Lines 72 to 75 in 4a103ed
pixiebrix-extension/src/contentScript/lifecycle.ts
Line 570 in 4a103ed
This does not affect the pageEditor’s listeners, because you can't listen to the navigation of other frames.
Related issue:
The text was updated successfully, but these errors were encountered: