Skip to main content

Mattertag.IMessenger

A messaging object to send and receive messages to and from your iframe sandbox.

Methods

Methods

off

off(eventType: string, eventHandler: (...args: any[]) => void): void

Remove a handler for messages of type eventType from the iframe sandbox

ParameterType
eventTypestring
eventHandler(...args: any[]) => void

on

on(eventType: string, eventHandler: (...args: any[]) => void): void

Add a handler for messages of type eventType from the iframe sandbox

ParameterType
eventTypestring
eventHandler(...args: any[]) => void

send

send(eventType: string, args: any[]): void

Send a messages of type eventType to the iframe sandbox with any optional data associated with the message

ParameterType
eventTypestring
argsany[]