How to prevent DOMException in Firefox?


Using babylon.js throws errors in Firefox Browser.

Using the viewer (The Babylon.js Viewer - Babylon.js Documentation) gives me a DOMException: “The operation is insecure.”:

Using babylon.js via CDN gives SecurityError: The operation is insecure:

I need to disable the Enhanced Tracking Protection in Firefox. It is enabled by default. I would like to know if there is a chance to have my .glb-files showing up in Firefox Browser without the need to have the visitor of my website to disable the Enhanced Tracking Protection in his browser.

Is the viewer on the documentation throwing this exception, or your implementation?

It feels like some form of manifest blocking access to your domain. both calls to model load (an HTTP request) and indexDB access (for offline support) are blocked. It doesn’t seem to me like we can do something about it. Reading about the Enhanced Tracking Protection (Enhanced tracking protection in Firefox Preview | Firefox Preview Help), there is little to nothing we can do in code about it. This is a decision of the browser, and the user can white-list a page. I would wonder why the page is considered a tracker.

Indeed, the viewer example The Babylon.js Viewer - Babylon.js Documentation throws the error, too.

I was reading about Firefox. It is blocking unsecure calls more accurate than other browsers. Maybe for a good reason, maybe not? I cant judge this.
But I know that we have about 25% of our website visitors using Firefox, and all of them will not be able to see the 3D-content loaded with babylon by default. That hurts!

I have data protection on, and the site renders correctly -

, even in strict mode.

There is nothing we can do if firefox prevents running an XHR request. You, as the developer of the webpage, could make it run when a user interaction happens (for example - run the viewer only when a user clicks on it). This might ease up the security concerns.

I don’t know your browser settings, and I can’t quite say why it is blocked on your end. Might be the version of firefox you are using (thou I just checked with firefox nighly, and it rendered correctly).

1 Like

Thank you for your quick feedback. I am glad to see that it works on your system.
I tested now 2 systems:
Firefox 76.0.1 on Ubuntu 18.04.4: not working
Firefox 77.0 on Windows 10: working

So hopefully many visitors will be able to see the content by default… :relaxed:

I will test on more different systems and browsers and share my experience here. Or is there something like a compatibility chart for babylon and browsers already, somewhere in the docs? I missed it, if so.

Thank you very much for your help!

Firefox 76.0.1 on Ubuntu 18.04.4: not working :raised_hand:
Chromium 81.0.4044.138 on Ubuntu 18.04.4: working :ok_hand:
Firefox 68.9.0 on Android 8.1.0: working :ok_hand:
Chrome 83.0.4103.83 on Android 8.1.0: working :ok_hand:
Firefox 77.0 on Windows 10: working :ok_hand:
Chrome 83.0.4103.61 on Windows 10: working :ok_hand:
Edge 83.0.478.44 on Windows 10: working :ok_hand:
Internet Explorer 11.836.18362.0 on Windows 10: working :ok_hand: