Skip to content

Commit bc23529

Browse files
committed
Remove "foreign" service-workers mode
Fixes part of w3c/ServiceWorker#1188.
1 parent 9fa071b commit bc23529

File tree

1 file changed

+10
-31
lines changed

1 file changed

+10
-31
lines changed

fetch.bs

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -745,26 +745,18 @@ explicitly set <a for=/>request</a>'s
745745
<code>navigator.sendBeacon</code> and the HTML <code>img</code> element set this flag. Requests with
746746
this flag set are subject to additional processing requirements.
747747

748-
<p>A <a for=/>request</a> has an associated
749-
<dfn for=request export>service-workers mode</dfn>, that is "<code>all</code>",
750-
"<code>foreign</code>", or "<code>none</code>". Unless stated otherwise it is
751-
"<code>all</code>".
748+
<p>A <a for=/>request</a> has an associated <dfn for=request export>service-workers mode</dfn>, that
749+
is "<code>all</code>" or "<code>none</code>". Unless stated otherwise it is "<code>all</code>".
752750

753751
<div class=note>
754752
<p>This determines which service workers will receive a {{fetch!!event}} event for this fetch.
755753

756754
<dl>
757755
<dt>"<code>all</code>"
758-
<dd>Relevant local and foreign service workers will get a {{fetch!!event}} or
759-
{{foreignfetch!!event}} event for this fetch.
760-
761-
<dt>"<code>foreign</code>"
762-
<dd>Only relevant foreign service workers will get a {{foreignfetch!!event}} event for this fetch.
763-
{{fetch(input)!!method}} uses this to bypass the current service worker if the global is a
764-
{{ServiceWorkerGlobalScope}}.
756+
<dd>Relevant service workers will get a {{fetch!!event}} event for this fetch.
765757

766758
<dt>"<code>none</code>"
767-
<dd>Neither local nor foreign service workers will get events for this fetch.
759+
<dd>No service workers will get events for this fetch.
768760
</dd>
769761
</div>
770762

@@ -2887,23 +2879,11 @@ optional <i>CORS flag</i> and <i>CORS-preflight flag</i>, run these steps:
28872879
<li><p>Let <var>actualResponse</var> be null.
28882880

28892881
<li>
2890-
<p>If <var>request</var>'s <a>service-workers mode</a> is not "<code>none</code>", then run these
2891-
substeps:
2882+
<p>If <var>request</var>'s <a>service-workers mode</a> is "<code>all</code>", then:
28922883

28932884
<ol>
2894-
<li>
2895-
<p>If <var>request</var>'s <a>service-workers mode</a> is "<code>all</code>", then set
2896-
<var>response</var> to the result of invoking <a for=/>handle fetch</a> for <var>request</var>.
2897-
[[!HTML]] [[!SW]]
2898-
2899-
<li>
2900-
<p>If <var>response</var> is null, <var>request</var> is a <a>subresource request</a>, and
2901-
<var>request</var>'s <a for=request>origin</a> is not
2902-
<a>same origin</a> with <var>request</var>'s
2903-
<a for=request>url</a>'s
2904-
<a for=url>origin</a>, then set <var>response</var>
2905-
to the result of invoking <a for=/>handle foreign fetch</a> for
2906-
<var>request</var>. [[!SW]]
2885+
<li><p>Set <var>response</var> to the result of invoking <a for=/>handle fetch</a> for
2886+
<var>request</var>. [[!HTML]] [[!SW]]
29072887

29082888
<li>
29092889
<p>If <var>response</var> is not null, then run these substeps:
@@ -2983,9 +2963,8 @@ optional <i>CORS flag</i> and <i>CORS-preflight flag</i>, run these steps:
29832963
<a lt="CORS-preflight fetch">CORS-preflight fetches</a>.
29842964

29852965
<li>
2986-
<p>If <var>request</var>'s <a for=request>redirect mode</a> is
2987-
"<code>follow</code>", then set <var>request</var>'s <a>service-workers mode</a> to
2988-
"<code>foreign</code>".
2966+
<p>If <var>request</var>'s <a for=request>redirect mode</a> is "<code>follow</code>", then set
2967+
<var>request</var>'s <a>service-workers mode</a> to "<code>none</code>".
29892968

29902969
<p class="note no-backref">Redirects coming from the network (as opposed to from a service
29912970
worker) are not to be exposed to a service worker.
@@ -5377,7 +5356,7 @@ method, must run these steps:
53775356

53785357
<li>If <var>request</var>'s <a for=request>client</a>'s
53795358
<a for="environment settings object">global object</a> is a {{ServiceWorkerGlobalScope}} object,
5380-
set <var>request</var>'s <a>service-workers mode</a> to "<code>foreign</code>".
5359+
then set <var>request</var>'s <a>service-workers mode</a> to "<code>none</code>".
53815360

53825361
<li><p>Let <var>responseObject</var> be a new {{Response}} object and a new associated
53835362
{{Headers}} object whose <a for=Headers>guard</a> is

0 commit comments

Comments
 (0)