2014-05-14 01:28:01 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
|
|
|
* http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
|
2017-01-25 00:11:30 +03:00
|
|
|
* http://w3c.github.io/push-api/
|
|
|
|
* https://notifications.spec.whatwg.org/
|
2014-05-14 01:28:01 +04:00
|
|
|
*
|
|
|
|
* You are granted a license to use, reproduce and create derivative works of
|
|
|
|
* this document.
|
|
|
|
*/
|
|
|
|
|
2014-08-05 06:20:33 +04:00
|
|
|
[Global=(Worker,ServiceWorker),
|
2014-08-05 06:20:34 +04:00
|
|
|
Exposed=ServiceWorker]
|
2014-05-14 01:28:01 +04:00
|
|
|
interface ServiceWorkerGlobalScope : WorkerGlobalScope {
|
2015-10-25 05:46:16 +03:00
|
|
|
[SameObject] readonly attribute Clients clients;
|
|
|
|
[SameObject] readonly attribute ServiceWorkerRegistration registration;
|
2014-05-14 01:28:01 +04:00
|
|
|
|
2015-10-25 05:46:16 +03:00
|
|
|
[Throws, NewObject]
|
2016-01-09 06:08:59 +03:00
|
|
|
Promise<void> skipWaiting();
|
2015-06-02 14:12:00 +03:00
|
|
|
|
2014-05-14 01:28:01 +04:00
|
|
|
attribute EventHandler oninstall;
|
|
|
|
attribute EventHandler onactivate;
|
2015-06-13 02:28:13 +03:00
|
|
|
|
2014-05-14 01:28:01 +04:00
|
|
|
attribute EventHandler onfetch;
|
|
|
|
|
|
|
|
// The event.source of these MessageEvents are instances of Client
|
|
|
|
attribute EventHandler onmessage;
|
|
|
|
};
|
|
|
|
|
2015-04-23 21:43:40 +03:00
|
|
|
// These are from w3c.github.io/push-api/
|
|
|
|
partial interface ServiceWorkerGlobalScope {
|
|
|
|
attribute EventHandler onpush;
|
|
|
|
attribute EventHandler onpushsubscriptionchange;
|
|
|
|
};
|
2014-05-14 01:28:01 +04:00
|
|
|
|
2017-01-25 00:11:30 +03:00
|
|
|
// https://notifications.spec.whatwg.org/
|
|
|
|
partial interface ServiceWorkerGlobalScope {
|
|
|
|
attribute EventHandler onnotificationclick;
|
|
|
|
attribute EventHandler onnotificationclose;
|
|
|
|
};
|