Skip to content

Commit

Permalink
Remove sandbox option from voila preview iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
trungleduc committed May 22, 2024
1 parent c2f7560 commit 189b48e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions packages/jupyterlab-preview/src/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,14 @@ export class VoilaPreview extends DocumentWidget<IFrame, INotebookModel> {
constructor(options: VoilaPreview.IOptions) {
super({
...options,
content: new IFrame({
sandbox: [
'allow-same-origin',
'allow-scripts',
'allow-downloads',
'allow-modals',
'allow-popups'
]
})
content: new IFrame()
});

const iframe = this.content.node.querySelector('iframe');
if (iframe) {
iframe.removeAttribute('sandbox');
}

window.onmessage = (event: any) => {
//console.log("EVENT: ", event);
const level = event?.data?.level;
Expand Down

0 comments on commit 189b48e

Please sign in to comment.