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 2 years ago
- Reactions: 4
- Comments: 23 (2 by maintainers)
I found the solution(but I don’t know if this solution is correct) The solution is to use
@preset-sdk/embeddedinstead of@superset-ui/embedded-sdk. I can download csv and open the new window.@superset-ui/embedded-sdkis old and not updated. superset-embedded-sdk in the superset repository is updated, but not reflected in the npm package.Still not working, we ended up using post message to transfer the .CSV, it is working now