[whatwg/fetch] Handle request's window when from browser UI (PR #1821)

In https://github.com/whatwg/html/pull/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.

<!--
Thank you for contributing to the Fetch Standard! Please describe the change you are making and complete the checklist below if your change is not editorial.

When you submit this PR, and each time you edit this comment (including checking a checkbox through the UI!), PR Preview will run and update it. As such make any edits in one go and only after PR Preview has run.

If you think your PR is ready to land, please double-check that the build is passing and the checklist is complete before pinging.
-->

- [x] At least two implementers are interested (and none opposed):
   * This matches Chrome's behavior
   * This mostly matches Firefox's behavior, although for Firefox, if you go to http://labs.w0s.jp/http/authorization/ and then enter http://labs.w0s.jp/http/authorization/basic/ in the address bar, it does not blank out the page. (Whereas if you go https://example.com/ and then enter http://labs.w0s.jp/http/authorization/basic/ in the address bar, it *does* blank out the page.) I think it's OK to say that Firefox is violating this minor part of a "should" requirement.
   * I haven't tested Safari yet.
- [ ] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * This seems basically impossible to test.
- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chromium: N/A
   * Gecko: Doesn't feel worth it for this minor divergence
   * WebKit: … TODO after testing, in the event they do something very strange
   * Deno (not for CORS changes): N/A
- [x] [MDN issue](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) is filed: N/A, too detailed
- [x] The top of this comment includes a [clear commit message](https://github.com/whatwg/meta/blob/main/COMMITTING.md) to use. <!-- If you created this PR from a single commit, Github copied its message. Otherwise, you need to add a commit message yourself. -->

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)


<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***
<a href="https://whatpr.org/fetch/1821.html" title="Last updated on Apr 30, 2025, 7:33 AM UTC (7070b90)">Preview</a> | <a href="https://whatpr.org/fetch/1821/5a96806...7070b90.html" title="Last updated on Apr 30, 2025, 7:33 AM UTC (7070b90)">Diff</a>
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/fetch/pull/1821

-- Commit Summary --

  * Handle request's window when from browser UI

-- File Changes --

    M fetch.bs (70)

-- Patch Links --

https://github.com/whatwg/fetch/pull/1821.patch
https://github.com/whatwg/fetch/pull/1821.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1821
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1821@github.com>

Received on Wednesday, 30 April 2025 07:33:57 UTC