JSDoc: Global

# Global

##

### Members

#### (constant) CHECKED_PROPERTY_SUPPORTED_XUL

XUL elements that support checked property.

Source:
  - interaction.js, line 62

#### (constant) COMMON_FORM_CONTROLS

Common form controls that user can change the value property interactively.

Source:
  - interaction.js, line 84

#### Cookie

Source:
  - cookie.js, line 26

#### (constant) DISABLED_ATTRIBUTE_SUPPORTED_XUL

XUL elements that support disabled attribute.

Source:
  - interaction.js, line 27

#### event

Provides functionality for creating and sending DOM events.

Source:
  - event.js, line 6

#### (constant) INPUT_TYPES_NO_EVENT

Input elements that do not fire `input` and `change` events when value property changes.

Source:
  - interaction.js, line 94

#### (constant) KEY_LOCATION_LOOKUP

Map from raw key (codepoint) to key location

Source:
  - action.js, line 137

#### (constant) loadListener

The load listener singleton helps to keep track of active page load activities, and can be used by any command which might cause a navigation to happen. In the specific case of a reload of the frame script it allows to continue observing the current page load.

Source:
  - listener.js, line 128

#### (constant) MessageOrigin

Messages may originate from either the server or the client. Because the remote protocol is full duplex, both endpoints may be the origin of both commands and responses.

##### Properties:

Name | Type | Description
--- | --- | ---
`Client` |  | Indicates that the message originates from the client.
`Server` |  | Indicates that the message originates from the server.

Source:
  - message.js, line 31
See:
  - `Message`

#### (constant) MODIFIER_NAME_LOOKUP

Map from normalized key value to UI Events modifier key name

Source:
  - action.js, line 55

#### (constant) NORMALIZED_KEY_LOOKUP

Map from raw key (codepoint) to normalized key value

Source:
  - action.js, line 63

#### (constant) SELECTED_PROPERTY_SUPPORTED_XUL

XUL elements that support selected property.

Source:
  - interaction.js, line 70

#### WindowState :string

Marionette representation of the `ChromeWindow` window state.

##### Type:

- string

##### Properties:

Name | Type | Description
--- | --- | ---
`Maximized` | string |
`Minimized` | string |
`Normal` | string |
`Fullscreen` | string |
`from` | string | Converts `nsIDOMChromeWindow.windowState` to WindowState.

Source:
  - browser.js, line 468

### Methods

#### actionChain()

Start action chain on one finger.

Source:
  - listener.js, line 966

#### addMessageListenerId()

Add a message listener that's tied to our listenerId.

Source:
  - listener.js, line 540

#### BulkPacket(transport)

With a bulk packet, data is transferred by temporarily handing over the transport's input or output stream to the application layer for writing data directly. This can be much faster for large data sets, and avoids various stages of copies and data duplication inherent in the JSON packet type. The bulk packet looks like:

    bulk [actor] [type] [length]:[data]

The interpretation of the data portion depends on the kind of actor and the packet's type. See the Remote Debugging Protocol Stream Transport spec for more details.

##### Parameters:

Name | Type | Description
--- | --- | ---
`transport` | DebuggerTransport | Transport instance that will own the packet.

Source:
  - packets.js, line 233

#### cancelRequest()

Cancel the polling and remove the event listener associated with a current navigation request in case we're interupted by an onbeforeunload handler and navigation doesn't complete.

Source:
  - listener.js, line 1158

#### checkExpectedEvent_()

Check if the event was fired or not. The provided event handler will be removed.

Source:
  - event.js, line 897

#### ChildDebuggerTransport()

A transport for the debugging protocol that uses nsIMessageManagers to exchange packets with servers running in child processes.

In the parent process, mm should be the nsIMessageSender for the child process. In a child process, |mm| should be the child process message manager, which sends packets to the parent.

prefix is a string included in the message names, to distinguish multiple servers running in the same child process.

This transport exchanges messages named `debug:PREFIX:packet`, where `PREFIX` is prefix, whose data is the protocol packet.

Source:
  - transport.js, line 733

#### clearElement()

Clear the text of an element.

Source:
  - listener.js, line 1521

#### clickElement(commandID, id, pageTimeout)

Send click event to element.

##### Parameters:

