embedding-api-v3-samples
embedding-api-v3-samples copied to clipboard
Add sandbox attribute to the iframe element
We would like to use your embed component within our application. The problem is that the iframe created internally by the Viz webcomponent doesn't have the sandbox
attribute restriction. More info https://web.dev/sandboxed-iframes/
We would like to have sandbox attribute with allow-scripts allow-same-origin
. It shouldn't break the reporting functionality, but it should be safer for use in other applications.
It should only be a one line change in your library:
this._iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin')