summaryrefslogtreecommitdiffstats
path: root/toolkit/components/webextensions/ext-c-runtime.js
diff options
context:
space:
mode:
authorNew Tobin Paradigm <email@mattatobin.com>2018-04-20 17:51:57 -0400
committerGitHub <noreply@github.com>2018-04-20 17:51:57 -0400
commit6896f6898546ce6bd9dd16901411cfb02528b699 (patch)
treeb0438c6a4b2571ea9570faf5109e4b30624c3111 /toolkit/components/webextensions/ext-c-runtime.js
parent68c11d035c78211def675d16ad07bede2732cc1d (diff)
parent0b2e4f1afad41e638bce2c631c7bc895ba6c0c69 (diff)
downloadUXP-6896f6898546ce6bd9dd16901411cfb02528b699.tar
UXP-6896f6898546ce6bd9dd16901411cfb02528b699.tar.gz
UXP-6896f6898546ce6bd9dd16901411cfb02528b699.tar.lz
UXP-6896f6898546ce6bd9dd16901411cfb02528b699.tar.xz
UXP-6896f6898546ce6bd9dd16901411cfb02528b699.zip
Merge pull request #217 from janekptacijarabaci/webextensions_runtime_onMessageExternal-onConnectExternal_1
moebius#217: WebExtensions - Implemented "runtime.onMessageExternal"/"onConnectExternal"
Diffstat (limited to 'toolkit/components/webextensions/ext-c-runtime.js')
-rw-r--r--toolkit/components/webextensions/ext-c-runtime.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/toolkit/components/webextensions/ext-c-runtime.js b/toolkit/components/webextensions/ext-c-runtime.js
index 8adca60ca..1dcac35da 100644
--- a/toolkit/components/webextensions/ext-c-runtime.js
+++ b/toolkit/components/webextensions/ext-c-runtime.js
@@ -9,6 +9,10 @@ function runtimeApiFactory(context) {
onMessage: context.messenger.onMessage("runtime.onMessage"),
+ onConnectExternal: context.messenger.onConnectExternal("runtime.onConnectExternal"),
+
+ onMessageExternal: context.messenger.onMessageExternal("runtime.onMessageExternal"),
+
connect: function(extensionId, connectInfo) {
let name = connectInfo !== null && connectInfo.name || "";
extensionId = extensionId || extension.id;
@@ -47,7 +51,6 @@ function runtimeApiFactory(context) {
if (options != null && typeof options != "object") {
return Promise.reject({message: "runtime.sendMessage's options argument is invalid"});
}
- // TODO(robwu): Validate option keys and values when we support it.
extensionId = extensionId || extension.id;
let recipient = {extensionId};