-
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
Open
domenic
wants to merge
1
commit into
main
Choose a base branch
from
browser-ui-window
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1666,17 +1666,48 @@ of the <a for="environment">target browsing context</a>'s <a>active document</a> | |||||
<a>environment settings object</a>. | ||||||
|
||||||
<p>A <a for=/>request</a> has an associated | ||||||
<dfn export for=request id=concept-request-window>window</dfn> | ||||||
("<code>no-window</code>", "<code>client</code>", or an | ||||||
<a>environment settings object</a> whose | ||||||
<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>window</dfn>, that is "<code>no-window</code>", | ||||||
"<code>from-browser-ui</code>", "<code>client</code>", or an <a>environment settings object</a> | ||||||
whose <a for="environment settings object">global object</a> is a {{Window}} object. Unless stated | ||||||
otherwise it is "<code>client</code>". | ||||||
|
||||||
<div class=note> | ||||||
<p>This is used to determine whether and where to show necessary UI for the request, such as | ||||||
authentication prompts or client certificate dialogs. | ||||||
|
||||||
<dl> | ||||||
<dt>"<code>no-window</code>" | ||||||
<dd>No UI is shown; usually the request fails with a <a>network error</a>. | ||||||
|
||||||
<p class=note>The "<code>client</code>" value is changed to "<code>no-window</code>" or | ||||||
<a for=/>request</a>'s <a for=request>client</a> during <a lt=fetch for=/>fetching</a>. It provides | ||||||
a convenient way for standards to not have to explicitly set <a for=/>request</a>'s | ||||||
<a for=request>window</a>. | ||||||
<dt>"<code>from-browser-ui</code>" | ||||||
<dd>This request was initiated by browser UI, and so any UI shown will not be associated to a | ||||||
specific window. | ||||||
|
||||||
<dt>"<code>client</code>" | ||||||
<dd>This value will automatically be changed to either "<code>no-window</code>" or the request's | ||||||
<a for=request>client</a> during <a lt=fetch for=/>fetching</a>. This provides a convenient way | ||||||
for standards to not have to explicitly set a request's <a for=request>window</a>. | ||||||
|
||||||
<dt>an <a>environment settings object</a> | ||||||
<dd>The UI shown will be associated with the specified {{Window}} object. | ||||||
</dl> | ||||||
</div> | ||||||
|
||||||
<p>The <dfn for=request>appropriate user prompt context</dfn> for a <a for=/>request</a> | ||||||
<var>request</var> is determined as follows: | ||||||
|
||||||
<ol> | ||||||
<li><p><a>Assert</a>: <var>request</var>'s <a for=request>window</a> is not "<code>client</code>". | ||||||
|
||||||
<li><p>If the request's <a for=request>window</a> is an <a>environment settings object</a>, then | ||||||
the prompt should occur in a way attributable to <var>request</var>'s <a for=request>window</a>. | ||||||
|
||||||
<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. | ||||||
|
||||||
<li><p>Otherwise, there is no appropriate user prompt context. | ||||||
</ol> | ||||||
|
||||||
<p id=keep-alive-flag>A <a for=/>request</a> has an associated boolean | ||||||
<dfn for=request export id=request-keepalive-flag>keepalive</dfn>. Unless stated otherwise it is | ||||||
|
@@ -5919,8 +5950,8 @@ run these steps: | |||||
<li> | ||||||
<p>If <var>response</var>'s <a for=response>status</a> is 401, <var>httpRequest</var>'s | ||||||
<a for=request>response tainting</a> is not "<code>cors</code>", <var>includeCredentials</var> is | ||||||
true, and <var>request</var>'s <a for=request>window</a> is an <a>environment settings object</a>, | ||||||
then: | ||||||
true, and <var>request</var>'s <a for=request>window</a> is either an | ||||||
<a>environment settings object</a> or "<code>from-browser-ui</code>": | ||||||
|
||||||
<ol> | ||||||
<li class=XXX><p>Needs testing: multiple `<code>WWW-Authenticate</code>` headers, missing, | ||||||
|
@@ -5947,8 +5978,8 @@ run these steps: | |||||
<a for=/>appropriate network error</a> for <var>fetchParams</var>. | ||||||
|
||||||
<li><p>Let <var>username</var> and <var>password</var> be the result of prompting the end user | ||||||
for a username and password, respectively, in <var>request</var>'s | ||||||
<a for=request>window</a>. | ||||||
for a username and password, respectively, in the <a>appropriate user prompt context</a> for | ||||||
<var>request</var>. | ||||||
|
||||||
<li><p><a>Set the username</a> given <var>request</var>'s <a for=request>current URL</a> and | ||||||
<var>username</var>. | ||||||
|
@@ -5975,9 +6006,8 @@ run these steps: | |||||
<a for=/>appropriate network error</a> for <var>fetchParams</var>. | ||||||
|
||||||
<li> | ||||||
<p>Prompt the end user as appropriate in <var>request</var>'s | ||||||
<a for=request>window</a> and store the result as a | ||||||
<a>proxy-authentication entry</a>. [[!HTTP]] | ||||||
<p>Prompt the end user as appropriate, in the <a>appropriate user prompt context</a> for | ||||||
<var>request</var>, and store the result as a <a>proxy-authentication entry</a>. [[!HTTP]] | ||||||
|
||||||
<p class=note>Remaining details surrounding proxy authentication are defined by HTTP. | ||||||
|
||||||
|
@@ -6156,10 +6186,8 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps: | |||||
<p>If the HTTP request results in a TLS client certificate dialog, then: | ||||||
|
||||||
<ol> | ||||||
<li><p>If <var>request</var>'s <a for=request>window</a> | ||||||
is an <a>environment settings object</a>, make the dialog | ||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Might be a bit nicer. |
||||||
|
||||||
<li><p>Otherwise, return a <a>network error</a>. | ||||||
</ol> | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?