Jira resizes iframe height constantly

Hi,
our app shows a webpage in an iframe. This worked well until we switched to Atlassian Connect 2. Now, when the iframe is shown, its height grows constantly. It seems not to be a problem with the page shown in the iframe: when opened in a separate browser window it behaves Ok.
In my IssueTabController I show the page like this (for the example I point it to Wikipedia):

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <div th:replace="fragments/header :: header(${localBaseUrl})"/>
</head>
<body>
    <th:block th:utext="${webappLink}">no data</th:block>
</body>
</html>

where webappLink has this value:

<div class="h_iframe">
  <iframe height="800px" frameborder="0" src="https://www.wikipedia.de">
   Sorry, your browser does not support iframes.
  </iframe>
</div>

The problem occurs with Firefox (latest version) and Safari (13.0.5). In Chrome the iframe shows up correctly (no resizing).

Update:

To be sure it has nothing to do with the content of the referred page I linked the iframe to a local page containing only:

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Fragments to be included in the templates</title>
</head>
<body>
Hello!
</body>
</html>

Same effect: the size keeps increasing over and over again.

Hi,
Have you added the ac-content class as per https://developer.atlassian.com/cloud/confluence/jsapi/iframe/ ?

1 Like

@jhazelwood, but ac-content is there to perform auto-resize. Also ac-content is not required as far as I understand. When it is missing, AP/Jira should not resize the iframe. Is that right?

Hi all,

yes I had added the ac-content class. However, in the meantime we had to restructure the whole UI because of cookie restrictions in the plugin iframe. Since then we don’t have this problem anymore. We now have the problem, that resize does not occur at all - even with ac-content, see: Jira does not resize iframe height correctly