1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * https://w3c.github.io/ServiceWorker/#client-interface
11 [Exposed=ServiceWorker]
13 readonly attribute USVString url;
15 // Remove frameType in bug 1290936
16 [BinaryName="GetFrameType"]
17 readonly attribute FrameType frameType;
19 readonly attribute ClientType type;
20 readonly attribute DOMString id;
22 // Implement reserved in bug 1264177
23 // readonly attribute boolean reserved;
26 undefined postMessage(any message, sequence<object> transfer);
28 undefined postMessage(any message, optional StructuredSerializeOptions aOptions = {});
31 [Exposed=ServiceWorker]
32 interface WindowClient : Client {
33 [BinaryName="GetVisibilityState"]
34 readonly attribute VisibilityState visibilityState;
35 readonly attribute boolean focused;
37 // Implement ancestorOrigins in bug 1264180
38 // [SameObject] readonly attribute FrozenArray<USVString> ancestorOrigins;
40 [Throws, NewObject, NeedsCallerType]
41 Promise<WindowClient> focus();
44 Promise<WindowClient> navigate(USVString url);
47 // Remove FrameType in bug 1290936