Class: Lens.Embed

Lens.Embed allows you to embed a Lens app inside another Lens app. You can then pass messages to the embedded app.

Static Properties

Lens.Embed.parentDispatcher: Dispatcher ARCore/embed.js, line 92

A Dispatcher that allows communication with this app's parent app. Returns null if this app is not embedded.

Static Methods

Lens.Embed._addPostInitCallback(fn) → {Binding} ARCore/embed.js, line 102

Adds a callback to be called on each newly-created embedded lens. This can be used to ensure that all embedded Lenses have access to a particular RPC on the parent.

Argument Type Description
fn function

The function to call.

Returns:

A binding that can be cleared to cancel the callback.

Lens.Embed.app(name) → {Embed} ARCore/embed.js, line 52

Embeds another Lens app inside this one, given the name of an app.

Argument Type Description
name String

Name of the app, such as scrapbook or look-and-feel.demos

Lens.Embed.iframe(el) → {Embed} ARCore/embed.js, line 77

Connects to a Lens app already running in an iframe.

Argument Type Description
el HTMLIFrameElement | String | jQuery

An iFrame element, CSS selector, or jQuery object.

Lens.Embed.url(name) → {Embed} ARCore/embed.js, line 64

Embeds another Lens app inside this one, given the URL of an app.

Argument Type Description
name String

URL of the app, such as http://launcher.lens/

Instance Properties

iframe: HTMLIFrameElement

The IFrame that contains the embedded app. Insert this into the DOM. Do not use postMessage to send messages to the embedded Lens app. Instead, use the dispatcher for this Embed.

dispatcher: Dispatcher

A Dispatcher that allows for communication between this app and the embedded app.