Files
Chris Tate 1c1fba0c0f fix(macos): place fresh windows correctly (#369)
* fix(macos): place fresh windows correctly

- Separate restored, explicit, and default window placement from persistence policy.
- Honor explicit origins and restore policy across platform seams and both macOS hosts.
- Add placement coverage, update docs, and remove obsolete example workarounds.

* fix(macos): honor window placement policies

* fix(macos): correct window placement policies

* fix(macos): preserve window placement contracts

* fix(runtime): restore secondary window placement
2026-08-16 19:06:29 -05:00
..
2026-06-25 10:53:58 -05:00

Browser Example

A no-build vanilla HTML/CSS/JS example that uses the layered WebViews API for isolated page content.

Run it from this directory:

zig build run

Or from the repository root:

zig build run-browser

The root command uses this example's system-WebView default unless you explicitly pass -Dweb-engine=chromium.

The frontend lives in frontend/ and is served directly as zero://app/index.html.

The page content runs in an isolated child WebView. Page WebViews do not receive window.zero; all navigation and sizing is controlled by the browser chrome through the handle returned by window.zero.webviews.create().

This example allows all navigation origins so it can browse arbitrary pages. Treat that as demo-only policy, not a production template. The chrome page keeps a strict CSP; arbitrary page navigation is controlled by the native navigation policy. Chromium/CEF builds are currently macOS-only; use the system WebView backend on Linux and Windows for this example. main WebView layering is best effort and may be ignored by a backend. Windows WebView support is still in progress and does not yet support the main WebView resizing this example uses.