Open jeffemandel opened 1 week ago
It probably doesn’t make sense to use d3-fetch for this. The implementation is pretty trivial on top of the Fetch API, so just use the Fetch API directly?
Correct, but as trustedTypes become more prevalent, it might be nice to make it easier to be in compliance.
I am using d3.svg to import svg images. I recently added require-trusted-types-for 'script'; to my CSP, and now I get this error:
The stack trace points me to xml.js, which has:
The problem is that the text passed to parseFromString needs to be sanitized with some sort of TrustedTypePolicy. This works:
Where:
This probably affects all of the routines in d3-fetch, at least for the createScriptURL.