# Cross-origin frame problems

**URL:** <https://forum.collaboraonline.com/t/cross-origin-frame-problems/3099>\
**Category:** User Support\
**Created:** [October 24, 2024, 3:15pm UTC](https://forum.collaboraonline.com/t/cross-origin-frame-problems/3099 "2024-10-24T15:15:33Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![darshan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.collaboraonline.com/darshan/32/2230_2.png) [@darshan](https://forum.collaboraonline.com/u/darshan)\
**Post date:** [October 28, 2024, 8:22am UTC](https://forum.collaboraonline.com/t/cross-origin-frame-problems/3099/4 "2024-10-28T08:22:55Z")

</div>

The `frame_ancestors` tag being marked as obsolete in the `coolwsd.xml` configuration file indicates that you should now use the `content_security_policy` (CSP) directive instead, which provides more granular control over security policies for content embedding. Since you’re still encountering issues even after modifying your configuration, let’s focus on implementing a correct `content_security_policy`.

### Possible solution:

1. **Remove the `frame_ancestors` Setting**  
Since `frame_ancestors` is obsolete, and you’re instructed to use `content_security_policy`, you can safely remove or comment out the `<frame_ancestors>` tag from the `coolwsd.xml`. The relevant portion should now look like this:

2. **Customizing `content_security_policy`**  
The `content_security_policy` tag accepts a string in CSP format. Here’s an example that should allow your custom app (running on `domain.ca`) to embed documents from your CODE instance (`docs.domain.ca`), and allow operations like file access via blobs, printing, and others:

3. **Ensure Correct Server Headers (Apache/Nginx)**  
You mentioned configuring CSP headers on the Apache side, but you should ensure that the headers set by Apache do not conflict with the `content_security_policy` in `coolwsd.xml`. Either remove them from Apache or set them only for specific routes to avoid overriding the CSP set by Collabora. You can add the CSP in Apache like this:

4. **Restart the Services**  
After applying these changes, restart both the `coolwsd` service and your web server (Apache or Nginx) to apply the updated configuration:

5. **Check Browser Dev Tools Again**  
After restarting, check your browser’s developer tools for any CSP-related errors. The headers should now reflect your changes, and the cross-origin errors related to iframe embedding or autofocusing should no longer appear.

### If Issues Persist

If after implementing this, you still see errors related to printing or iframe access:

- Ensure there are no `sandbox` attributes or policies applied to the iframe from your web app’s side.
- Verify that no other Apache/Nginx reverse proxy settings are interfering with the requests.
- Try to load the Collabora iframe directly and check if CSP issues arise only when embedded via your app or generally.

These steps should resolve the issue.

All the best ,  
Darshan

---

_[View the full topic](https://forum.collaboraonline.com/t/cross-origin-frame-problems/3099)._
