Creating a dialog using AP.require('dialog') in AUI 9.0.3 results in Cross Origin Request

Hi,
In my plugin I am trying to open a dialog on a JIRA server instance from within an iframe. The iframe is within a webpanel. The iframe consists of a button when clicked uses the AP (JavaScript API) library to create a dialog using,

 _AP.require('dialog', function(dialog) {
                        dialog.create(options);
}

With AUI 9.0.3 the above code results in the following error,

Uncaught DOMException: Blocked a frame with origin "http://<jira-host-ip>" from accessing a cross-origin frame.

When trying to post the message back to the parent window (parent.postMessage)and create a dialog using,

window.addEventListener("message", receiveMessage);

function receiveMessage(event) {
   AJS.dialog2("#new-dialog").show();
}

It results in the following error,

Cannot read property 'hasAttribute' of undefined

How do I mitigate this issue?

Update:

I am currently using Simple-xdm (Bitbucket) to communicate between iframe and the host but it still results in the following exception,

Uncaught DOMException: Blocked a frame with origin “http://localhost:2990” from accessing a cross-origin frame.

Thanks for bringing this to our attention @karanjagdish!

It looks like this is a bug in AUI 9. I have raised [AUI-5256] - Ecosystem Jira; please track this issue for the resolution.

Cheers,
Daz

Hi im running into the same issue using AUI 8.5.1 for JIRA Server 8.12.x
Its not an issue with older versions of JIRA Server 8.11 etc…

This problem should be fixed in AUI 9.1.1 now - please try it out by installing the latest AUI plugin in your dev instance. Link to the plugin jar file: https://packages.atlassian.com/maven-public-local/com/atlassian/aui/auiplugin/9.1.1/auiplugin-9.1.1.jar

Hi Bartosz,

Our plugin currently maintains compatibility from Jira 8.8.0 to 8.11.1. In the light of this issue, it is not compatible with Jira 8.12.0, 8.12.1, 8.12.2 and 8.13. The bug fix for this issue is only available in 8.12.3 and 8.13.1

I would like to know if there is a way to mark compatibility with specific versions, as I understand, only a single range of versions can be specified in the compatible version list.

How do we make our add-on compatible with 8.12.3 and 8.13.1 but not 8.13.0?

If it’s not possible to select individual compatible versions, what is the official Atlassian recommended handling of this for our addon?

1 Like

Hi @karanjagdish,

Thank you for rising this issue. I understand the problem and I’ll take it to the team. We will get back to you with more details on how to handle it next week.

1 Like

Hi @BartoszCytrowski,

Do you have an update on the previous query?

@daz, could you help me out on this as well?

Hi @karanjagdish, I’m sorry it’s taking so long. I don’t have the official answer yet. So far I didn’t find a way of excluding specific versions / specifying multiple ranges of versions. I hope to have a final update by the end of this week.

Final update: The only way to do this is to explicitly specify it in the “more details” section. Just plain text info. You can write on the listing that the addon won’t work with the particular versions of the app due to the bug in the app - not in your addon.

1 Like