Edge/IE Issue [Kml, Infobox, Link to Page with jQuery]

Hello
I have a Kml file that uses Html to render a nice looking pop-up. Inside the window I have a link, that when clicked, takes you to another .aspx page in a new window (still on the same site) that displays a jQuery slide show.

Everything is working fine in Chrome/Safari/Firefox, but for some reason, when the link in the infobox is clicked in Edge/IE (v11), the jQuery on the landing page never runs, and thus the slide show is broken. I can copy/paste that same link into a new Edge tab, and everything works ok. It's probably something to do with the sandbox, but I can't figure it out.

I've made a simple repro below (I've stripped out everything else from the Kml and left just the link). You can modify the links to script files, the Kml location, etc.

Thanks for any assistance you can provide and I'm happy to provide any more details if needed.

Hi there,

I’m not sure why only Edge/IE would have issues with this – try adding this line:

//Since we are controlling what gets put into the iframe, disable sandboxing.
//This is needed to allow links that open in new windows to use JavaScript.
viewer.infoBox.frame.removeAttribute('sandbox');

Hope that helps,

  • Rachel

Thanks for the reply Rachel. I did try that option but it produced the same results.

Oddly enough, I went into the cesium.js file and completely removed the part where the sandbox and its default attributes are declared. After that, everything started working.

I compared the DOM, both with the removeAttribute line you provided and with it removed from the .js file. Both appear to be identical, so I'm not sure why one is giving me a different behavior.

I was also able to achieve my desired behavior after removing the sandbox line from the .js file and then adding it back in my declaration (frame.setAttribute). I compared that with the sandbox line added back to the .js file, and again, the DOM looked to be the same in both cases. The behavior was different for me though.

I guess at minimum, I do have a workaround for my situation.

Nicola, I've encountered the same problem (I can't run scripts in the Cesium infoBox when using Microsoft Edge or Microsoft Internet Explorer). You mentioned that you, "completely removed the part where the sandbox and its default attributes are declared" in cesium.js. Could you share what you removed? The only referent to "sandbox" that I see in cesium.js is, 'sandbox", "allow-same-origin allow-popups allow-forms")'. Is that what you removed? Also, do you still call, ' viewer.infoBox.frame.setAttribute('sandbox', 'allow-same-origin allow-popups allow-scripts allow-modals');'

Thanks!