ExtensionRuntime.webidl (3277B)
1 /* 2 * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT 3 * 4 * The content of this file has been generated based on the WebExtensions API 5 * JSONSchema using the following command: 6 * 7 * export SCRIPT_DIR="toolkit/components/extensions/webidl-api" 8 * mach python $SCRIPT_DIR/GenerateWebIDLBindings.py -- runtime 9 * 10 * More info about generating webidl API bindings for WebExtensions API at: 11 * 12 * https://firefox-source-docs.mozilla.org/toolkit/components/extensions/webextensions/webidl_bindings.html 13 * 14 * A short summary of the special setup used by these WebIDL files (meant to aid 15 * webidl peers reviews and sign-offs) is available in the following section: 16 * 17 * https://firefox-source-docs.mozilla.org/toolkit/components/extensions/webextensions/webidl_bindings.html#review-process-on-changes-to-webidl-definitions 18 */ 19 20 /* This Source Code Form is subject to the terms of the Mozilla Public 21 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 22 * You can obtain one at http://mozilla.org/MPL/2.0/. 23 * 24 * You are granted a license to use, reproduce and create derivative works of 25 * this document. 26 */ 27 28 // WebIDL definition for the "runtime" WebExtensions API 29 [Exposed=(ServiceWorker), LegacyNoInterfaceObject] 30 interface ExtensionRuntime { 31 // API methods. 32 33 [Throws, WebExtensionStub="Async"] 34 any openOptionsPage(optional Function callback); 35 36 [Throws, WebExtensionStub] 37 any getManifest(); 38 39 [Throws, WebExtensionStub="ReturnsString"] 40 DOMString getURL(DOMString path); 41 42 [Throws, WebExtensionStub="Async"] 43 any setUninstallURL(DOMString url, optional Function callback); 44 [Throws, WebExtensionStub="Async"] 45 any setUninstallURL(optional Function callback); 46 47 [Throws, WebExtensionStub="NoReturn"] 48 undefined reload(); 49 50 [Throws, WebExtensionStub="ReturnsPort"] 51 ExtensionPort connect(DOMString extensionId, any connectInfo); 52 [Throws, WebExtensionStub="ReturnsPort"] 53 ExtensionPort connect(any connectInfo); 54 [Throws, WebExtensionStub="ReturnsPort"] 55 ExtensionPort connect(); 56 57 [Throws, WebExtensionStub="ReturnsPort"] 58 ExtensionPort connectNative(DOMString application); 59 60 [Throws, WebExtensionStub="AsyncAmbiguous"] 61 any sendMessage(any... args); 62 63 [Throws, WebExtensionStub="Async"] 64 any sendNativeMessage(DOMString application, any message, optional Function responseCallback); 65 66 [Throws, WebExtensionStub="Async"] 67 any getBrowserInfo(optional Function callback); 68 69 [Throws, WebExtensionStub="Async"] 70 any getPlatformInfo(optional Function callback); 71 72 // API events. 73 74 [Replaceable, SameObject] 75 readonly attribute ExtensionEventManager onStartup; 76 77 [Replaceable, SameObject] 78 readonly attribute ExtensionEventManager onInstalled; 79 80 [Replaceable, SameObject] 81 readonly attribute ExtensionEventManager onUpdateAvailable; 82 83 [Replaceable, SameObject] 84 readonly attribute ExtensionEventManager onConnect; 85 86 [Replaceable, SameObject] 87 readonly attribute ExtensionEventManager onConnectExternal; 88 89 [Replaceable, SameObject] 90 readonly attribute ExtensionEventManager onMessage; 91 92 [Replaceable, SameObject] 93 readonly attribute ExtensionEventManager onMessageExternal; 94 95 // API properties. 96 97 [Replaceable] 98 readonly attribute any lastError; 99 100 [Replaceable] 101 readonly attribute DOMString id; 102 };