Register a handler for incoming messages from the UI's
on(type: "message", callback: (pluginMessage: any, props: OnMessageProperties) => void): void
pluginMessage argument contains the message passed by the call to
postMessage on the UI side.
props argument contains a
origin property contains the origin of the document that sent the message. It is an advanced feature, mainly used for implementing OAuth.