Name | Type | Description
--- | --- | ---
`commandID` | number | ID of the currently handled message between the driver and listener.
`id` | WebElement | Reference to the web element to click.
`pageTimeout` | number | Timeout in milliseconds the method has to wait for the page being finished loading.

Source:
  - listener.js, line 1361

#### copyStream(input, output, length) → {Promise}

This helper function (and its companion object) are used by bulk senders and receivers to read and write data in and out of other streams. Functions that make use of this tool are passed to callers when it is time to read or write bulk data. It is highly recommended to use these copier functions instead of the stream directly because the copier enforces the agreed upon length. Since bulk mode reuses an existing stream, the sender and receiver must write and read exactly the agreed upon amount of data, or else the entire transport will be left in a invalid state. Additionally, other methods of stream copying (such as NetUtil.asyncCopy) close the streams involved, which would terminate the debugging transport, and so it is avoided here.

Overall, this works, but clearly the optimal solution would be able to just use the streams directly. If it were possible to fully implement nsIInputStream/nsIOutputStream in JS, wrapper streams could be created to enforce the length and avoid closing, and consumers could use familiar stream utilities like NetUtil.asyncCopy.

The function takes two async streams and copies a precise number of bytes from one to the other. Copying begins immediately, but may complete at some future time depending on data size. Use the returned promise to know when it's complete.

##### Parameters:

Name | Type | Description
--- | --- | ---
`input` | nsIAsyncInputStream | Stream to copy from.
`output` | nsIAsyncOutputStream | Stream to copy to.
`length` | number | Amount of data that needs to be copied.

Source:
  - stream-utils.js, line 61

##### Returns:

Promise is resolved when copying completes or rejected if any (unexpected) errors occur.

Type
  Promise

#### createATouch()

Function to create a touch based on the element corx and cory are relative to the viewport, id is the touchId

Source:
  - listener.js, line 920

#### deleteSession()

Removes all listeners

Source:
  - listener.js, line 655

#### delimitedRead(stream, delimiter, count) → {string}

Read from a stream, one byte at a time, up to the next delimiter character, but stopping if we've read |count| without finding it. Reading also terminates early if there are less than count bytes available on the stream. In that case, we only read as many bytes as the stream currently has to offer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`stream` | nsIInputStream | Input stream to read from.
`delimiter` | string | Character we're trying to find.
`count` | number | Max number of characters to read while searching.

Source:
  - stream-utils.js, line 223

##### Returns:

Collected data. If the delimiter was found, this string will end with it.

Type
  string

#### dispatchKeyDown(a, inputState, window) → {Promise}

Dispatch a keyDown action equivalent to pressing a key on a keyboard.

##### Parameters:

Name | Type | Description
--- | --- | ---
`a` | action.Action | Action to dispatch.
`inputState` | action.InputState | Input state for this action's input source.
`window` | WindowProxy | Current window global.

Source:
  - action.js, line 1140

##### Returns:

Promise to dispatch at least a keydown event, and keypress if appropriate.

Type
  Promise

#### dispatchKeyUp(a, inputState, window) → {Promise}

Dispatch a keyUp action equivalent to releasing a key on a keyboard.

##### Parameters:

Name | Type | Description
--- | --- | ---
`a` | action.Action | Action to dispatch.
`inputState` | action.InputState | Input state for this action's input source.
`window` | WindowProxy | Current window global.

Source:
  - action.js, line 1171

##### Returns:

Promise to dispatch a keyup event.

Type
  Promise

#### dispatchPause(a, tickDuration) → {Promise}

Dispatch a pause action equivalent waiting for |a.duration| milliseconds, or a default time interval of |tickDuration|.

##### Parameters:

Name | Type | Description
--- | --- | ---
`a` | action.Action | Action to dispatch.
`tickDuration` | number | Duration in milliseconds of this tick.

Source:
  - action.js, line 1411

##### Returns:

Promise that is resolved after the specified time interval.

Type
  Promise

#### dispatchPointerDown(a, inputState, window) → {Promise}

Dispatch a pointerDown action equivalent to pressing a pointer-device button.

##### Parameters:

Name | Type | Description
--- | --- | ---
`a` | action.Action | Action to dispatch.
`inputState` | action.InputState | Input state for this action's input source.
`window` | WindowProxy | Current window global.

