-
Notifications
You must be signed in to change notification settings - Fork 56
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
Proposal: Trigger navigation dependent APIs on JavaScript Navigation #446
Comments
webNavigation already has events that trigger on JS navigation: onHistoryStateUpdated and onReferenceFragmentUpdated. |
The request is mostly concerned with registered content such as scripting and content_scripts. |
Once a script is injected it can be surprising to have it injected again — likely breaking things in the process. In my opinion, the content scripts need to listen for in-page DOM events that are available to know when script-based navigation occurs and act accordingly. If it needs more things injected then, it can message the background for it to do an executeScript, etc in response. This does not seem like a problem the extension platform needs to solve. |
JavaScript navigation would mean a new page in the same tab, hidden from webNavigation by the page owner (for some purpose). Therefore, it is not injecting into the same page. The practice has become more popular each year and I suspect there might be a time that it might become quite widespread. |
Preamble
Many websites nowadays navigate with JavaScript (e.g. Github) which is basically changing content, URL & history; without triggering a navigation.
There are a number of WebExtension APIs that depend on the navigation to function and they won't be triggered with the JavaScript navigation. e.g.
There is Navigation: navigate event supported by Chrome, Edge, & Opera; but it is not suitable for this purpose.
Proposal
Implement a method (standard or subject to a flag) to trigger navigation dependent WebExtension APIs on JavaScript Navigation (i,e, URL change)
The text was updated successfully, but these errors were encountered: