TBackend
Bun

type

WebView.Backend

type Backend = 'webkit' | 'chrome' | { type: 'chrome'; url: string } | { argv: string[]; path: string; stderr: 'inherit' | 'ignore'; stdout: 'inherit' | 'ignore'; type: 'chrome'; url: false } | { stderr: 'inherit' | 'ignore'; stdout: 'inherit' | 'ignore'; type: 'webkit' }

Browser backend selection.

  • "webkit" (default): WKWebView. macOS only. Zero external dependencies — uses the system WebKit.framework.
  • "chrome": Chrome/Chromium via DevTools Protocol over --remote-debugging-pipe. Works anywhere Chrome is installed. Auto-detects the binary in standard locations; override with backend.path or the BUN_CHROME_PATH environment variable.

The object form lets you pass extra launch flags. Chrome switches are last-wins for duplicates, so argv can override the defaults.

Chrome is spawned once per process — the first new Bun.WebView() call's path/argv/dataStore.directory win; subsequent views reuse the same Chrome instance via Target.createTarget.

Default flags: --remote-debugging-pipe --headless --no-first-run --no-default-browser-check --disable-gpu --user-data-dir=<temp>.