Source:
  - action.js, line 1205

##### Returns:

Promise to dispatch at least a pointerdown event.

Type
  Promise

#### dispatchPointerMove(a, inputState, seenEls, window) → {Promise}

Dispatch a pointerMove action equivalent to moving pointer device in a line.

If the action duration is 0, the pointer jumps immediately to the target coordinates. Otherwise, events are synthesized to mimic a pointer travelling in a discontinuous, approximately straight line, with the pointer coordinates being updated around 60 times per second.

##### Parameters:

Name | Type | Description
--- | --- | ---
`a` | action.Action | Action to dispatch.
`inputState` | action.InputState | Input state for this action's input source.
`seenEls` | element.Store | Element store.
`window` | WindowProxy | Current window global.

Source:
  - action.js, line 1314

##### Returns:

Promise to dispatch at least one pointermove event, as well as mousemove events as appropriate.

Type
  Promise

#### dispatchPointerUp(a, inputState, window) → {Promise}

Dispatch a pointerUp action equivalent to releasing a pointer-device button.

##### Parameters:

Name | Type | Description
--- | --- | ---
`a` | action.Action | Action to dispatch.
`inputState` | action.InputState | Input state for this action's input source.
`window` | WindowProxy | Current window global.

Source:
  - action.js, line 1263

##### Returns:

Promise to dispatch at least a pointerup event.

Type
  Promise

#### (async) exitFullscreen(window)

Exit fullscreen and wait for window to resize.

##### Parameters:

Name | Type | Description
--- | --- | ---
`window` | ChromeWindow | Window to exit fullscreen.

Source:
  - driver.js, line 3706

#### filterLinks(node, predicate) → {Array.<DOMAnchorElement>}

Filters all hyperlinks that are descendant of |node| by |predicate|.

##### Parameters:

Name | Type | Description
--- | --- | ---
`node` | DOMElement | Where in the DOM hierarchy to begin searching.
`predicate` | function | Function that determines if given link should be included in return value or filtered away.

Source:
  - element.js, line 412

##### Returns:

Sequence of link elements matching |predicate|.

Type
  Array.<DOMAnchorElement>

#### findElement(using, value, rootNode, startNodeopt) → {DOMElement}

Finds a single element.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`using` | element.Strategy |  | Selector strategy to use.
`value` | string |  | Selector expression.
`rootNode` | DOMElement |  | Document root.
`startNode` | DOMElement | <optional> | Optional node from which to start searching.

Source:
  - element.js, line 442

##### Throws:

- If strategy |using| is not recognised.

  Type
    InvalidSelectorError

- If selector expression |value| is malformed.

  Type
    Error

##### Returns:

Found elements.

Type
  DOMElement

#### (async) findElementContent()

Find an element in the current browsing context's document using the given search strategy.

Source:
  - listener.js, line 1307

#### findElements(using, value, rootNode, startNodeopt) → {DOMElement}

Find multiple elements.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`using` | element.Strategy |  | Selector strategy to use.
`value` | string |  | Selector expression.
`rootNode` | DOMElement |  | Document root.
`startNode` | DOMElement | <optional> | Optional node from which to start searching.

Source:
  - element.js, line 528

##### Throws:

- If strategy |using| is not recognised.

  Type
    InvalidSelectorError

- If selector expression |value| is malformed.

  Type
    Error

##### Returns:

Found elements.

Type
  DOMElement

#### (async) findElementsContent()

Find elements in the current browsing context's document using the given search strategy.

Source:
  - listener.js, line 1327

#### focusElement(element)

Focus element and, if a textual input field and no previous selection state exists, move the caret to the end of the input field.

##### Parameters:

Name | Type | Description
--- | --- | ---
`element` | Element | Element to focus.

Source:
  - event.js, line 1339

#### get()

Gets the object (not the serialized string) being read or written.

Source:
  - packets.js, line 147

#### get()

Navigate to the given URL. The operation will be performed on the current browsing context, which means it handles the case where we navigate within an iframe. All other navigation is handled by the driver (in chrome space).

Source:
  - listener.js, line 1190

#### getActiveElement()

Find and return the active element on the page.

Source:
  - listener.js, line 1344

