Astra Web Platform
Embed real web pages in Unity — a managed browser runtime with platform-native adapters (WebGL iframe, Windows WebView2, and scaffolded WKWebView / Android WebView / WebKitGTK), a JavaScript bridge, a security policy layer, profiles, and diagnostics. Add a component, set a URL, press Play.
AstraWebRuntime, BrowserManager, BrowserEngineRegistry) from code. The two paths coexist — the no-code auto-open defers to code when you drive the component yourself.⚡ Web page in 10 seconds
GameObject → Astra Web Platform → Astra Web View, set a URL, press Play.
🌐 One component
URL, engine dropdown, size, policy/profile asset slots, gated auto-open — all in the Inspector.
🧩 Per-platform engines
Automatic picks the best engine per build target; explicit choices map through a factory.
🔗 Bridge & policy
Typed request/response + streaming messages, gated by an allow-list security policy.
🔧 No-code tools
Scaffolding menu, custom inspectors with live engine summary, presets, JSON import/export.
⤓ Drop-in install
Import, open the Welcome window, add a component. Remove it and nothing is left behind.
Installation
Import once, open the Welcome window, add a component.
In
Window → Package Manager → My Assets, download and import Astra Web Platform. It lands at Assets/AstraWebPlatform/.On first import the Welcome / Help window appears with big buttons to open the docs, the demo scene, and create your first web view. Re-open it any time from
Tools → Astra Web Platform → Welcome.GameObject → Astra Web Platform → Astra Web View (or Add Component → Astra Web Platform → Astra Web View).In a player build the platform-native engine renders the page; in the Editor the Mock engine is used (expected). For Windows, the WebView2 Evergreen runtime must be installed.
Requirements
- Unity 6000.0 or newer.
- Windows player: the WebView2 Evergreen runtime (preinstalled on Windows 11; bundled with modern Edge).
- macOS / iOS / Linux / Android native adapters require their platform binaries — see the cross-platform build guide and Engines & Platforms.
What gets installed
Assets/AstraWebPlatform/
Runtime/ // Browser manager, engines, native adapters, bridge, policy,
// profiles, diagnostics, automation, the Astra Web View component
Editor/ // Welcome window, custom inspectors, scaffolding menu, Setup,
// Diagnostics, project validation
Welcome/ // interactive Getting Started scene (built in code at runtime)
Plugins/ // WebGL .jslib, Windows WebView2 DLL, iOS/Android sources
Demo/ // a guided, fully interactive showcase scene
Documentation/ // You are here
Tests/ // EditMode + PlayMode (run headless via Unity -runTests)Project
Quick Start (No Code)
A real web page in your scene without writing a line of code.
GameObject → Astra Web Platform → Astra Web View. A sample-populated object drops into the scene (URL https://example.com/, Engine Automatic, Open On Start).Type your URL. Leave Engine on Automatic to use the best engine for the platform, or pick a specific one. The inspector shows whether that engine is available in the current build target.
For a custom security policy/size, create
Assets → Create → Astra Web Platform → Settings and drag it into the Settings Asset slot. Without one, a sensible default policy that allows your typed URL is used.The page opens through the resolved engine. In a Windows player it renders via WebView2; in a WebGL build via the iframe adapter; in the Editor the Mock engine runs (no visible page, but the full pipeline executes).
SuppressAutoOpen() (or set Open On Start off) so the no-code auto-open does not run on top of your own OpenAsync() call. See Scripting API.How It Works
From a URL in the Inspector to a rendered page in one build pass.
- The Astra Web View component reads its serialized fields (URL, engine, size, policy/profile assets).
AstraBrowserEngineFactoryresolves the engine selection to a concreteIBrowserEngine(falling back to Mock when the requested engine is not available in the current build).- The
DefaultPolicyEvaluatorchecks the create + navigation against theBrowserPolicy(origins, bridge channels/types, payload size). BrowserManager.CreateAsynccreates the browser, initializes it, and navigates to the URL.- The platform native adapter (WebView2 / WebGL iframe / WKWebView / …) renders the page; the managed
IBrowserInstanceexposes navigate / evaluate / dispose.
Astra Web View Component
The single no-code component — every field is in the Inspector with a tooltip.
| Field | What it does |
|---|---|
| URL | The page to open. Allowed by the assigned Settings policy, or (with no Settings) a default that permits this exact URL plus local development. |
| Engine | Dropdown: Automatic, Mock, Windows WebView2, WebGL Iframe, Apple WebKit, Android WebView, Linux WebKitGTK, CEF Chromium. Automatic picks the best available engine per build. |
| Settings Asset | Optional. Supplies the security policy and default size. Assets → Create → Astra Web Platform → Settings. |
| Profile Asset | Optional. Supplies the profile id for cookie/storage isolation. |
| Width / Height | Used only when no Settings asset is assigned. |
| Rendering Mode | DocumentProxy (WebGL iframe), NativeOverlay (WebView2/WKWebView/Android), or as the engine requires. |
| Open On Start | No-code auto-open on Start. Skipped automatically when you drive the component from code. |
| Runtime Status Overlay | Optional small on-screen status label while learning. |
Engines & Platforms
One enum, one factory, the right engine per platform.
| Selection | Engine id | Status |
|---|---|---|
| Automatic | best available | Picks the platform-native engine, falls back to Mock |
| Mock | astra.mock | Always available (in-memory; renders nothing real) |
| WebGL Iframe | astra.webgl-iframe | Validated — renders a real cross-origin page in a WebGL build |
| Windows WebView2 | astra.webview2 | Validated — renders + reads back a real page in a Windows player |
| Apple WebKit | astra.webkit | Scaffolded (macOS/iOS/visionOS) — validate on Apple hardware |
| Android WebView | astra.android-webview | Scaffolded — validate on a device |
| Linux WebKitGTK | astra.webkitgtk | Scaffolded — build the .so, validate on Linux |
| CEF Chromium | astra.cef | Capability-gated (requires the ASTRA_CEF define + binary) |
!UNITY_EDITOR). In the Editor, Automatic and any native selection resolve to Mock so play-in-editor never throws — the real engine activates in the matching build.Editor Tools (No-Code)
Everything a non-coder needs is reachable by clicking — this is a headline capability.
GameObject → Astra Web Platform → Astra Web View drops a ready, sample-populated component into the scene with full Undo.
The Astra Web View inspector groups Setup vs Behavior, shows a live engine-availability summary, and has Open / Close / Create-asset buttons.
Assets → Create → Astra Web Platform → … for Settings, Browser Profile, Auth Provider, Automation Script, and Plugin Manifest.
Tools → Astra Web Platform → Setup creates default assets/samples and runs project validation; Diagnostics shows runtime events.
Unity -runTests for EditMode/PlayMode, and a project-validation method) so it can be gated in automation.Welcome & Getting Started
Two friendly front doors that get you productive in a minute.
Welcome window (Editor)
- Auto-opens once the first time the asset is in the project (suppressed in batch/CI).
- Big buttons: Open the interactive Welcome scene, Open Documentation, Open the Demo Scene, Create your first Astra Web View, Open Setup & Validation.
- A "Get started in 3 steps" list, requirements, and the support contact.
- Dismissible via the "Show this window on startup" toggle, and re-openable any time from
Tools → Astra Web Platform → Welcome.
Interactive Welcome scene
A playable, hands-on onboarding scene that walks you through the three steps to your first live web page — and lets you try it on the spot. Open it from the Welcome window's Open the interactive Welcome scene button, or generate it via Tools → Astra Web Platform → Create Welcome Scene (it lands at Assets/AstraWebPlatform/Welcome/Scenes/AstraWebPlatform_Welcome.unity).
- A left-hand stepper: Welcome → Add a Web View → Set URL & Engine → Press Play → Next steps, with Back / Next navigation.
- A live preview on the "Press Play" step: type a URL and it drives the real
Astra Web Viewcomponent, showing the resolved engine and the page'sdocument.title. In the Editor this resolves the Mock engine; a Windows/WebGL player renders the real page. - One-click Open Documentation and Contact Support throughout.
Assets & Presets
Configuration lives in ScriptableObjects you can create, share, and version.
| Asset | Purpose |
|---|---|
| Settings | Security policy (allowed origins, bridge channels/types, payload cap, local-HTTP) + default size. Custom inspector adds presets and JSON export/import. |
| Browser Profile | Profile id, display name, persistence mode, user agent — for cookie/storage isolation. |
| Auth Provider | OAuth/OIDC provider configuration for the auth workflows. |
| Automation Script | A sequence of browser/bridge commands for the automation runner. |
| Plugin Manifest | Declares optional native plugin packaging. |
Bridge & Policy
Talk to the page safely, behind an allow-list policy.
The BridgeBus carries typed request/response and chunked streaming messages between Unity and the page. Every message is evaluated by the DefaultPolicyEvaluator against the BrowserPolicy:
- Allowed origins — navigation and bridge origins must match (scheme/host/port, or a scheme prefix like
astra:). - Allowed bridge channels / types — an allow-list (
*permits all). - Max payload bytes — oversized messages are rejected.
- Local HTTP — opt-in for
http://localhost/127.0.0.1during development.
var policy = BrowserPolicy.AllowLocalDevelopment();
policy.AllowedOrigins.Add("https://example.com");
var options = new BrowserCreateOptions { InitialUrl = "https://example.com/", Policy = policy };C#
Profiles
Isolate cookies and storage per profile.
A Browser Profile asset (or a ProfileId in code) keys cookie and storage state. Assign one to the Astra Web View component's Profile Asset slot, or create profiles in code through AstraWebRuntime.Profiles. Persistence modes range from in-memory to file-backed.
Diagnostics & Automation
See what happened, and replay sequences.
- Diagnostics — every browser/bridge/policy event is recorded to a diagnostics sink. Open
Tools → Astra Web Platform → Diagnostics, or export a support bundle. - Automation — the automation runner executes a sequence of create/navigate/evaluate/bridge commands; author them as an Automation Script asset.
- Visual Scripting — browser and workflow units are provided for Unity Visual Scripting.
Scripting API
The code-first path — unchanged and fully supported.
// No-code component, driven from code (auto-open defers to you):
var view = gameObject.GetComponent<AstraWebViewComponent>();
view.SuppressAutoOpen();
await view.OpenAsync("https://example.com/");
// Or the raw runtime:
var engine = AstraBrowserEngineFactory.ResolveEngine(
AstraBrowserEngineSelection.Automatic, out var id, out _, out _);
var manager = new BrowserManager(engine, AstraWebRuntime.Diagnostics,
AstraWebRuntime.Profiles, new DefaultPolicyEvaluator(AstraWebRuntime.Diagnostics));
var browser = await manager.CreateAsync(new BrowserCreateOptions { InitialUrl = "https://example.com/" });
string title = await browser.EvaluateScriptAsync("document.title", default);C#
| Type | Role |
|---|---|
AstraWebViewComponent | No-code MonoBehaviour: OpenAsync, RebuildAsync, CloseAsync, SuppressAutoOpen, Browser, ResolvedEngineId. |
AstraBrowserEngineFactory | ResolveEngine / EngineIdFor / IsAvailable for the engine enum. |
BrowserManager | CreateAsync, DisposeAsync — lifecycle + policy + profiles. |
BrowserEngineRegistry | The full engine catalog and descriptors. |
IBrowserInstance | NavigateAsync, EvaluateScriptAsync, LoadHtmlAsync, DisposeAsync. |
Troubleshooting
The common bumps and their fixes.
The page does not open / "Navigation origin is not allowed"
The URL's origin is not permitted by the policy. With no Settings asset, the component auto-allows the exact URL you typed; if you assigned a Settings asset, add the origin to its Allowed Origins (or use the Allow Local Development preset for testing).
The engine shows "astra.mock" in the Editor
Expected. Native engines are gated to player builds. Build for the target platform (or use WebGL/Windows) to see the real engine. The Inspector's engine summary tells you what will be used.
Windows player shows nothing
Install the WebView2 Evergreen runtime (preinstalled on Windows 11; otherwise download it from Microsoft). Confirm AstraWebView2.dll is packaged under <Player>_Data/Plugins/x86_64/.
macOS / iOS / Linux / Android do not render
These adapters require their platform binaries. Build the native plugin per the cross-platform build guide and validate on the device; until then those engines resolve to Mock.
Console warnings about native toolchain
Project validation reports missing CMake / cl.exe / WebView2 SDK as warnings — they only matter when you build desktop native plugins yourself and do not affect using the prebuilt WebGL/Windows adapters.
FAQ
Do I need to write any code?
No. Add the Astra Web View component (or use the GameObject menu), set a URL, pick an engine, press Play. Code is fully supported but optional.
Will the no-code component override my code?
No. The auto-open is gated: it defers when you call SuppressAutoOpen()/OpenAsync() or turn off Open On Start.
Which platforms render real pages today?
WebGL and Windows are independently validated. The other adapters are build-ready scaffolding to be validated on their hardware.
Can I evaluate JavaScript / call into the page?
Yes — IBrowserInstance.EvaluateScriptAsync, plus the typed bridge for request/response and streaming messages.
Does removing the component change my project?
No. It is additive; nothing is written to disk on your behalf.
Support
Need help? We're here for you.
Get in Touch
Bug reports, feature requests, integration questions — reach out and we'll get back to you.
✉ szekipapa77@gmail.comWe typically respond within 24–48 hours.
- Check the Troubleshooting section
- Open Tools → Astra Web Platform → Diagnostics
- Confirm the Astra Web View component is on the object
- Check the Console for policy/engine messages
- Unity version (e.g.
6000.0.30f1) - Astra Web Platform version (v1.0)
- Target platform (WebGL / Windows / …) and engine selection
- The URL you're loading + any Console messages
Astra Web Platform v1.0 · Built for Unity 6000.0+ · WebGL + Windows native adapters validated
Support: szekipapa77@gmail.com