Macro not loading in macro editor preview and page preview

XMLWordPrintable

    • Severity 3 - Minor

      Raised by: https://groups.google.com/forum/#!topic/atlassian-connect-dev/ZXB6HOHtVO8

      Since the preview of a page or macro is an iFrame, the macro is going to think it's an iframe in an iframe and then tries to create an inner connect frame - so that's why we get the AP is undefined.

      This block of code needs to be updated to check if the iframe is a preview iframe or not....

      atlassian-connect/jsapi/src/main/resources/v3/velocity/iframe-body-script.vm
      if(window.top === window) {
          _AP.addonOriginMap = iFrameData.addonOriginMap || {};
          require(['connect-host', 'ac/cookie', 'ac/env', 'ac/inline-dialog', 'ac/dialog', 'ac/messages', 'ac/request', 'ac/history'], function(host){
              host.create(iFrameData);
          });
      } else { //If we are a plugin frame
          AP.require('_create-inner-frame', function(createInnerFrame) {
              createInnerFrame(iFrameData);
          });
      }
      

            Assignee:
            Marco
            Reporter:
            khanh (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: