Jump to content

JSViz IFrame sandbox properties


Colt Street

Recommended Posts

Chrome is now requiring that IFrames have the sandbox property: "allow-downloads" to be added if one wants to use downloads from the JSVis javascript code.

Is there a way to add properties to the IFame container for JSVis visualizations in Spotfire

If not can Spotfire add that as default

Link to comment
Share on other sites

  • 2 weeks later...

Can you try the following in your code,

function renderCore ( sfdata )

{

allowModals (); ...

}function allowModals ()

{

for ( const i of parent.document.getElementsByTagName('iframe'))

{

if (!i.sandbox.supports('allow-modals'))

{

console.warn("Your browser doesn't support the 'allow-modals' attribute :(");

break;

}

if (i.sandbox.contains('allow-modals')) continue;

console.info(i, "doesn't allow modals");

i.sandbox.add('allow-modals');

i.contentWindow.location.reload();

console.info(i, 'now allows modals');

}

}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...