I'd like to be able to embed certain file previews from SharePoint Online in another domain - in fact, I'd like to do it for 2 extra domains.

Is it possible to replace this header...

X-Frame-Options: SAMEORIGIN

with this one?

X-Frame-Options: ALLOW-FROM https://example.com/ https://example2.com/ 

Or is this just a limitation of SharePoint Online?

OneDrive and OneDrive for Business don't add the X-Frame-Options: SAMEORIGIN header, so I can embed from OneDrive. SharePoint Online is more restrictive.

  • 1
    Nope. This is defined in server-side code (even in SharePoint 2016).
    – user6024
    Commented Nov 9, 2016 at 16:46
  • So this means that its impossible to embed SharePoint Online files in a web page on a separate domain, right? That sucks.
    – dvdsmpsn
    Commented Nov 10, 2016 at 10:04

1 Answer 1


No. Microsoft has this locked down.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.