Adds a functional web browser to Unity without any issues or hassle. This project is capable of using any desired web engine you want, however for now we only have an engine using CEF.
Currently, 2.x is in development, for 1.x document, see the 1.6.3 release (latest).
Features
- Displays the web in your project via using a web browser engine.
- Full keyboard and mouse input
- API to interface with the web browser engine.
- Install as an Unity package
- Doesn't crash the entire editor on reload
- 100% free and open-source
- Multi-Platform Support
Getting Started
How does this work?
Getting an web engine to work in Unity is a pain, it usually ends up just crashing Unity. This project resolves that issue via running the browser engine in separate process and IPCing data between Unity and the engine.
Package Installation
Prerequisites
Install
- Open up the package manager via Windows -> Package Manager
- Click on the little + sign -> Add package from git URL...
- Type
https://gitlab.com/Voltstro-Studios/WebBrowser/Package.git#2.xand add it - Type
https://gitlab.com/Voltstro-Studios/WebBrowser/Package.git#engine/cef/baseand add it - Type
https://gitlab.com/Voltstro-Studios/WebBrowser/Package.git#engine/cef/win-x64and add it (If you need Windows support) - Type
https://gitlab.com/Voltstro-Studios/WebBrowser/Package.git#engine/cef/linux-x64and add it (If you need Linux support) - Unity will now download and install the package
Contributing
Please READ ALL OF THIS if you want to contribute or work on the project.
Prerequisites
Unity 2021.2.x
.NET 6 SDK
PowerShell (formally PowerShell Core)
NodeJS & Yarn
Git
-
Clone the repo with
git clone --recursive https://github.com/Voltstro-Studios/UnityWebBrowser.git(Clone with sub-modules!) -
Run the
src/setup-all.ps1script with PowerShell. Depending on your system, and your download speeds, this script could take upto a minute or longer. You only need to run this once. -
You can now open up the
src/UnityWebBrowser.UnityProjectproject with Unity. -
To build the Unity project as a player, open Unity Volt Builder by going to Tools -> Unity Volt Builder -> Volt Builder and clicking on 'Build Player'.
Operating System Support
What OS is supported will depend on the web engine you use.
CEF Engine
| OS | Supported | Notes |
|---|---|---|
| Windows | ✔ | Works natively |
| Linux | ✔ (Tested on Ubuntu 21.10) | Works natively |
| MacOS (Intel) | ✖ | Planned |
| MacOS (M1) | ✖ | No physical hardware to test or develop on |
Screenshots
Authors
- Voltstro - Initial work - Voltstro
License
This project is licensed under the MIT License - see the LICENSE file for details.
Credits
CEF Engine
- CEF - Underlying web engine.
- CefGlue - C# wrapper.
- CefUnitySample - CEF directly in Unity. Has crashing problems tho.
- unity_browser - (Orginally by Vitaly Chashin) CEF working in Unity using IPC, but the project is in a messy state.
- ChromiumGtk - Linux stuff with CEF



