Skip to content

Replace request's "window" with "traversable for user prompts" #1823

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

Merged
merged 4 commits into from
May 15, 2025

Conversation

domenic
Copy link
Member

@domenic domenic commented May 9, 2025

After much discussion in #1820 and #1821, this seems to be more correct. User prompts are not tied to specific Windows, and certainly not to the client's Window. They are tied to a traversable navigable, i.e. "browser tab", and that browser tab should ideally be blanked out and updated to reflect that it's the destination that's causing the prompt, not the request client.

Closes #1820. Closes #1821. Helps whatwg/html#11250 specify browser-initiated navigations better.

  • At least two implementers are interested (and none opposed):
    • This seems to match all browser behavior.
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chromium: N/A
    • Gecko: N/A, although maybe a bug to encourage the blanking-out behavior would be appreciated?
    • WebKit: N/A, although maybe a bug to encourage the blanking-out behavior would be appreciated?
    • Deno (not for CORS changes): N/A
  • MDN issue is filed: N/A
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


Places to update, from https://dontcallmedom.github.io/webdex/w.html#window%40%40request%40dfn:


Preview | Diff

After much discussion in #1820 and #1821, this seems to be more correct. Closes #1820. Closes #1821. Helps whatwg/html#11250 specify browser-initiated navigations better.
@domenic domenic added the do not merge yet Pull request must not be merged per rationale in comment label May 9, 2025
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me modulo some comments. @ricea and @noamr are maybe willing to review this too.

<a for="environment settings object">global object</a> is a
{{Window}} object). Unless stated otherwise it is
"<code>client</code>".
<dfn export for=request id=concept-request-window>traversable for user prompts</dfn>, that is
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to write out "end user" where I can myself. I'm not actually sure where we are consistency-wise, but is that something we can strife for? I'm happy to document it as the term to use.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, why? It seems excessively verbose...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's only four additional characters. Still shorter than implementer. "Person who operates the computer" might qualify for excessively verbose. 😛

To me it sounds a bit nicer and feels more respectful.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dunno, it seems a lot of churn across the ecosystem, and causes me to wonder "what's the difference between an end user and a user"? (Or is it "end-user"?)

I don't really understand the more respectful bit either.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case it helps, after all the PRs linked in the OP land, only one spec (Permissions Policy) will actually use "traversable for user prompts", so it'd be pretty easy to change later if we do decide on a larger ecosystem movement from user -> end user.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think https://datatracker.ietf.org/doc/html/rfc8890 captures best why I'd like to make this change, though arguably you could try to define "user" in the same way.

Anyway, happy to drop this for now.

agent should avoid displaying content from the request's initiator in the
<a for=request>traversable for user prompts</a>, especially in the case of cross-origin requests.
Displaying a blank page behind such prompts is a good way to fulfill these requirements. Failing to
follow these guidelines can confuse users as to which origin is responsible for the prompt.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
follow these guidelines can confuse users as to which origin is responsible for the prompt.
follow these guidelines can confuse end users as to which origin is responsible for the prompt.

fetch.bs Outdated
<var>httpFetchParams</var> to <var>fetchParams</var> and <var>httpRequest</var> to
<var>request</var>.

<p class=note>If user prompts are possible, then we need to clone <var>request</var> because ???
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's one of the scenarios where we might have to repeat request.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added that, although I'm not 100% sure I understand when that would happen. Who gets the request the first time, and who gets it the second time? Does this occur for all 3 possible prompt causes (WWW-Authenticate, PACs, and TLS client certs) or just some of them?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It happens when you do a request and the server returns a challenge. Then you have to repeat the request addressing the challenge. This happens with HTTP authentication at least. I'm not sure about client certificates as they happen at the TLS level, so maybe not?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, OK, I think I forgot some details. But to recap:

  • Clients optimistically send the body to the server before getting the response headers back.
  • Certain response headers mean you need to restart the entire request, with a new set of request headers.

Let me see if I can tweak the wording here to make it a bit more obvious, without necessarily restating too much...

domenic added a commit to domenic/private-aggregation-api that referenced this pull request May 13, 2025
Per whatwg/fetch#1823, this concept is going away. After that change, null-client scenarios will automatically do the right thing, and create no user prompts, which aligns with this spec's desired outcome.
domenic added a commit to domenic/topics that referenced this pull request May 13, 2025
Per whatwg/fetch#1823, this concept is going away. Instead, use the request's client, which is equivalent for this spec's purposes.
domenic added a commit to domenic/attribution-reporting-api that referenced this pull request May 13, 2025
Per whatwg/fetch#1823, this concept is going away. After that change, null-client scenarios will automatically do the right thing, and create no user prompts, which aligns with this spec's desired outcome.
domenic added a commit to domenic/shared-storage that referenced this pull request May 13, 2025
Per whatwg/fetch#1823, this concept is going away. Instead, use the request's client, which is equivalent for this spec's purposes.
domenic added a commit to domenic/webappsec-csp that referenced this pull request May 13, 2025
domenic added a commit to domenic/FedCM that referenced this pull request May 13, 2025
Per whatwg/fetch#1823, this concept is going away. After that change, null-client scenarios will automatically do the right thing, and create no user prompts, which aligns with this spec's desired outcome.
domenic added a commit to domenic/webappsec-permissions-policy that referenced this pull request May 13, 2025
Per whatwg/fetch#1823, this concept is going away. Instead, use the request's client, which is equivalent for this spec's purposes.
domenic added a commit to domenic/webdriver-bidi that referenced this pull request May 13, 2025
Per whatwg/fetch#1823, this concept is going away. Instead, use the request's client, which is equivalent for this spec's purposes.
@domenic domenic removed the do not merge yet Pull request must not be merged per rationale in comment label May 13, 2025
Copy link
Contributor

@noamr noamr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in all the direction looks good, one comment so far.

apasel422 pushed a commit to WICG/attribution-reporting-api that referenced this pull request May 13, 2025
Per whatwg/fetch#1823, this concept is going away. After that change, null-client scenarios will automatically do the right thing, and create no user prompts, which aligns with this spec's desired outcome.
alexmturner pushed a commit to patcg-individual-drafts/private-aggregation-api that referenced this pull request May 13, 2025
Per whatwg/fetch#1823, this concept is going away. After that change, null-client scenarios will automatically do the right thing, and create no user prompts, which aligns with this spec's desired outcome.
mikewest pushed a commit to w3c/webappsec-csp that referenced this pull request May 13, 2025
npm1 pushed a commit to w3c-fedid/FedCM that referenced this pull request May 13, 2025
Per whatwg/fetch#1823, this concept is going away. After that change, null-client scenarios will automatically do the right thing, and create no user prompts, which aligns with this spec's desired outcome.
jgraham pushed a commit to w3c/webdriver-bidi that referenced this pull request May 14, 2025
Per whatwg/fetch#1823, this concept is going away. Instead, use the request's client, which is equivalent for this spec's purposes.
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ again for clarity. Feel free to land this as you see fit.

@domenic domenic merged commit 41185ac into main May 15, 2025
2 checks passed
@domenic domenic deleted the fix-window-concept branch May 15, 2025 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants