A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on IRC (such as one of these permanent autoconfirmed members).

Difference between revisions of "Foreign Fetch"

From WHATWG Wiki
Jump to: navigation, search
(Created page with "This is a proposal for invoking service workers for requests that are same-origin with the service worker fetched from cross-origin clients. == Modifications to Fetch == ......")
(No difference)

Revision as of 10:09, 7 July 2015

This is a proposal for invoking service workers for requests that are same-origin with the service worker fetched from cross-origin clients.

Modifications to Fetch

...

On the face of it, it seems step 3, substep 5, of https://fetch.spec.whatwg.org/#http-fetch, needs modifications to check for a foreign fetch enabled service worker before going to the cache/network.

API

[Constructor (DOMString type, optional ForeignFetchEventInit eventInitDict),
 Exposed=ServiceWorker]
interface ForeignFetchEvent : ExtendableEvent {
  readonly attribute Request request;
};

dictionary ForeignFetchEventInit : ExtendableEventInit {
  required Request request;
};

partial interface ServiceWorkerRegistration {
  Promise<void> enableForeignFetch();
  Promise<void> disableForeignFetch();
);

Note: We cannot extend FetchEvent because that exposes client and messaging functionality which might lead to security issues since current practice is all same-origin messaging when it comes to service workers.

Link header

Link:</sw.js>;rel=serviceworker;scope=/;handles=fetch,foreignfetch,push