- From: Anne van Kesteren <notifications@github.com>
- Date: Wed, 03 Feb 2016 12:27:29 -0800
- To: slightlyoff/ServiceWorker <ServiceWorker@noreply.github.com>
- Message-ID: <slightlyoff/ServiceWorker/pull/751/r51781805@github.com>
> + <h1><code>event.registerForeignFetchScopes(<var>subScopes</var>, <var>origins</var>)</code></h1> > + > + <p><code><a href="#install-event-register-foreign-fetch-scopes-method">registerForeignFetchScopes(<var>subScopes</var>, <var>origins</var>)</a></code> registers this service worker to handle foreign fetches from certain origins for certain sub scopes.</p> > + > + <p><dfn id="install-event-register-foreign-fetch-scopes-method"><code>registerForeignFetchScopes(<var>subScopes</var>, <var>origins</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps or their <a href="#dfn-processing-equivalence">equivalent</a>:</p> > + <spec-algorithm> > + <ol> > + <li>If the <a href="https://dom.spec.whatwg.org/#dispatch-flag">dispatch flag</a> is unset, then: > + <ol> > + <li><a href="http://heycam.github.io/webidl/#dfn-throw">Throw</a> an "<code><a href="http://heycam.github.io/webidl/#invalidstateerror">InvalidStateError</a></code>" exception.</li> > + <li>Abort these steps.</li> > + </ol> > + </li> > + <li>If <var>origins</var> is empty <a href="http://heycam.github.io/webidl/#dfn-throw">throw</a> a <code>TypeError</code> and abort these steps.</li> > + <li>Let <var>originURLs</var> be an empty list of <a href="https://url.spec.whatwg.org/#concept-url">URLs</a>.</li> > + <li>If the value of <var>origins</var> is not a single string equal to a single U+002A ASTERISK character (*): 1. Make `registerForeignFetchScopes()` accept a dictionary. That'll be better going forward. 1. Both _subScopes_ and _origins_ should just take a sequence I think. No need to get fancy. Wrapping the string in [ and ] is not hard. --- Reply to this email directly or view it on GitHub: https://github.com/slightlyoff/ServiceWorker/pull/751/files#r51781805
Received on Wednesday, 3 February 2016 20:28:19 UTC