Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ and restored-session fixes, refresh-all, and quality-of-life items.

### Fixed

- **macOS: WebUI password sessions now survive app restarts.** The restored
first tab uses WebKit's persistent cookie store instead of an ephemeral one,
while later tabs remain isolated and inherit only the already-authenticated
origin cookies before applying their own profile selector. This preserves
per-tab profile isolation without asking for the WebUI password on every
launch.
- **macOS: direct HTTP WebUI targets load again.** The app now allows plain-HTTP
content inside its embedded WebKit view for localhost, Tailscale, LAN, and SSH
forwards, while native Rust probes keep their normal TLS verification policy.
- **Wayland: huge empty space above the WebUI** (issue #80). The v0.6.8 fix
for the X11 gap (#67) passes physical child-webview coordinates to defeat
wry's bogus X11 DPI derivation — but it applied on ALL Linux, and on native
Expand Down
14 changes: 14 additions & 0 deletions scripts/test_macos_ats.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python3
"""Regression check: macOS WKWebView must be allowed to load HTTP WebUI targets."""
from pathlib import Path
import plistlib

plist_path = Path(__file__).resolve().parents[1] / "src-tauri" / "Info.plist"
if not plist_path.exists():
raise SystemExit(f"FAIL: missing {plist_path}")
with plist_path.open("rb") as fh:
data = plistlib.load(fh)
ats = data.get("NSAppTransportSecurity", {})
if ats.get("NSAllowsArbitraryLoadsInWebContent") is not True:
raise SystemExit("FAIL: NSAllowsArbitraryLoadsInWebContent must be true")
print("PASS: macOS WKWebView HTTP loads are enabled")
18 changes: 14 additions & 4 deletions src-tauri/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSMicrophoneUsageDescription</key>
<string>Hermes WebUI Desktop needs microphone access for voice input in the Hermes web UI.</string>
<key>NSCameraUsageDescription</key>
<string>Hermes WebUI Desktop needs camera access if the Hermes web UI requests it.</string>
<!-- The desktop shell explicitly supports plain-http WebUI targets on
localhost, Tailscale, LAN, and SSH forwards. Scope the ATS exception to
embedded web content; native Rust HTTP probes keep normal TLS policy. -->
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>Hermes WebUI Desktop needs camera access if the Hermes web UI requests it.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Hermes WebUI Desktop needs microphone access for voice input in the Hermes web UI.</string>
</dict>
</plist>
12 changes: 5 additions & 7 deletions src-tauri/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
//!
//! Restoration re-seeds each tab's `hermes_profile` cookie so it reopens on the
//! same profile (the per-tab profile isolation of v0.3.7/v0.3.8). Only that
//! non-sensitive profile *selector* is persisted — never auth/login/session
//! cookies — so an authenticated server simply re-prompts for login after a
//! restart. The cookie is reconstructed host-only + HttpOnly + Path=/ to match
//! how the WebUI sets it.
//! non-sensitive profile *selector* is written to the session blob. On macOS,
//! the first restored view reuses WebKit's persistent cookie store and later
//! isolated views inherit same-origin cookies from it in memory, so authentication
//! survives restarts without persisting login tokens in this JSON state.

use crate::state::AppState;
use crate::{prefs, strip};
Expand Down Expand Up @@ -220,9 +220,7 @@ pub fn maybe_restore(app: &AppHandle) -> bool {
}
} else {
#[cfg(target_os = "macos")]
for sw in &saved.windows {
crate::windows::restore_macos_window(app, sw);
}
crate::windows::restore_macos_windows(app, &saved.windows);
}
state.restoring.store(false, Ordering::SeqCst);
// Guard against a total restore failure leaving the app with zero windows
Expand Down
Loading