-
Notifications
You must be signed in to change notification settings - Fork 62
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
Should background pages be allowed to navigate? #191
Comments
I'm wondering what use case you need to navigate the background page 👀 |
I don't see a purpose in navigation from extension pages to destinations from a different origin, and I recommend blocking it. One may also consider navigation destinations that are same-origin. There may not be that much point in blocking that, since an extension could also load a same-origin iframe that has the same scripting capabilities. There is a tracking bug for Firefox about removing the ability to navigate the background to a remote URL at https://bugzilla.mozilla.org/show_bug.cgi?id=1286083 (which I have filed 6 years ago). For completeness, could the following questions be answered?
Currently, Firefox accepts the navigation request in all of the above cases. Same-origin extension documents do appear in What is the actual behavior in Safari and Chrome? |
As mentioned in the meeting notes (#202), the resolution is that remote navigations should be disallowed, and same-origin navigations (including reloads) be allowed. To minimize backwards-compatibility issues, it's worth trying this in MV3 instead of immediately in MV2 too. |
As a quick point of clarity, we are not planning to change how we handle background page navigation in Chrome. As I recall the resolution to limit background page navigation to same-origin was limited to Firefox and Safari. Of course, please correct me if I'm wrong. |
I said that only Firefox and Safari had to be changed, because Chrome already has the strict behavior, and that in MV3 Chrome is currently not supporting event pages/background pages, which implies that there is not much to change. I just checked again in Chrome 100: Chrome does not allow navigation of the background page at all, only @xeenon What do you think? Would you be in favor of blocking navigations altogether? |
Based on testing, it seems Chrome 90+ blocks navigations in the background page, while Firefox 88+ allows it. Safari 14+ also allows navigation.
The text was updated successfully, but these errors were encountered: