Open egaillot opened 2 years ago
I am encountering the exact same issue - it looks like html2canvas doesn't work with nonces.
it looks like html2canvas doesn't work with nonces.
Well, it works with nonces on Safari & Chrome…
it looks like html2canvas doesn't work with nonces.
Well, it works with nonces on Safari & Chrome…
True - but how do you pass in a nonce prop? Im not sure how it is dealing with nonces on Chrome/FF if you cant pass it a prop.
@chrisphillers – Not sure I understand your question… 😓
I can (and do) pass the nonce in the following fashion: <style nonce="…">
. If I specify the CSP style-src
directive to 'self' 'nonce-XXX'
and don't pass the nonce
property in the style
tag, then it doesn't work (as expected) on Chrome and Safari.
Hi,
I'm struggling with an issue that seems to appear only with Firefox (tested on Firefox v95.0b12). I want to render in a PDF a bar of variable width, depending on some value computed by the server. The response has a Content-Security-Policy with a
style-src
directive set to'self' 'nonce-XXX'
. I use an inline style with that nonce to specify the width of that bar.When I display the bar in the web page, it works fine. However, when I want to render it as an image through html2canvas, the inline style is blocked in Firefox (as indicated in the web console). The rendering works fine with Safari v15.0 and Chrome v95.0.4638.54. I'm on MacOS Catalina 10.15.7.
Here's a piece of code that I used to reproduce the problem:
index.html
:bars.css
Any idea what is going on?