Re: [ServiceWorker] Foreign fetch (#751)

> +        <li>Let <var>scopeString</var> be the <a href="https://html.spec.whatwg.org/multipage/webappapis.html#incumbent-settings-object">incumbent settings object</a>'s <a href="https://html.spec.whatwg.org/multipage/webappapis.html#global-object">global object</a>'s <a href="#dfn-service-worker-global-scope-service-worker">service worker</a>'s <a href="#dfn-containing-service-worker-registration">containing service worker registration</a>'s <a href="#dfn-scope-url">scope url</a>, <a href="https://url.spec.whatwg.org/#concept-url-serializer">serialized</a>.</li>
> +        <li>Let <var>subScopeURLs</var> be an empty list of <a href="https://url.spec.whatwg.org/#concept-url">URLs</a>.</li>
> +        <li>For each <var>subScope</var> in <var>subScopes</var>:
> +          <ol>
> +            <li>Let <var>subScopeURL</var> be the result of <a href="https://url.spec.whatwg.org/#concept-url-parser">parsing</a> <var>subScope</var> with <a href="https://html.spec.whatwg.org/multipage/webappapis.html#entry-settings-object">entry settings object</a>'s <a href="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url">API base URL</a>.</li>
> +            <li>If <var>subScopeURL</var> is failure, throw a <code>TypeError</code> and abort these steps.</li>
> +            <li>Let <var>subScopeString</var> be the <a href="https://url.spec.whatwg.org/#concept-url-serializer">serialized</a> <var>subScopeURL</var>.</li>
> +            <li>If <var>subScopeString</var> does not start with <var>scopeString</var>, throw a <code>TypeError</code> and abort these steps.</li>
> +            <li>Add <var>subScopeURL</var> to <var>subScopeURLs</var>.</li>
> +          </ol>
> +        </li>
> +        <li>Set this <a href="#dfn-service-worker">service worker</a>'s <a href="#dfn-foreign-fetch-scopes">list of foreign fetch scopes</a> to <var>subScopeURLs</var>.</li>
> +      </ol>
> +      </spec-algorithm>
> +
> +      <p class="fixme">Maybe subscopes should be parsed using the registrations scope URL instead of the workers API base url. Although that might actually be more surprising/confusing.</p>

+1 to using settings object's API base URL. Having a consistency with other APIs seems better for devs so they don't have to look up a document for this usage.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/pull/751/files#r40399366

Received on Friday, 25 September 2015 04:50:05 UTC