Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

st.dataframe() "Download as CSV" does not work when embedded. Error: Failed to execute 'showSaveFilePicker' on 'Window': Cross origin sub frames aren't allowed to show a file picker. #8210

Closed
3 of 4 tasks
vaishnav-ira opened this issue Feb 27, 2024 · 3 comments · Fixed by #8452
Labels
feature:st.data_editor feature:st.dataframe priority:P3 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working

Comments

@vaishnav-ira
Copy link

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

In the documentation page aswell
https://docs.streamlit.io/library/api-reference/data/st.dataframe
When the download as CSV is clicked nothing happens
image
Console has the following error:
Uncaught (in promise) DOMException: Failed to execute 'showSaveFilePicker' on 'Window': Cross origin sub frames aren't allowed to show a file picker.

Reproducible Code Example

No response

Steps To Reproduce

No response

Expected Behavior

No response

Current Behavior

No response

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version:
  • Python version:
  • Operating System:
  • Browser:

Additional Information

No response

@vaishnav-ira vaishnav-ira added status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working labels Feb 27, 2024
Copy link

If this issue affects you, please react with a 👍 (thumbs up emoji) to the initial post.

Your feedback helps us prioritize which bugs to investigate and address first.

Visits

@LukasMasuch LukasMasuch added feature:st.dataframe status:confirmed Bug has been confirmed by the Streamlit team priority:P3 feature:st.data_editor and removed status:needs-triage Has not been triaged by the Streamlit team labels Feb 27, 2024
@LukasMasuch
Copy link
Collaborator

@vaishnav-ira Thanks for reporting this issue. I was able to reproduce it. Needs some further investigation if there is a good way to get a file picker working in an embedded app from a different domain.

@Alexmhack
Copy link

Is this fixed? Any updates?

raethlein added a commit that referenced this issue May 16, 2024
## Describe your changes

This PR adds a fallback to an old browser download method for CSV
dataframe download feature. Some browser or situations might not
correctly support the file picker feature, in these cases it will
fallback to an older more commonly supported download method.

We also add iframe tests together with CSPs here. This can be used in
the future also by other tests.

## GitHub Issue Link (if applicable)

- Closes #8210

## Testing Plan

- E2E tests: added e2e tests for downloading a CSV file from the
dataframe; also within an iframe and with a content-security-policy
in-place

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.

---------

Co-authored-by: Karen Javadyan <kajarenc@gmail.com>
Co-authored-by: braethlein <benjamin.raethlein@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:st.data_editor feature:st.dataframe priority:P3 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants