-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Outlook addin "Refused to display ?? in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'" #5224
Comments
Hi @DunhamGitHub, Thank you for reporting this. @exextoc, could you please take a look? |
Also, I'm going to move this to the office-js repo, where issue that aren't specific to samples are tracked. |
@DunhamGitHub Hey, thanks for reaching out. Could you please add more specific details of the scenario? Which platform and browser are you facing this issue in? From the description, the error message you're encountering — "Outlook add-in 'Refused to display ?? in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'" — indicates that the web page or resource you're trying to load within an Outlook add-in cannot be embedded in an iframe due to the X-Frame-Options HTTP header being set to SAMEORIGIN. This header is preventing the page from being displayed unless it is hosted on the same domain as the page trying to display it. To resolve this issue, you can adopt the Content-Security-Policy (CSP) header with frame-ancestors to define which domains are allowed to embed your page. For example, Add this header to your server response:
This will allow only your add-in (or the specified domain) to load content in an iframe. If you have multiple domains that need access, you can list them separated by spaces. |
I have set following in
I can load the Addin now. Does that give my whole environment the same protection as my previous setting |
Great to hear that you can load your addin now. Yes, using the You can read more here: CSP: frame-ancestors |
This could be happening because sometimes browsers cache CSP header. Try clearing cache or use the incognito window to test. |
Seems I had to add
|
URL of sample
URL linking to the sample that has the bug.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No problem loading contents of an external .html file
Screenshots
Actual behavior
If applicable, add screenshots to help explain your problem.
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: