tableau / embedding-api-v3-samples

Samples for the Tableau Embedding API V3.
MIT License
35 stars 13 forks source link

Add sandbox attribute to the iframe element #11

Closed kopecmi8 closed 4 months ago

kopecmi8 commented 1 year ago

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')
bcantoni commented 4 months ago

We have looked into this previously but don't have any plans to support it. Will mark this issue as closed to make that status clear.