1

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

enter image description here

Classic View

enter image description here

Issue

enter image description here

4
  • is the vf page thing not working in lightning ?
    – User6670
    Commented Feb 28, 2020 at 11:54
  • Vf pages are not supported by Lightning,So we have used to the lightning component Commented Mar 2, 2020 at 8:07
  • Hi @Gowthamsakthi - were you able to solve this issue?
    – vilelam
    Commented Jun 9, 2020 at 0:18
  • @vilelam No,We just downloaded the content Commented Jul 1, 2020 at 10:38

1 Answer 1

2

I hit a similar issue a couple days ago and was able to resolve it by adding data: to the CSP trusted sites.

1
  • Yes by adding data: to the CSP trusted sites solved my problem Commented Apr 29 at 13:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .