---
schema_version: "1"
id: a1cf56938cd68f06aac3a227442195ead19d3babc81c271831b4d915c531ca1a
title: Automatically Resizing a Canvas App
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/canvas-framework/guides/platform-connect/using/resizing/canvas-app-autogrow-code-example.md
canonical_url: https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-autogrow-code-example.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ace11bd4adc64948c73c6e7d354b5bf8c251faf6646584682020c9e7388ff82a
products:
  - Canvas Developer Guide
  - Platform Developer Content
---

# Automatically Resizing a Canvas App

The following code examples show how to call the `autogrow` method to resize a canvas app. Use this method when your content will change size, but you’re not sure when.

**note:** In Mozilla® Firefox® and Microsoft® Internet Explorer®, the `autogrow` method might not resize the frame if the content size is reduced. In this case, you can use the `resize` method to specify the exact size that you want to change the frame to.

<!-- otherprops: set_clipboard -->
```java

// Turn on auto grow with default settings.
Sfdc.canvas(function() {
    sr = JSON.parse('<%=signedRequestJson%>');
    Sfdc.canvas.client.autogrow(sr.client);
});

// Turn on auto grow with polling interval of 100ms (milliseconds).
Sfdc.canvas(function() {
    sr = JSON.parse('<%=signedRequestJson%>');
    Sfdc.canvas.client.autogrow(sr.client, true, 100);
});

// Turn off auto grow.
Sfdc.canvas(function() {
    sr = JSON.parse('<%=signedRequestJson%>');
    Sfdc.canvas.client.autogrow(sr.client, false);
});
```

**See Also**  


-   [Resizing a Canvas App](https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-resizing.md)
-   [Explicitly Resizing a Canvas App](https://developer.salesforce.com/docs/platform/canvas-framework/guide/canvas-app-resize-code-example.md)

