-
Notifications
You must be signed in to change notification settings - Fork 373
Changing skip-service-worker flag to use-service-workers enum #435
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
Changes from 5 commits
ccd19cb
cb60254
d4e5d83
584fb3d
835862f
73630b8
e36eae6
27ae1e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -705,8 +705,27 @@ explicitly set <a for=/>request</a>'s | |
| this flag set are subject to additional processing requirements. | ||
|
|
||
| <p>A <a for=/>request</a> has an associated | ||
| <dfn export>skip-service-worker flag</dfn>. Unless stated otherwise it is | ||
| unset. | ||
| <dfn for=request export>service-workers mode</dfn>, that is "<code>all</code>", | ||
| "<code>foreign</code>", or "<code>none</code>". Unless stated otherwise it is | ||
| "<code>all</code>". | ||
|
|
||
| <div class=note> | ||
| This determines which service workers will receive a {{fetch!!event}} event for this fetch. | ||
|
||
|
|
||
| <dl> | ||
| <dt>"<code>all</code>" | ||
| <dd>Relevant local and foreign service workers will get a {{fetch!!event}} or | ||
| {{foreignfetch!!event}} event for this fetch. | ||
|
|
||
| <dt>"<code>foreign</code>" | ||
| <dd>Only relevant foreign service workers will get a {{foreignfetch!!event}} event for this fetch. | ||
| {{fetch(input)!!method}} uses this to bypass the current service worker if the global is a | ||
| {{ServiceWorkerGlobalScope}}. | ||
|
|
||
| <dt>"<code>none</code>" | ||
| <dd>Neither local nor foreign service workers will get events for this fetch. | ||
| </dd> | ||
| </div> | ||
|
|
||
| <p>A <a for=/>request</a> has an associated | ||
| <dfn export for=request id=concept-request-initiator>initiator</dfn>, which is | ||
|
|
@@ -2800,16 +2819,14 @@ optional <i>CORS flag</i> and <i>CORS-preflight flag</i>, run these steps: | |
| <li><p>Let <var>actualResponse</var> be null. | ||
|
|
||
| <li> | ||
| <p>If <var>request</var>'s <a>skip-service-worker flag</a> is unset, then run these | ||
| <p>If <var>request</var>'s <a>service-workers mode</a> is not "<code>none</code>", then run these | ||
| substeps: | ||
|
|
||
| <ol> | ||
| <li> | ||
| <p>If <var>request</var>'s <a for=request>client</a> is null or | ||
|
||
| <var>request</var>'s <a for=request>client</a>'s | ||
| <a for="environment settings object">global object</a> is not a | ||
| {{ServiceWorkerGlobalScope}} object, then set <var>response</var> | ||
| to the result of invoking <a for=/>handle fetch</a> for <var>request</var>. | ||
| <var>request</var>'s <a>service-workers mode</a> is "<code>all</code>", then set | ||
| <var>response</var> to the result of invoking <a for=/>handle fetch</a> for <var>request</var>. | ||
| [[!HTML]] [[!SW]] | ||
|
|
||
| <li> | ||
|
|
@@ -2900,7 +2917,8 @@ optional <i>CORS flag</i> and <i>CORS-preflight flag</i>, run these steps: | |
|
|
||
| <li> | ||
| <p>If <var>request</var>'s <a for=request>redirect mode</a> is | ||
| "<code>follow</code>", then set <var>request</var>'s <a>skip-service-worker flag</a>. | ||
| "<code>follow</code>", then set <var>request</var>'s <a>service-workers mode</a> to | ||
| "<code>none</code>". | ||
|
|
||
| <p class="note no-backref">Redirects coming from the network (as opposed to from a service | ||
| worker) are not to be exposed to a service worker. | ||
|
|
@@ -5192,6 +5210,10 @@ method, must run these steps: | |
| <var>init</var> as arguments. If this throws an exception, reject | ||
| <var>p</var> with it and return <var>p</var>. | ||
|
|
||
| <li>If <var>request</var>'s <a for=request>client</a>'s | ||
| <a for="environment settings object">global object</a> is a {{ServiceWorkerGlobalScope}} object, | ||
| set <var>request</var>'s <a>service-workers mode</a> to "<code>foreign</code>". | ||
|
|
||
| <li><p>Let <var>responseObject</var> be a new {{Response}} object and a new associated | ||
| {{Headers}} object whose <a for=Headers>guard</a> is | ||
| "<code>immutable</code>". | ||
|
|
@@ -5343,7 +5365,7 @@ therefore not shareable, a WebSocket connection is very close to identical to an | |
| <li><p>Let <var>request</var> be a new <a for=/>request</a>, whose | ||
| <a for=request>url</a> is <var>requestURL</var>, | ||
| <a for=request>client</a> is <var>client</var>, | ||
| <a>skip-service-worker flag</a> is set, | ||
| <a>service-workers mode</a> is "<code>none</code>", | ||
| <a>synchronous flag</a> is set, | ||
| <a for=request>mode</a> is "<code>websocket</code>", | ||
| <a for=request>credentials mode</a> is | ||
|
|
||
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.
Would it make sense to add some non-normative text somewhere to explain what this mode actually means? Of course you can figure that out by reading the algorithms, but I find the non-normative notes that many of the requests attributes have to be quite helpful in quickly figuring out what a particular thing is for.
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.
Yeah, sounds good.
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.
Done