-
Notifications
You must be signed in to change notification settings - Fork 43
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
[Spec] Restrict based on new browsing context group #70
Conversation
@annevk - took a crack at this, would appreciate if you could take a look and let me know if this is on the right track. As you noted, I'll still need to change |
It's a little trickier as we don't have infrastructure for replacing the browsing context yet. https://gist.github.com/annevk/6f2dd8c79c77123f39797f6bdac43f3e will add that. |
<em>document</em> return true. | ||
4. If <em>document</em>'s <em>browsingContext</em> is a top level browsing context and its | ||
[[HTML#tlbc-group|group]]'s [[HTML#browsing-context-set|browsing context set]] | ||
has length 1 return true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it guaranteed that a 'noopener' navigation will result in a new browsing context set? Reading #tlbc-group it's not clear to me if e.g. two separate 'noopener' navigations are done to the same origin, could they be placed in the same browsing context set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if you specify a _blank
target and noopener
choosing a browsing context says you must create a new group. Without noopener
you create an auxiliary browsing context which will be in an existing group. (You do need to specify a _blank
target though.
That said, I'm not an expert here, is there something I'm missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the part I was unclear on was whether a new browsing context was necessarily in a new group (it is).
Thanks, btw you can preview the changes here: http://bokand.github.io/spec.html (not sure if there's a well-beaten path for spec reviews is but my experience is that reviewing the markup diffs is unpleasant) |
LGTM overall but would like review from @annevk as well :) |
e84b65f
to
2950614
Compare
@annevk: ping. Does the updated restriction satisfy your concerns around cross-origin activation? From the spec with changes here:
Also, w.r.t. e.g. pasted URLs in a doc/chat-app should work but the user doesn't have any control over how those get linkified. Any reason not to have the UA implicitly add |
That might be doable, yes, but it would require patching HTML. |
Actually, given that we're checking we're the only browsing context in the browsing context group, I think the mainstream case navigating a simple top-level browsing context ( Given that, I think an implicit behavior would be more magical and would silently break I think this case will be rare so making authors add It might also make sense to have a dev tools warning if scroll-to-text is blocked explaining why. |
The specification doesn't currently replace the browsing context group for such navigations, so if B opened a popup and then navigated back in history, that popup would have access to A, say. We should probably define things such that replacing actually happens. |
Sorry for the delay - picking this back up...
Right, but I don't see why that's an issue given our current restrictions - at this point the text fragment in B has already been invoked while A wasn't in the browsing context group and any new navigation in either the main window or popup will now block invoking the text fragment which is intended. Is your point that if we have |
@annevk Could you elaborate on your concern here? As it stands, if B's popup tries to navigate A, any text fragment invocation will be blocked. Simply stated, a text-fragment can be invoked from a cross-origin source only if the browsing context is alone in its group (this allows the A->B without replacing the group), meaning the source cannot both control the target's URL and observe the navigation. Replacing the browsing context group on on self navigations seems like it'd be useful more generally, but it doesn't seem specific to this (and the rule above would be compatible with replacing browsing context groups). |
Fixes #64