JSDoc: Class: AsyncChromeSender

# Class: AsyncChromeSender

## AsyncChromeSender()

Sends asynchronous RPC messages to chrome space using a frame's sendAsyncMessage (nsIAsyncMessageSender) function.

Example on how to use from a frame content script:

    let sender = new AsyncChromeSender(messageManager);
    let promise = sender.send("runEmulatorCmd", "my command");
    let rv = await promise;

## Constructor

#### new AsyncChromeSender()

Source:
  - proxy.js, line 351

### Methods

#### send(name, args) → {Promise}

Call registered function in chrome context.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | Function to call in the chrome, e.g. for `Marionette:foo`, use `foo`.
`args` | * | Argument list to pass the function. Must be JSON serialisable.

Source:
  - proxy.js, line 368

##### Returns:

A promise that resolves to the value sent back.

Type
  Promise