Jump to content

JSVis IFrame sandbox properties


Don Trimbur

Recommended Posts

Chrome is now requirind that IFrames have the sandbox property : "allow-downloads" to be added if one wants to use downlods 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 a default

 

example iframe:

Link to comment
Share on other sites

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...