Class

SpotfireMessageHandler

SpotfireMessageHandler(spotfireDocument, [frameOrigin], [debug])

Test

Constructor

new SpotfireMessageHandler(spotfireDocument, [frameOrigin], [debug])

Parameters:
Name Type Description
spotfireDocument SpotfireDocument

the instance of SpotfireDocument to expose.

[ frameOrigin = '*' ] String

the origin of the frame you want to open to, or "*" for all.

[ debug = false ] Boolean

Whether to log extra debug information

Example
// Instantiate the SpotfireMessageHandler to expose the spotfireDocument object instantiated on the page
const spotfireDocument = new SpotfireDocument({
  serverUrl: 'https://spotfire.discngine.com',
  documentPath: '/Discngine/Client Automation/empty'
});

const messageHandler = new SpotfireMessageHandler(spotfireDocument, 'http://other.discngine.com');
// From now on, every call emitted by the SpotfireDocumentProxy counterpart instantiated
// on the other frame located under http://other.discngine.com will be relayed to
// the spotfireDocument object.