How to get IframeCommunicationManager


import IframeCommunicationManager from 'fontoxml-iframe-communication/iframeCommunicationManager'


], function (
) {

Type: Class

Allows the application hosting a Fonto window to control the active Fonto instance and vice versa.

Import fontoxml-iframe-communication/iframeCommunicationManager from the Fonto application to communicate with the hosting application. Use the browser's native postMessage API to control the Fonto instance from the hosting application.

Messages posted to the Fonto window or iframe should have as their data a JSON-encoded object with at least a type property specifying the type of the message, as listed in the table below.

Accepted messages

Message type Description
fontoxml-execute-operation Execute an operation. The message data should contain the operationName to invoke, and data to pass to the operation. Only operations from a limited whitelist may be invoked from an external source. By default this list is empty. Set the iframe-communication-operations-whitelist configuration setting to an array of operation names to specify the whitelist.


Name Description

Post a custom command message to the parent window.

# Name Type Description
1. type String

The type of message to send to the parent (CMS)

2. [metadata] Object

An object containing command specific properties


Tell the hosting application to close the Fonto instance. The hosting application is responsible for cleaning up auto-saves, releasing locks and closing the window or iframe. If discardSaves is true, all saves of the current session should be discarded.

# Name Type Description
1. discardSaves Boolean

whether all the saves of the current edit session should be discarded


Tell the hosting application to resize the Fonto window or iframe between a full-screen view and one hosted in the CMS interface.

# Name Type Description
1. isInFullScreenMode Boolean

whether the editor should be toggled to full screen or not