Join the Webstudio community

Updated 3 weeks ago

Unable to put a Webstudio site within an iFrame on Webstudio

I have set it up here for testing - https://iframe-lfs9b.wstd.io/

There is a very specific use case where it would have to be inside an iFrame. I am unable to add an iFrame with the source set to another Webstudio website.
O
M
10 comments
Just recently implemented protection against clickjacking
An option to enable embedding in specific sites needs to be added yet https://github.com/webstudio-is/webstudio/issues/4748
I am assuming there is no short term workaround to this?
That's a bummer πŸ˜”
another option could be adding your proxy worker in cloudflare and set the header there, technically it should be only a few lines of code
I actually was working on setting up a worker to add a password to the website and then display it within an iFrame when I ran into this -
Here is the code: https://jsfiddle.net/7s4zt2hb/
Conceptually this would be the visual layout
Yeah, so you would need the worker in any case, all you need is to set the content-security-policy header, currently its "frame-ancestors 'self'" - which means no emebeddings, but you can either enable embeddings for all sites or define the specific parent url
Add a reply
Sign up and join the conversation on Discord