Take the community feedback survey now.
Take the community feedback survey now.
Hi!
This one comes from TinyMCE rather than Optimizely. Starting with TinyMCE 6.8.1, there’s a new option called sandbox_iframes that adds a sandbox="" attribute to iframes for security reasons. Since TinyMCE 7.0.0 (which is what’s included in EPiServer.CMS.TinyMce v5.0+), this option is turned on by default. That’s why your iframe keeps resetting to sandbox="" even if you edit it manually in the source code or media dialog.
TinyMCE now has a whitelist option called sandbox_iframes_exclusions. By adding your own domain to this list, TinyMCE will stop applying the sandbox attribute to your iframe.
In your TinyMCE settings, just extend the default exclusions list to include your own domain:
If you prefer, you can also set:
.AddSetting("sandbox_iframes", false)
This turns off iframe sandboxing entirely. It works, but it’s less secure since it removes protection against potentially harmful iframes.
Another option is to configure TinyMCE settings per property/editor instance instead of globally. That way, you could allow sandboxing in most places but disable it (or exclude your domain) only where it’s really needed.
Hope that helps!
Hi!
We are having an embedded video in TinyMCE that is rendered as an iframe, but we get an error:
I edit the iframe in TinyMCE source code or in the media dialog and I add sandbox="allow-scripts", but when I close the dialog and opens it again it still says sandbox="". How can I get passed this? Is it TinyMCE or Optimizely that is clearing the sandbox property?
Thanks!
/Kristoffer