
WRY is a cross-platform webview rendering library. This extension allows you to use the native webview in Godot to build browsers and GUIs with HTML, CSS and JavaScript.
Warning
This extension is a work in progress! Expect bugs, report issues, and feel free to contribute.
- π Use the native system native webview (no extra dependencies!)
- π Load website URLs and local
res://
files - 𧩠JavaScript β GDScript code integration
- π₯ Mouse/keyboard input events forwarding
Demo game UI available at "examples/character_creator_ui_demo".
You can download the extension directly on the Godot Asset Library or by navigating to the "AssetLib" tab in the editor and searching for "wry".
Alternatively, you can go to the Releases page, download the latest ZIP (not the source code) and import it manually into your project.
Platform | Support | Web engine |
---|---|---|
Windows (10, 11) | β Supported | WebView2 (Chromium) |
Mac (Apple Silicon) | β Supported | WebKit |
Linux | π§ Work in progress | WebKitGTK |
Android | β³ Planned | Android WebView (Chromium) |
iOS | β³ Planned | WebKit |
Browser/HTML5 | β³ Planned | β |
WebKitGTK is required for WRY to function on Linux. The package name may differ based on the operating system and Linux distribution.
WRY itself already has mobile support. Contributions to add Android/iOS support in this extension are welcome!
After installing the extension, you will now be able to see the WebView node inside Node β CanvasItem β Control
when creating a new node. You can edit it's properties and layout as you wish.
![]() |
![]() |
---|---|
"Create new node" window |
WebView inspector |
Godot and the webview can exchange messages with each other. This is useful for updating the UI data, or triggering game actions when interacting with the UI.
π‘ Example: you can send a
play
message on a HTML button click, then Godot can listen for that message and start the game.
Sending messages from Godot to the webview:
$WebView.post_message("Hello from Godot!")
Sending messages from JavaScript to Godot:
window.ipc.postMessage("Hello from JavaScript!");
Receiving messages in Godot using the ipc_message
signal:
func _on_web_view_ipc_message(message):
print("Just got a message from the webview: %s" % message)
Receiving messages in JavaScript using an event listener:
document.addEventListener("message", (event) => {
console.log("Just got a message from Godot:", event.detail);
});
You can also evaluate a JS script by using the eval
API:
# Log to the webview devtools
$WebView.eval("console.log(Math.PI)");
By using the interoperability API, you could even process asynchronous tasks with JavaScript, then get the result in GDScript later:
func _on_button_pressed():
$WebView.eval("
const resp = await fetch('https://httpbin.org/ip');
const data = await resp.json();
ipc.postMessage(JSON.stringify(data));
")
func _on_web_view_ipc_message(message):
var data = JSON.parse_string(message)
print("Your IP address is: %s" % data.origin)
- The webview is rendered directly within the window. This prevents rendering on 3D meshes and is always rendered on top of the game.
- Using the system's native webview can lead to platform inconsistencies, like how a site behaves differently in Chrome vs. Safari.
- This extension doesn't check dependencies, so it's up to you to ensure they're installed and handle the missing libraries.
Your help is most welcome regardless of form! Check out the CONTRIBUTING.md file for all ways you can contribute to the project. For example, suggest a new feature, report a problem/bug, submit a pull request, or simply use the project and comment your experience.
See the ROADMAP.md file for an idea of how the project should evolve.
The Godot WRY extension is licensed under MIT. WRY is licensed under Apache-2.0/MIT.
Below is a list of interesting similar projects:
- gdcef β Open-source, powered by Chromium
- Godot-HTML β Open-source, powered by Ultralight (WebKit)
- godot-webview β Commercial, powered by QT (Chromium)