#### getElementRect(id) → {Object.<string, number>}

Get the position and dimensions of the element.

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | WebElement | Reference to web element.

Source:
  - listener.js, line 1469

##### Returns:

The x, y, width, and height properties of the element.

Type
  Object.<string, number>

#### getElementTagName(id) → {string}

Get the tag name of an element.

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | WebElement | Reference to web element.

Source:
  - listener.js, line 1425

##### Returns:

Tag name of element.

Type
  string

#### getElementText(id) → {string}

Get the text of this element. This includes text from child elements.

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | WebElement | Reference to web element.

Source:
  - listener.js, line 1411

##### Returns:

Text of element.

Type
  string

#### getElementValueOfCssProperty(id, prop) → {String}

Retrieves the computed value of the given CSS property of the given web element.

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | String | Web element reference.
`prop` | String | The CSS property to get.

Source:
  - listener.js, line 1454

##### Returns:

Effective value of the requested CSS property.

Type
  String

#### getPageSource()

Get source of the current browsing context's DOM.

Source:
  - listener.js, line 1299

#### goBack(commandID, pageTimeout)

Cause the browser to traverse one step backward in the joint history of the current browsing context.

##### Parameters:

Name | Type | Description
--- | --- | ---
`commandID` | number | ID of the currently handled message between the driver and listener.
`pageTimeout` | number | Timeout in milliseconds the method has to wait for the page being finished loading.

Source:
  - listener.js, line 1231

#### goForward(commandID, pageTimeout)

Cause the browser to traverse one step forward in the joint history of the current browsing context.

##### Parameters:

Name | Type | Description
--- | --- | ---
`commandID` | number | ID of the currently handled message between the driver and listener.
`pageTimeout` | number | Timeout in milliseconds the method has to wait for the page being finished loading.

Source:
  - listener.js, line 1255

#### hex(buffer) → {string}

Convert buffer into to hex.

##### Parameters:

Name | Type | Description
--- | --- | ---
`buffer` | ArrayBuffer | The buffer containing the data to convert to hex.

Source:
  - capture.js, line 205

##### Returns:

A hex digest of the input buffer.

Type
  string

#### isElementDisplayed()

Determine the element displayedness of the given web element.

Also performs additional accessibility checks if enabled by session capability.

Source:
  - listener.js, line 1436

#### isElementEnabled(id) → {boolean}

Check if element is enabled.

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | WebElement | Reference to web element.

Source:
  - listener.js, line 1489

##### Returns:

True if enabled, false otherwise.

Type
  boolean

#### isElementSelected()

Determines if the referenced element is selected or not.

This operation only makes sense on input elements of the Checkbox- and Radio Button states, or option elements.

Source:
  - listener.js, line 1501

#### JSONPacket(transport)

With a JSON packet (the typical packet type sent via the transport), data is transferred as a JSON packet serialized into a string, with the string length prepended to the packet, followed by a colon ([length]:[packet]). The contents of the JSON packet are specified in the Remote Debugging Protocol specification.

##### Parameters:

Name | Type | Description
--- | --- | ---
`transport` | DebuggerTransport | Transport instance that will own the packet.

Source:
  - packets.js, line 109

#### LocalDebuggerTransport(other)

An adapter that handles data transfers between the debugger client and server when they both run in the same process. It presents the same API as DebuggerTransport, but instead of transmitting serialized messages across a connection it merely calls the packet dispatcher of the other side.

##### Parameters:

Name | Type | Description
--- | --- | ---
`other` | LocalDebuggerTransport | The other endpoint for this debugger connection.

Source:
  - transport.js, line 548
See:
  - {DebuggerTransport}

#### multiAction(maxLen)

Start multi-action.

##### Parameters:

Name | Type | Description
--- | --- | ---
`maxLen` | Number | Longest action chain for one finger.

Source:
  - listener.js, line 1124

#### newSession()

Called when we start a new session. It registers the current environment, and resets all values

Source:
  - listener.js, line 630

#### (async) performActions(msg)

Perform a series of grouped actions at the specified points in time.

##### Parameters:

Name | Type | Description
--- | --- | ---
`msg` | obj | Object with an |actions| attribute that is an Array of objects each of which represents an action sequence.

Source:
  - listener.js, line 945

#### pprint()

