Client.webidl (1475B)
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/. 5 * 6 * The origin of this IDL file is 7 * https://w3c.github.io/ServiceWorker/#client-interface 8 * 9 */ 10 11 [Exposed=ServiceWorker] 12 interface Client { 13 readonly attribute USVString url; 14 15 // Remove frameType in bug 1290936 16 [BinaryName="GetFrameType"] 17 readonly attribute FrameType frameType; 18 19 readonly attribute ClientType type; 20 readonly attribute DOMString id; 21 22 // Implement reserved in bug 1264177 23 // readonly attribute boolean reserved; 24 25 [Throws] 26 undefined postMessage(any message, sequence<object> transfer); 27 [Throws] 28 undefined postMessage(any message, optional StructuredSerializeOptions aOptions = {}); 29 }; 30 31 [Exposed=ServiceWorker] 32 interface WindowClient : Client { 33 [BinaryName="GetVisibilityState"] 34 readonly attribute VisibilityState visibilityState; 35 readonly attribute boolean focused; 36 37 // Implement ancestorOrigins in bug 1264180 38 // [SameObject] readonly attribute FrozenArray<USVString> ancestorOrigins; 39 40 [Throws, NewObject, NeedsCallerType] 41 Promise<WindowClient> focus(); 42 43 [Throws, NewObject] 44 Promise<WindowClient> navigate(USVString url); 45 }; 46 47 // Remove FrameType in bug 1290936 48 enum FrameType { 49 "auxiliary", 50 "top-level", 51 "nested", 52 "none" 53 };