Skip to content
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

"obtain a browsing context to use for a navigation response" appears to have easy-to-hit assert #7380

Closed
annevk opened this issue Dec 1, 2021 · 3 comments
Labels
topic: cross-origin-opener-policy Issues and ideas around the new "inverse of rel=noopener" header

Comments

@annevk
Copy link
Member

annevk commented Dec 1, 2021

As far as I can tell this algorithm is unconditionally invoked by "create and initialize a Document object" which we use for most Document object creation. Which in turn means that

Assert: browsingContext is a top-level browsing context.

is easily hit. Am I missing something or should that be an early return (or a conditional in calling algorithms)?

cc @camillelamy @hemeryar

@annevk annevk added the topic: cross-origin-opener-policy Issues and ideas around the new "inverse of rel=noopener" header label Dec 1, 2021
@domenic
Copy link
Member

domenic commented Dec 1, 2021

Yeah, this seems pretty busted. Probably step 1 should instead be

  1. If browsingContext is not a top-level browsing context, return browsingContext.

I hope @camillelamy or @hemeryar can confirm.

@camillelamy
Copy link
Member

Ah yes indeed, this seems to be an error. We should do what @domenic suggests. I think there used to be a guard in "create and initialize a Document object" to only call it when COOP required it (which implies a top-level navigation). But since there isn't anymore, we should just return the current browsing context for child browsing contexts.

@hemeryar
Copy link
Member

hemeryar commented Dec 8, 2021

I'm not sure which protection existed in the first place, but I agree that we should simply return the current BrowsingContext for subframes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: cross-origin-opener-policy Issues and ideas around the new "inverse of rel=noopener" header
Development

No branches or pull requests

4 participants