1

I have a Unity project built as HTML5. I can see it perfectly within Firefox, Edge and IExplorer 11. I would like to open it within a web viewer control in a Windows Form application in Visual Studio 2015 (Visual Basic). I tried with the basic webbrowser control, then with the webview (in UWP), then with awesonium, and finally with DotNetBrowser. None of them allowed me to see the html5 page, all showing the error "Your browser does not support WebGL". I also set the registry entries for the user agent to be "11001" (IE11) and "12001" (Edge).

Do you know if there is any control that renders correctly the HTML5 project from Unity, or if there is a particular setting to be done?

Daahrien
  • 10,190
  • 6
  • 39
  • 71

1 Answers1

0

DotNetBrowser is based on the Chromium engine. The Chromium engine denies loading the local files by default and the Unity application cannot be loaded. To avoid this, you need to set the "--disable-web-security" and "--allow-file-access-from-files" Chromium switches.

The following source code demonstrates how to do this:

BrowserPreferences.SetChromiumSwitches("--disable-web-security", "--allow-file-access-from-files");

If these switches are applied the Unity application can be successfully loaded in DotNetBrowser.

For more information related to the Chromium switches please refer the following article: https://dotnetbrowser.support.teamdev.com/support/solutions/articles/9000110017-chromium-switches

Eugene Yakush
  • 259
  • 4
  • 6