We have a requirement to show google drive contents(pdf,txt,docs,xlsx,images) in a modal in lightning experience.
Below is what I did so far:
1) Get the base64
content of the drive file using Apex Callout.
2) Set the iframe tag's url
attribute to the base64 content inside the Lightning Component.
When I view the modal in LEX, I get the below error:
Refused to frame '' because it violates the following Content Security Policy directive: "frame-src https: mailto:
But if I view the same lightning component inside a VFpage in Classic view using lightning-out, the modal shows the contents properly.
I tried adding the drive url : https://www.googleapis.com
in CSP and CORS setting but nothing works.
Lightning View
Classic View
Issue