vercel / storage

Vercel Postgres, KV, Blob, and Edge Config
https://vercel.com/storage
Apache License 2.0
517 stars 58 forks source link

Safari: Refused to apply a stylesheet for PDF views #728

Closed TechEclipse closed 4 months ago

TechEclipse commented 4 months ago

Description

If you open a pdf in Safari that was uploaded to the vercel storage as blob and set to public an error is logged to the console: Refused to apply a stylesheet because its hash, its nonce, or 'unsafe-inline' appears in neither the style-src directive nor the default-src directive of the Content Security Policy. that results in rendering the pdf in a height of 154px. There is no problem in other bigger browsers (Chrome or Firefox) but unfortunately our users also using Safari and wants to open the PDF in a new Tab within the browser. Is it possible to adjust the CSP Headers accordingly so PDF's are rendered in full size in Safari?

To reproduce

Used versions

vvo commented 4 months ago

Hey @TechEclipse we're looking into this right now, this is a Safari bug and we're digging on how to solve it properly. https://bugs.webkit.org/show_bug.cgi?id=166630

vvo commented 4 months ago

Hey @TechEclipse, we deployed a change and now pdf preview will work correctly in Safari: https://ikycltsnmoaacgtb.public.blob.vercel-storage.com/sample-2z1edkvm5KDSpeEUJ2vJrWCv2RXAL8.pdf