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.
Dimensions
The Dimensions object is a JSON-formatted object containing context information about dimensions of the iFrame on which the canvas app appears.
| Field | Description |
|---|---|
| clientHeight | The values of clientHeight are sent to the canvas app within SignedRequest and can be used to set the height of the outermost div element. This field is useful for setting the height of an app that’s accessed from a mobile device. The field can be referenced as sr.context.environment.dimensions.clientHeight, where sr is the parsed signed request JavaScript object. |
| clientWidth | The values of clientWidth are sent to the canvas app within SignedRequest and can be used to set the width of the outermost div element. This field is useful for setting the width of an app that’s accessed from a mobile device. The field can be referenced as sr.context.environment.dimensions.clientWidth, where sr is the parsed signed request JavaScript object. |
| height | The height of the iFrame in pixels. |
| width | The width of the iFrame in pixels. |
| maxHeight | The maximum height of the iFrame in pixels. Defaults to 2,000; “infinite” is also a valid value. |
| maxWidth | The maximum width of the iFrame in pixels. Defaults to 1,000; “infinite” is also a valid value. |
The following code snippet shows an example of the Dimensions object.
1"dimensions":
2{
3
4 "clientHeight": "50px",
5 "clientWidth": "70px",
6 "height": "900px",
7 "width": "800px",
8 "maxHeight": "2000px",
9 "maxWidth": "1000px"
10},