Repository navigation
v1.7
What's New
`serveFromDisk()` — Native file serving, no HTTP server
Serve your frontend build directly from disk using platform-native URI schemes. No ports, no firewall prompts, no extra processes — works on consumer PCs out of the box.
```php
$webview->serveFromDisk(DIR . '/frontend/dist');
```
| Platform | Mechanism | URL |
|---|---|---|
| Linux | WebKitGTK `phpgui://` URI scheme | `phpgui://app/index.html` |
| Windows | WebView2 virtual host | `https://phpgui.localhost/\` |
| macOS | `loadFileURL:allowingReadAccessToURL:` | `file://…/index.html` |
Includes SPA router fallback on Linux (unknown paths serve `index.html`).
`serveVite()` — Dev/prod auto-detection
```php
$webview->serveVite(DIR . '/frontend/dist');
```
`enableFetchProxy()` — Transparent CORS bypass
```php
$webview->enableFetchProxy();
```
`onServeDirReady()` — Know the effective URL
```php
$webview->onServeDirReady(function(string $url) {
echo "Serving at: $url\n";
});
```
Bug Fixes
- Linux: Path traversal hardening — `g_serve_dir` normalized with trailing `/` so `/srv/app-evil/` cannot match `/srv/app/`
- Linux: `phpgui://` scheme registered only once per process (idempotency guard)
- Linux: Fixed double-slash in asset file paths
- Windows: `SetVirtualHostNameToFolderMapping` failures now emit a descriptive error to PHP instead of silently loading nothing
- macOS: Replaced `webview_navigate("file://...")` with `loadFileURL:allowingReadAccessToURL:` — fixes asset 404s in multi-file SPAs
- macOS: Installed `WKUIDelegate` so `alert()`, `confirm()`, and `prompt()` show native `NSAlert` panels
Pre-built Binaries
- `webview_helper_linux_x86_64` — rebuilt with all v1.7 fixes
- macOS and Windows binaries: CI rebuild pending — use v1.6 binaries in the meantime