Chromium won't show PDF's served from your webserver?

🕧︎ - 2019-04-18
Grey with grey If Chromium won't show PDF's inline when served from your webserver, it might be because you followed some security advice and set a "Content-Security-Policy"-header, containing the rule "default-src 'none'".

The symptom is that instead of showing the PDF, Chromium will just show a grey page with a tiny rectangle with rounded corners in the middle.

I fixed it by changing "none" to "self"; but I guess I should figure out which of the more specific policies it is that Chromium needs to be changed.

Some more digging reveals the I can keep "default-src 'none'" if I add "object-src 'self'", and Chromium will then display PDF's inline, so that's what I'm using now.

Add comment

To avoid spam many websites make you fill out a CAPTCHA, or log in via an account at a corporation such as Twitter, Facebook, Google or even Microsoft GitHub.

I have chosen to use a more old school method of spam prevention.

To post a comment here, you need to:

¹ Such as Thunderbird, Pan, slrn or Gnus (part of Emacs).