Open anders-kiaer opened 3 years ago
The library currently supports Firefox 3.5+, Google Chrome, Opera 12+, IE9+, Safari 6+, from which at least IE9 does not supoprt Blob
s. Arguably, updating that list and dropping support for some of the older versions is long overdue, at which point use of Blob's could be evalutated.
Hi! Can this be revisited? IE9 support should not be necessary any more?
Please follow the general troubleshooting steps first:
Bug reports:
html2canvas
is working nicely with strict CSP settings (https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP), except that it appears you have to allow thedata:
scheme inimg-src
, e.g. using something like:Snippet from Mozilla's documentation on
img-src
CSP (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/img-src):I'm wondering if it is feasible to use
blob:
instead ofdata:
. To my knowledge, the reason Mozilla's documentation doesn't have the same explicit warning forblob:
is due to the fact thatblob:
URLs can only be generated internally by the browser (whiledata:
URLs can be crafted externally).Not sure how though - one approach might be to try replacing
.toDataURL
occurances in the code with.toBlob
, which also appears to have other benefits besides allowingblob:
vsdata:
.It looks like pure text etc. is already today properly captured in screenshots even without allowing
data:
, while e.g. properly capturing SVGs currently requiredata:
.Specifications: