-
Notifications
You must be signed in to change notification settings - Fork 351
Handle request's window when from browser UI #1821
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
base: main
Are you sure you want to change the base?
Conversation
In whatwg/html#11250 we are working to specify browser UI-initiated navigations better. Without this change, it is unclear what to set their request's window to. They will have null clients, so "client" is not appropriate. They will show prompts, so "no-window" is not appropriate. And setting it to whatever's shown currently in the being-navigated window is not correct. This introduces a new value, "from-browser-ui", which indicates that browser UI is initiating the request, and so any prompts should still be shown, but on a neutral backdrop, not associated with a specific Window object.
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 was about to approve this, but now I'm doubting it again. Is "from-browser-ui" really correct here?
If I'm on a.com and click a link to b.com and b.com requires an end-user dialog, in that case we want the blank window as well, right? Perhaps the window cannot really be inferred from the client at all?
|
||
<li><p>Otherwise, if <var>request</var>'s <a for=request>window</a> is | ||
"<code>from-browser-ui</code>", then the prompt should occur in a neutral context, e.g., on top of | ||
a blank page. |
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.
Should we note here that the address bar should probably contain some variation on the request's current URL?
available in <var>request</var>'s | ||
<a for=request>window</a>. | ||
<li><p>If <var>request</var> has an <a>appropriate user prompt context</a>, then make the | ||
dialog available in <var>request</var>'s <a>appropriate user prompt context</a>. |
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.
dialog available in <var>request</var>'s <a>appropriate user prompt context</a>. | |
dialog available therein. |
Might be a bit nicer.
You're right. Let me document my findings:
Here:
and
Honestly, Chrome's approach seems best here. It's really the response URL that is prompting you; the referrer (i.e., the request's window) is not really the party we should be attributing the prompt to. We could still track the top-level traversable ("browser tab") if we thought that was useful, as a hint to implementations about where to display the prompt. That is, implementations should display the prompt in the place where the response is eventually going to show up, if the navigation succeeds. But I think tying it to the referrer
|
I guess part of the issue is that TLS client certs are caused by the request, but WWW-Authenticate or proxy-authentication entries are caused by the response. I'm only testing WWW-Authenticate above. |
Firefox's behaviour was changed in 791594 - 401 password prompt spoofing thing |
Based on https://jpassing.com/2021/09/27/do-browsers-use-client-certificates-to-authenticate-the-user-the-device-or-both/ and some other search results it seems that client certificate dialogs can also be driven by the response. I agree that would be a much better way forward here. We probably do want to track the navigable to make sure we know where to present the dialog. And that navigable then needs to figure out whether a blank interstitial is required. |
For Firefox we only changed the behavior (blank page, url bar updated) for cross origin sites to avoid spoofing. Demo: https://eviltrap.site/trap/http-auth-prompt-spoof/. For same-origin that's not really a concern. I'm in favor of aligning with Chrome and inserting a blank interstitial for both cross and same origin cases to make the behavior more consistent. |
In whatwg/html#11250 we are working to specify browser UI-initiated navigations better. Without this change, it is unclear what to set their request's window to. They will have null clients, so "client" is not appropriate. They will show prompts, so "no-window" is not appropriate. And setting it to whatever's shown currently in the being-navigated window is not correct.
This introduces a new value, "from-browser-ui", which indicates that browser UI is initiating the request, and so any prompts should still be shown, but on a neutral backdrop, not associated with a specific Window object.
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff