While loading cesium map giving errors in console.

Hi Cesium Dev Team,

When I am loading cesium map into my application, it is loading properly but in console logs showing following errors.

"include.preload.js:393 Blocked script execution in 'about:blank' because the document's frame is sandboxed and the 'allow-scripts' permission is not set."

I remember this issue is resolved already in one of the latest version. I am using 1.22.1V.

Could anyone help me on this.

Thanks,
Raghu.

1 Like

Try adding the "allow-scripts" flag in the viewer
Should look something like this for example
viewer.infoBox.frame.sandbox = "allow-same-origin allow-top-navigation allow-pointer-lock allow-popups allow-forms allow-scripts"

This solved that console printout

---Brock

Hi Brock,

Thanks for reply, I have used the above one but still i am getting the same.

Following is my code.

Var viewer = new Cesium.Viewer(this.options.id+"_map",
  {
     baseLayerPicker : false,
     fullscreenButton : false,
     homeButton : false,
     infoBox : true,
           ....
           ...
        });

viewer.infoBox.frame.sandbox = "allow-same-origin allow-top-navigation allow-pointer-lock allow-popups allow-forms allow-scripts";

Regards,
Raghu.

I noticed I am also getting the same message with chrome dev tools open

"Blocked script execution in 'about:blank' because the document's frame is sandboxed and the 'allow-scripts' permission is not set"

Loading the page http://cesiumjs.org/ with the selecting "Tap To Interact" generates the error.

Also the "Tap To Interact" button doesn't work if the https urls is hit

a mixed content error is generated

Do you have AdBlock Plus installed? Based on the information that Raghu posted, include.preload.js is https://hg.adblockplus.org/adblockpluschrome/file/25726c8c044f/include.preload.js#l393

This code injects JavaScript into every single page you visit, which I assume also includes the sandboxed iframe used by the InfoBox. Because it’s sandboxed, it is not allowed to execute scripts.

In any event, you can ignore this error, which doesn’t affect Cesium’s operation.

The HTTPS problem is indeed a bug on the website which is a separate issue.

AdBlock was definitely the cause with the
"Blocked script execution..." issue

thanks

i found that disable all the chrome extension, there are not any error log , enable vuejs devtool extension , the error log will display in console.