From 45ddbd291d1ccd6feab734f6bcd7e222dc7d770e Mon Sep 17 00:00:00 2001
From: Matt Falkenhagen
Let done be false and reservedEnvironment be null.
Create a new environment reservedEnvironment, and set its id to a new unique opaque string, its creation URL to request's - url, and its target - browsing context to browsingContext.
+While done is false:
-The created environment's active service worker is set in the - handle fetch algorithm during the fetch if its - creation URL matches a service worker - registration.
-Let currentURL be response's location URL, if response is not null, + and request's current URL + otherwise.
Set request's reserved - client to reservedEnvironment.
If reservedEnvironment is not null and currentURL's + origin is not the same as reservedEnvironment's creation URL's origin, then:
-If the Should navigation request of type from source in target be blocked by Content
- Security Policy? algorithm returns "Blocked
" when executed upon
- request, navigationType, sourceBrowsingContext, and
- browsingContext, then set response to a network error.
-
Run the environment discarding steps for + reservedEnvironment.
Otherwise:
+Set reservedEnvironment to null.
Fetch request.
If reservedEnvironment is null, then set reservedEnvironment to a + new environment whose id is a + unique opaque string and target browsing context is + browsingContext.
Wait for the task on the networking task - source to process response and set response to the - result.
Set reservedEnvironment's creation URL to currentURL.
+The created environment's active service worker is set in the + Handle Fetch algorithm during the fetch if + the request URL matches a service worker registration.
+Set request's reserved + client to reservedEnvironment.
Navigation handles redirects manually as navigation is the only place in the web
- platform that cares for redirects to mailto:
URLs and
- such.
If the Should navigation request of type from source in target be blocked by
+ Content Security Policy? algorithm returns "Blocked
" when
+ executed upon request, navigationType, sourceBrowsingContext,
+ and browsingContext, then set response to a network error
+ and set done to true.
Otherwise:
+ +If response is null, fetch request.
Otherwise, perform HTTP-redirect fetch using + request and response.
Wait for the task on the networking task + source to process response and set response to the + result.
If response does not have a location URL or the location URL is not a URL whose + scheme is an HTTP(S) scheme, + then set done to true.
+ +Navigation handles redirects manually as navigation is the only place in
+ the web platform that cares for redirects to mailto:
+ URLs and such.
If response's location URL + is failure, then set response to a network error.
Otherwise, if response has a location URL that is a URL whose scheme is "blob
", "