datocms / plugins

Repository providing samples using the Plugins SDK
MIT License
33 stars 47 forks source link

[Web Previews] Side-by-side iframe reloads on every save and resets to "published" view #94

Closed fcisio closed 1 year ago

fcisio commented 1 year ago

Hi, I'm unsure if the issue comes from an update or my setup.

I do not have a "Content Security Policy" and the site previews in the sidebar as expected.

The issue comes up when I save or publish the record. The panel reloads and resets to the default "published" view.

Note: I have tried to add a "Content Security Policy" as per the README, thinking that could be the source of the issue, but that didn't work. The iframe could not connect anymore and was giving the error Refused to frame '<URL>' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' https://plugins-cdn.datocms.com".

Here is a video repro: https://github.com/datocms/plugins/assets/46095852/5256ee86-1bf9-4e65-a17f-36f3ab723e8d

marcelofinamorvieira commented 1 year ago

Hello @fcisio this is most likely an issue on your setup as i wasn't able to reproduce it :( Can you send us the URLs that you are returning to dato on the preview and published endpoint? as well as the snippet that you are using on the endpoint where you return those URLs? If you can't share that info publicly you can send it to us over at support@datocms.com

fcisio commented 1 year ago

Hi @marcelofinamorvieira thanks for the response. My project is private, so I have sent the information to the email address (the subject line is the title of this issue).

Thanks for taking the time to look into this.