Skip to content

Conversation

@khlr
Copy link
Contributor

@khlr khlr commented May 27, 2025

I'm wondering if I'm the only one who (by surprise) noticed that the export fails in Firefox (and only in FF) with the following message:

Content-Security-Policy: The page’s settings blocked the loading of a resource (frame-src) at data:application/json;charset=utf-8,... because it violates the following directive: “default-src 'none'”

Chromium based browsers seem to be fine with this. The exports succeed.

First I thought this issue would be related to our latest release (v1.9.0), but nothing was changed in regard to the export function in the first place and even v1.8.0 wouldn't export anything anymore in FF. Hence I think that FF must have tightened something in one of the last browser versions regarding CSP handling...

We could probably fix this with a more specialized CSP than default-src 'none' but I think using the downloads API instead frees us from all those CSP hassles...

@khlr khlr requested review from thijskh and tvdijen May 27, 2025 19:53
Copy link
Member

@tvdijen tvdijen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oi, I think I may have caused this by introducing the CSP-headers in the latest version.. Let's do both, so also add frame-src data:; to the CSP-headers

@khlr
Copy link
Contributor Author

khlr commented May 28, 2025

Wow... How on earth did I not see those lines...?! I had been wondering for a quite long time where the CSP "suddenly" came from... 🙈😄

Let's do both

Why that? I think we should either use a permissive CSP (which we should not) or use the alternative proposed in this PR. But I wouldn't mix both?!

@tvdijen
Copy link
Member

tvdijen commented May 28, 2025

You're right, I dunno what I was thinking. This change should take away the need for the permissive CSP, because it's no longer triggering the issue.

I'd say, go ahead and merge & release!

@khlr khlr merged commit f4a89c6 into main May 28, 2025
@khlr khlr deleted the bugfix/use-downloads-api-to-avoid-csp-issues branch May 28, 2025 18:13
khlr added a commit that referenced this pull request Jun 5, 2025
khlr added a commit that referenced this pull request Jun 5, 2025
* Revert "Use the downloads API to avoid CSP issues (#102)"

This reverts commit f4a89c6.

* Adjust CSP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants