Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Controller

If your Visualforce page contains a canvas app, you can use methods in the Controller object to publish an event that the canvas app subscribes to. It contains these methods:
Method Signature Description
publish publish(String name, Object payload [, String[] target]) Used to publish an event that the canvas app subscribes to. The target parameter is optional. It can contain a single canvas app name or an array of canvas app names.
resize resize(String height, String width, String target) Used by a Visualforce page to resize a canvas app iFrame.
subscribe subscribe(Subscriber event) Used by a Visualforce page to subscribe to events that the canvas app might publish.
unsubscribe unsubscribe(Unsubscriber event) Used by a Visualforce page to unsubscribe to parent events that the canvas app might publish.