Uploaded image for project: 'Atlassian Ecosystem'
  1. Atlassian Ecosystem
  2. ECO-6

JavaScript API doesn't work if Jira runs in iframe itself

    XMLWordPrintable

Details

    • Minor
    • 3

    Description

      Created from https://ecosystem.atlassian.net/browse/ACJIRA-2613

      Issue Summary

      Our customers want to embed our Jira app’s UI into Confluence pages. To do so, they add an iframe using Confluence’s built-in iframe macro, pointing to the respective Jira URL (e.g. https://foo.atlassian.net/projects/FOO?selectedItem=com.atlassian.plugins.atlassian-connect-plugin:app.jxl).

      In this setup, the Connect JavaScript API - while being loaded seemingly successfully - doesn’t work; the various callbacks, like window.AP.getCurrentUser, simply never resolve.

       

      To verify, call

      window.AP.getCurrentUser((x) => console.log(x));

       

      from the Connect iframe's console. It works if Jira runs in its own browser window, but doesn’t resolve if Jira runs within the iframe.

      There's suspicion that Connect gets confused about to the two nested iframes: First, Jira in Confluence, and then our app in Jira.

      Steps to Reproduce

      1. Confluence’s built-in iframe macro, pointing to the respective Jira URL (e.g. https://foo.atlassian.net/projects/FOO?selectedItem=com.atlassian.plugins.atlassian-connect-plugin:app.jxl).
      2. Call from the Connect iframe's console:
        window.AP.getCurrentUser((x) => console.log(x));

      Expected Results

      It resolves within Jira iframe.

      Actual Results

      It doesn’t resolve if Jira runs within the iframe. 

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

       

      Additionally it blocks important use cases for customers.

      Attachments

        Activity

          People

            a927362f27e1 Varun Bhargava (Inactive)
            ed2f9d56d345 Szymon Rękawek
            Votes:
            13 Vote for this issue
            Watchers:
            15 Start watching this issue

            Dates

              Created:
              Updated: