Hosting babylon.js project on onion site

Hey guys,
I was looking for an easy to learn 3d web-library… I just found an amazing babylon.js project. Thanks to the developers who love it! And here is the question straight away. Has anyone tried to host a project on an onion web-site? Sample.html works perfectly in a browser on localhost, works well if run via ngrok. But if accessed via onion-browser, then it is just a white page even though javascrips are allowed, etc. (I mention that the page as a pure-html is accessible to confirm that there is access to it and all js-files hosted on cds are accessible) Any suggestions? Thanks.
Update: if I open this forum via onion-browser with existing snippets, it shows the following.

Did you check with the tor browser ppl ? I wonder if WebGL/WebGPU is allowed inside for privacy reasons ?

I do not know how to check it.

You could check here if you can access it? https://get.webgl.org

The issue seems to be on the browser side as they disable webgl by default. You should check on the TOR forum how to enable it ? Once you have it all working on WebGL we could check if there are any specific Babylon issue.

Nope. They did not disable it by default.

A little bit more of a research:
WebGL 2 is disabled.
But… I tried to convert the sample project to WebGL 1, and 2… and WebPBU or what ever is there, there is still “0Operation not supported” message.

So it might not be related to rendering but another feature of the page you are trying to load. It looks like you have an iframe there ?

Could you check on the TOR forum ? they could help let us know what the issue is ?

This is probably the issue - https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/40117

To prevent fingerprinting they disabled the video card query support.

I have found a solution, a work-around:

Here are steps for Firefox (original tor-browser), for other browsers steps are different in how to find the settings

  1. Go to about:config in your address bar.
  2. Search for webgl.force-enabled and make sure this preference is set to true.
    If it is currently set to false, click the toggle icon on the far right to change the value to true.
  3. Search for webgl.disabled and make sure this preference is set to false. If it is currently set to true, click the toggle icon on the far right to change the value to false.
  4. Restart Firefox to apply your new settings.

Also a Babylon project must be WEBGL2, other types just do not work… To my understanding to set WEBGL2, only canvas must be defined. As follows:

var createDefaultEngine = function() {
return new BABYLON.Engine(canvas, true,
{ preserveDrawingBuffer: true, stencil: true,
disableWebGL2Support: false}); };
1 Like