mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
moebius#217: WebExtensions - Implemented "runtime.onMessageExternal"/"onConnectExternal"
https://github.com/MoonchildProductions/moebius/pull/217
This commit is contained in:
parent
f1308a5501
commit
7cc4a8fa98
11 changed files with 262 additions and 42 deletions
|
|
@ -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};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue