Skip to content

Functional web browser for Unity without any issues or hassle.

License

Notifications You must be signed in to change notification settings

nopponaim603/UnityWebBrowser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity Web Browser

License Build Discord YouTube

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

Unity 2021.2.x

Install

  1. Open up the package manager via Windows -> Package Manager
  2. Click on the little + sign -> Add package from git URL...
  3. Type https://gitlab.com/Voltstro-Studios/WebBrowser/Package.git#2.x and add it
  4. Type https://gitlab.com/Voltstro-Studios/WebBrowser/Package.git#engine/cef/base and add it
  5. Type https://gitlab.com/Voltstro-Studios/WebBrowser/Package.git#engine/cef/win-x64 and add it (If you need Windows support)
  6. Type https://gitlab.com/Voltstro-Studios/WebBrowser/Package.git#engine/cef/linux-x64 and add it (If you need Linux support)
  7. 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
  1. Clone the repo with git clone --recursive https://github.com/Voltstro-Studios/UnityWebBrowser.git (Clone with sub-modules!)

  2. Run the src/setup-all.ps1 script 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.

  3. You can now open up the src/UnityWebBrowser.UnityProject project with Unity.

  4. 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

Click to expand!

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4

Authors

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

About

Functional web browser for Unity without any issues or hassle.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 94.0%
  • PowerShell 4.8%
  • Other 1.2%