Pretty-print values passed to template strings.

Usage:

    const {pprint} = Cu.import("chrome://marionette/content/error.js", {});
    let bool = {value: true};
    pprint`Expected boolean, got ${bool}`;
    => 'Expected boolean, got [object Object] {"value": true}'

    let htmlElement = document.querySelector("input#foo");
    pprint`Expected element ${htmlElement}`;
    => 'Expected element <input id="foo" class="bar baz">'

Source:
  - error.js, line 165

#### RawPacket(transport, data)

RawPacket is used to test the transport's error handling of malformed packets, by writing data directly onto the stream.

##### Parameters:

Name | Type | Description
--- | --- | ---
`transport` |  | DebuggerTransport The transport instance that will own the packet.
`data` |  | string The raw string to send out onto the stream.

Source:
  - packets.js, line 384

#### refresh(commandID, pageTimeout)

Causes the browser to reload the page in in current top-level browsing context.

##### Parameters:

Name | Type | Description
--- | --- | ---
`commandID` | number | ID of the currently handled message between the driver and listener.
`pageTimeout` | number | Timeout in milliseconds the method has to wait for the page being finished loading.

Source:
  - listener.js, line 1279

#### registerSelf()

Called when listener is first started up. The listener sends its unique window ID and its current URI to the actor. If the actor returns an ID, we start the listeners. Otherwise, nothing happens.

Source:
  - listener.js, line 486

#### (async) releaseActions()

The release actions command is used to release all the keys and pointer buttons that are currently depressed. This causes events to be fired as if the state was released by an explicit series of actions. It also clears all the internal state of the virtual devices.

Source:
  - listener.js, line 956

#### removeMessageListenerId()

Remove a message listener that's tied to our listenerId.

Source:
  - listener.js, line 547

#### resetValues()

Clear test values after completion of test

Source:
  - listener.js, line 774

#### ResponseBody()

The response body is exposed as an argument to commands. Commands can set fields on the body through defining properties.

Setting properties invokes a validator that performs tests for mutually exclusionary fields on the input against the existing data in the body.

For example setting the {@code error} property on the body when {@code value}, {@code sessionId}, or {@code capabilities} have been set previously will cause an error.

Source:
  - message.js, line 205

#### restart()

Restarts all our listeners after this listener was put to sleep

Source:
  - listener.js, line 647

#### (async) restoreWindow(chromWindow, contentWindow)

Restore window and wait for the window state to change.

##### Parameters:

Name | Type | Description
--- | --- | ---
`chromWindow` | ChromeWindow | Window to restore.
`contentWindow` | WebElementEventTarget | Content window to listen for events in.

Source:
  - driver.js, line 3721

#### sendError(err, uuid)

Send asynchronous error reply to chrome.

##### Parameters:

Name | Type | Description
--- | --- | ---
`err` | Error | Error to notify chrome of.
`uuid` | UUID | Unique identifier of the request.

Source:
  - listener.js, line 767

#### sendOk(uuid)

Send asynchronous reply to chrome.

##### Parameters:

Name | Type | Description
--- | --- | ---
`uuid` | UUID | Unique identifier of the request.

Source:
  - listener.js, line 755

#### sendResponse(obj, uuid)

Send asynchronous reply with value to chrome.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | Object | JSON serialisable object of arbitrary type and complexity.
`uuid` | UUID | Unique identifier of the request.

Source:
  - listener.js, line 745

#### sendToServer(uuid, type, Objectopt)

Send asynchronous reply to chrome.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`uuid` | UUID |  | Unique identifier of the request.
`type` | AsyncContentSender.ResponseType |  | Type of response.
`Object` | * | <optional> | data JSON serialisable object to accompany the message. Defaults to an empty dictionary.

Source:
  - listener.js, line 730

#### set()

Sets the object to be sent when write() is called.

Source:
  - packets.js, line 154

#### (async) singleTap()

Function that perform a single tap

Source:
  - listener.js, line 890

#### sleepSession()

Puts the current session to sleep, so all listeners are removed except for the 'restart' listener.

Source:
  - listener.js, line 639

#### stack()

Create a stacktrace to the current line in the program.

Source:
  - error.js, line 220

#### startListeners()

Start all message listeners

Source:
  - listener.js, line 580

