diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-20 17:39:09 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-20 17:39:09 +0200 |
commit | 0b2e4f1afad41e638bce2c631c7bc895ba6c0c69 (patch) | |
tree | 0fdada34ddfa883d7e36142d0aa2084d1f343b35 /toolkit/components/webextensions/ext-c-runtime.js | |
parent | 20a3f8c006445b176fa8559f6529c2cf3cb75b0d (diff) | |
download | UXP-0b2e4f1afad41e638bce2c631c7bc895ba6c0c69.tar UXP-0b2e4f1afad41e638bce2c631c7bc895ba6c0c69.tar.gz UXP-0b2e4f1afad41e638bce2c631c7bc895ba6c0c69.tar.lz UXP-0b2e4f1afad41e638bce2c631c7bc895ba6c0c69.tar.xz UXP-0b2e4f1afad41e638bce2c631c7bc895ba6c0c69.zip |
moebius#217: WebExtensions - Implemented "runtime.onMessageExternal"/"onConnectExternal"
https://github.com/MoonchildProductions/moebius/pull/217
Diffstat (limited to 'toolkit/components/webextensions/ext-c-runtime.js')
-rw-r--r-- | toolkit/components/webextensions/ext-c-runtime.js | 5 |
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}; |