Connect: Static Content Macro with custom editor wont save on chrome

Hi all,

I am developing an add-on with atlassian connect, providing a static content macro for confluence. The macro uses a custom editor.
When I save in the editor it works fine in Firefox and even Internet Explorer 11 but not on chrome. I get a lot of warnings in all Browsers but when I save with Chrome, the event handler on “dialog.submit” is called and the editor dialog closes but the Macro Placeholder is not added to the page and when I save the page the macro is also not on the page.
Currently the macro is not doing more than saving a string on with “AP.confluence.saveMacro” on dialog.submit event.

This is the JavaScript Code:

if ("AP" in window) {
  AP.confluence.getMacroData(function(params) {
    console.log('saved', params);
  });
  AP.events.on("dialog.submit", function() {
    console.log('submit');

    console.log('saving macro with config id abcde');
    AP.confluence.saveMacro({'overview_config_id': 'abcde'});

    return true;
  });
}

Here the console output from Google Chrome (top) and Firefox (bottom):


Any ideas what is going wrong? Please let me know if you need additional information.

Confluence 1000.1475.1 (in Atlassian Cloud with free developing account)

Greetings
Jan

Hi, did u find any answer here? I am also facing the same issue. IF I put a break point in my chrome on the save macro function and then run the same function in console manually it actually saves the macro data.

Hi,
unfortunately I did not find any solution yet. Would be great if one of the developers could investigate here…

We have a number of users suddenly hitting this in production using draw.io for Confluence Cloud. Whether or not it happens seems to be linked to particular users. Most don’t hit it, but those that do hit it on every browser. I’ll file a ticket.

@jan.stuhlmann I encountered a similair problem in a Macro that I wrote. In our case it also still worked in Firefox. The problem is that Chrome is blocking the script since it is loaded in an iframe with a different origin than the site itself. Chrome then blocks that due to detected cross-site scripting. As far as I researched there is the option to whitelist your script in the admin pannel but that feature is only available on a confluence-server version and is disabled in the cloud version.

Maybe that helps (even though your question was a while ago, maybe someone finds this usefull in the future).