ReviewOS

craft-native/craft

macOS: the standard Fullscreen API is unavailable in Craft's web view

#332
Closed chris opened this 9 days ago ·
9 days ago

Measured with Craft v0.0.105 (prebuilt darwin-arm64) on macOS 27.0, M3 Pro, using the Stacks probe harness (stacksjs/stacks#877, `buddy desktop:probe`).

In a Craft window, `Element.prototype.requestFullscreen` and `webkitRequestFullscreen` are both `undefined`, and `document.fullscreenEnabled` is undefined. Safari 27 on the same machine exposes the API. The WKWebView is created without `WKPreferences.elementFullscreenEnabled`, so engines that call the standard API (three.js, Babylon, PlayCanvas, Godot web exports) have a fullscreen button that does nothing. `craft.window.setFullscreen(true)` does work, but no third-party engine knows to call it.

Fix: enable `elementFullscreenEnabled` (public since macOS 12.3) on every web view Craft creates. WebKit still requires a user gesture, as in Safari.

Related, not fixed here: `requestAnimationFrame` is capped at 60 Hz on a 120 Hz ProMotion display. Safari behaves the same way, so this is WebKit's default page rendering rate rather than a Craft bug, but unlike Safari a Craft app has no way to opt out. Worth an opt-in if WebKit exposes one for WKWebView.

Sign in to comment on this issue.