docs: adds live preview csp troubleshooting tips (#6655)

This commit is contained in:
Jacob Fletcher
2024-06-06 10:59:34 -04:00
committed by GitHub
parent 5722c530a1
commit b95e25e937
2 changed files with 16 additions and 0 deletions

View File

@@ -282,3 +282,11 @@ const { data } = useLivePreview<PageType>({
depth: 1, // Ensure this matches the depth of your initial request
})
```
### Iframe refuses to connect
If your front-end application has set a [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) (CSP) that blocks the Admin Panel from loading your front-end application, the iframe will not be able to load your site. To resolve this, you can whitelist the Admin Panel's domain in your CSP by setting the `frame-ancestors` directive:
```plaintext
frame-ancestors: "self" localhost:* https://your-site.com;
```

View File

@@ -173,3 +173,11 @@ If you are noticing that updates feel less snappy than client-side Live Preview
},
}
```
### Iframe refuses to connect
If your front-end application has set a [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) (CSP) that blocks the Admin Panel from loading your front-end application, the iframe will not be able to load your site. To resolve this, you can whitelist the Admin Panel's domain in your CSP by setting the `frame-ancestors` directive:
```plaintext
frame-ancestors: "self" localhost:* https://your-site.com;
```