Home Reference Source Test Repository
import SandboxReceiver from '@io-monad/chrome-util/src/sandbox-receiver.js'
public class | source

SandboxReceiver

Message receiver for sandbox iframe using postMessage.

Example:

    const receiver = new SandboxReceiver({
      FOO: this.handleFoo,
      BAR: this.handleBar,
    }, this);

Constructor Summary

Public Constructor
public

Public Constructors

public constructor(handlers: Object<string, SandboxReceiver~ReceiverFunction>, thisObj: Object) source

Params:

NameTypeAttributeDescription
handlers Object<string, SandboxReceiver~ReceiverFunction>

Mappings of message types to handler functions.

thisObj Object
  • optional

this context for calling handlers.