#### switchToFrame()

Switch to frame given either the server-assigned element id, its index in window.frames, or the iframe's name or id.

Source:
  - listener.js, line 1595

#### switchToParentFrame()

Switch to the parent frame of the current frame. If the frame is the top most is the current frame then no action will happen.

Source:
  - listener.js, line 1581

#### switchToShadowRoot(id)

Switch the current context to the specified host's Shadow DOM.

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | WebElement | Reference to web element.

Source:
  - listener.js, line 1546

#### takeScreenshot(idopt, fullopt, highlightsopt, scrollopt, format, opts) → {string}

Perform a screen capture in content context.

Accepted values for |opts|:

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`id` | UUID | <optional> | Optional web element reference of an element to take a screenshot of.
`full` | boolean | <optional> | True to take a screenshot of the entire document element. Is not considered if {@code id} is not defined. Defaults to true.
`highlights` | Array.<UUID> | <optional> | Draw a border around the elements found by their web element references.
`scroll` | boolean | <optional> | When |id| is given, scroll it into view before taking the screenshot. Defaults to true.
`format` | capture.Format |  | Format to return the screenshot in.
`opts` | Object.<string, ?> |  | Options.

Source:
  - listener.js, line 1763

##### Returns:

Base64 encoded string or a SHA-256 hash of the screenshot.

Type
  string

#### TimedPromise(func, timeoutopt, throwsopt) → {Promise.<*>}

The `TimedPromise` object represents the timed, eventual completion (or failure) of an asynchronous operation, and its resulting value.

In contrast to a regular `Promise`, it times out after timeout.

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`func` | Condition |  |  | Function to run, which will have its `reject` callback invoked after the timeout duration is reached. It is given two callbacks: `resolve(value)` and `reject(error)`.
`timeout` | timeout | <optional> | 1500 | timeout condition's `reject` callback will be called after this timeout.
`throws` | Error | <optional> | TimeoutError | throws When the timeout is hit, this error class will be thrown. If it is null, no error is thrown and the promise is instead resolved on timeout.

Source:
  - wait.js, line 147

##### Returns:

Timed promise.

Type
  Promise.<*>

#### toEvents(tickDuration, seenEls, window) → {function}

Create a closure to use as a map from action definitions to Promise events.

##### Parameters:

Name | Type | Description
--- | --- | ---
`tickDuration` | number | Duration in milliseconds of this tick.
`seenEls` | element.Store | Element store.
`window` | WindowProxy | Current window global.

Source:
  - action.js, line 1094

##### Returns:

Function that takes an action and returns a Promise for dispatching the event that corresponds to that action.

Type
  function

#### waitForPageLoaded(commandID, pageTimeout, startTime)

This implements the latter part of a get request (for the case we need to resume one when the frame script has been reloaded in the middle of a navigate request). This is most of of the work of a navigate request, but doesn't assume DOMContentLoaded is yet to fire.

##### Parameters:

Name | Type | Description
--- | --- | ---
`commandID` | number | ID of the currently handled message between the driver and listener.
`pageTimeout` | number | Timeout in seconds the method has to wait for the page being finished loading.
`startTime` | number | Unix timestap when the navitation request got triggred.

Source:
  - listener.js, line 1177

#### whenIdle(window, callback) → {function}

Throttle callback until the main thread is idle and window has performed an animation frame.

##### Parameters:

Name | Type | Description
--- | --- | ---
`window` | ChromeWindow | Window to request the animation frame from.
`callback` | function | Called when done.

Source:
  - driver.js, line 3742

##### Returns:

Anonymous function that when invoked will wait for the main thread to clear up and request an animation frame before calling callback.

Type
  function

### Type Definitions

#### Condition(resolve, reject) → {*}

##### Parameters:

Name | Type | Description
--- | --- | ---
`resolve` | function | To be called when the condition has been met. Will return the resolved value.
`reject` | function | To be called when the condition has not been met. Will cause the condition to be revaluated or time out.

Source:
  - wait.js, line 25

##### Returns:

The value from calling `resolve`.

Type
  *

#### ResponseCallback(resp)

##### Parameters:

Name | Type | Description
--- | --- | ---
`resp` | Response | Response to handle.

Source:
  - message.js, line 207