superset: export to .CSV in embedding superset not working

Hi, I have successfully embedded the dashboard and we want feature export to .CSV , but it is not working it said

Blocked opening 'URL' in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set.
Blocked form submission to 'URL' because the form's frame is sandboxed and the 'allow-forms' permission is not set.

I was able to override the iframe with this way

    const embed = await embedDashboard({
      id: dashboardId,
      supersetDomain: URL,
      mountPoint: document.querySelector("#superset-id"),
      fetchGuestToken: () => guestToken,
      dashboardUiConfig: {
        hideTitle: true,
        hideChartControls: false,
        hideTab: true,
      },
    });

    const size = await embed.getScrollSize();

    if (size.width !== 0) {
      const iframe = document.querySelector("iframe") as HTMLIFrameElement;
      iframe.setAttribute(
        "sandbox",
        "allow-same-origin allow-scripts allow-presentation allow-downloads allow-forms allow-popups allow-popups-to-escape-sandbox"
      );
    }
    

still it returns the same error as I mentioned above, by any chance is there a way we can fix this?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 27 (2 by maintainers)

Most upvoted comments

I found the solution(but I don’t know if this solution is correct) The solution is to use @preset-sdk/embedded instead of @superset-ui/embedded-sdk. I can download csv and open the new window.

@superset-ui/embedded-sdk is old and not updated. superset-embedded-sdk in the superset repository is updated, but not reflected in the npm package.

@ikerd have you set the feature flag ALLOW_FULL_CSV_EXPORT ? I’m using 4.0.1 and no exports options and I want to use “View as Table” and “Drill to Detail” but it show only “Force Refresh” and “Enter full screen”.

I still have the same problem with 3.0.1 even with the following set of permissions CleanShot 2023-10-31 at 13 52 34@2x my tables do not get the csv export feature for the embedded dashboard. Non-embedded working fine

CleanShot 2023-10-31 at 13 52 57@2x

Still not working, we ended up using post message to transfer the .CSV, it is working now