Update ServiceWorker webidl

This commit is contained in:
CYBAI 2018-12-23 15:02:50 +08:00
parent 47eb8fe3db
commit 370ee8984f

View file

@ -2,17 +2,18 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// http://w3c.github.io/ServiceWorker/#service-worker-obj // https://w3c.github.io/ServiceWorker/#serviceworker-interface
[Pref="dom.serviceworker.enabled", Exposed=(Window,Worker)] [Pref="dom.serviceworker.enabled", SecureContext, Exposed=(Window,Worker)]
interface ServiceWorker : EventTarget { interface ServiceWorker : EventTarget {
readonly attribute USVString scriptURL; readonly attribute USVString scriptURL;
readonly attribute ServiceWorkerState state; readonly attribute ServiceWorkerState state;
[Throws] void postMessage(any message/*, optional sequence<Transferable> transfer*/); [Throws] void postMessage(any message/*, optional sequence<object> transfer = []*/);
// event // event
attribute EventHandler onstatechange; attribute EventHandler onstatechange;
}; };
// FIXME: use `includes` instead of `implements` after #22539 is fixed.
ServiceWorker implements AbstractWorker; ServiceWorker implements AbstractWorker;
enum ServiceWorkerState { enum ServiceWorkerState {