19
Views
4
Comments
[Web Previewer] Not previewing xlsx files.
web-previewer
Web icon
Forge asset by Rui Mendes
Application Type
Traditional Web

Hi Team,

I am trying to preview Excel files, but I am encountering an error in the browser console:
"Refused to frame 'https://view.officeapps.live.com/' because it violates the following Content Security Policy directive: 'frame-src 'self' gap:'."
When the Content Security Policy is disabled, it works fine, but when enabled, it doesn't.
Could you please assist me in resolving this issue? 

2022-12-22 10-00-39
Beatriz Sabino

Hi Ranjeet,

What configurations do you have in Content Security Policy? I think you'll need to add the link you're trying to access https://view.officeapps.live.com/

2022-02-01 04-03-06
Ranjeet Singh
2022-12-22 10-00-39
Beatriz Sabino

And if you add just the link, that won't solve the issue? Also don't forget to delete the ";"

2025-07-22 10-30-27
Mandar Deshpande

Hi @Ranjeet Singh 

In your case, Excel preview fails because Office Online Viewer is loaded inside an iframe. 

CSP blocks view.officeapps.live.com. Disabling CSP works because iframe restrictions are removed.

The fix would be is to explicitly allow that domain in frame-src. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.