Reputation: 19
I have a simple Chrome application. There is a base64 string. In it, I store a PDF file and I want to open this PDF file on new window
or iframe
.
I tried to create an iframe with src="data:application/pdf;base64,.."
.
After that, I get this error:
Refused to load plugin data from 'data:application/pdf;base64,JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3R…Q4RUU5MzdDRDQyM0RFNEI4MTkzNDU3MzIzMTM2OQo+PgpzdGFydHhyZWYKMjA0NTQKJSVFT0YK' because it violates the following Content Security Policy directive: "default-src 'self' chrome-extension-resource:". Note that 'object-src' was not explicitly set, so 'default-src' is used as a fallback.
Upvotes: 0
Views: 22674
Reputation: 21
try loading it as a new tab, then in the browser bar, you can paste this where "xxx" is equivalent to the base 64 code
data:application/pdf;base64,XXXX
Hope this helps too.
Upvotes: 1