Repository navigation
Closed
Labels
Description
Context
WebView exists on every backend, and docs/roadmap.md already lists what is still missing around it. Taken together, the gaps rule out the most common reason a desktop tool embeds a browser at all: showing a page the app also has to understand, serve and save from.
The rows, as the roadmap has them:
- script results from web views (
Evaluatereturning the script's result or its error) — Script results from web views - downloads (macOS saves them through
WebConfig.DownloadDir; Windows and Linux save nothing) — Web view downloads elsewhere - request headers and cookies a load carries,
Incognitokeeping website data in memory, an app serving URL schemes of its own, loading a page from the app's own files on macOS, andEnvreporting where the platform shows no web view — More of a web view's loads - trusted input (
Ref.SendInputreaches the page as trusted input on macOS only) — Trusted web input elsewhere
Why these four, together
They are the same feature seen from four sides: an embedded browser the app can drive.
- Evaluate is how an app reads a page it shows (a login that finished, a value in a local dashboard, a token the docs page exposes) without shipping a second parser.
- Downloads are how a user gets a file out of a page the app opened; on Windows and Linux a link that downloads currently does nothing, which reads as a bug, not a missing feature.
- Request headers and custom schemes are how an app serves its own content (
app://settings/index.html) and reaches an authenticated origin without opening a local TCP port and hoping it is not exposed. - Trusted input is what makes a page's
isTrustedhandlers and its user-activation paths work, which a "click this in the page" button needs.
Proposed scope
Ref.Evaluate(js string, done func(result any, err error))on every backend with a web view, answering JSON or an error, with the same timeout the other ref commands have.WebConfig.DownloadDirhonored on Windows (WebView2'sDownloadStarting) and Linux (WebKitGTK'sdownload-started), reporting start, bytes and end as Apple's do.WebConfig.Headers,WebConfig.Incognito, and aServeScheme(scheme string, handler func(url string) []byte)the app registers, soWebConfig.Sourcecan beapp://….Env.HasWebViewreports where the platform has none (already the roadmap's 5th row).Ref.SendInputon Windows (WebView2'sSendMouseInputand key messages), Linux and iOS, or an explicitEnv.CanSendInputso an app hides a button it cannot honor.
Acceptance
-
Evaluatereturns a number, a string, an object andnilfrom all three desktops and the web, and an error (not a panic) for a script that throws. - A page with
<a download>reachesOnDownloadon Windows and Linux, writes under the app's data directory, and reports its bytes. - A page served by
app://loads on all three desktops with its assets, and a navigation to another host is still refused asWebConfig.Navigablesays. -
Incognitoleaves no entry in the platform's website data store after the view is destroyed (checked with the platform's own inspector or a second view that reads storage). -
SendInputproducesisTrustedevents and user activation where it is supported, andEnv.CanSendInputis false where it is not. - The gallery's WebView demo exercises each of these, and
docs/architecture/native-views.mdrecords the per-target matrix.
Note
If ServeScheme is too large a step, WebConfig.Headers and downloads alone already remove most of the workarounds apps write today; they are worth landing first.
Activity
houko commentedon Nov 14, 2026
The current tree already has
Ref.Evaluate,OnDownloadplumbing,Ref.SendInput, navigation restrictions and per-target web-view event bridges. The acceptance gaps remain Windows/Linux download backends, request headers, incognito storage, app-owned custom schemes, and trusted input parity on the unsupported targets; no complete implementation is claimed yet.houko commentedon Nov 14, 2026
Draft PR #76 adds the Linux WebKitGTK download backend: now chooses the app-owned downloads// path, reports started/finished/failed events and bytes, and cancels downloads when no handler is configured. Windows and Android downloads plus headers, custom schemes, incognito storage and trusted-input parity remain open for follow-up slices.
houko commentedon Nov 14, 2026
Correction to the previous comment: the Linux WebKitGTK backend now makes the existing OnDownload callback choose the app-owned downloads// path, reports started/finished/failed events and bytes, and cancels downloads when no handler is configured. Windows and Android downloads plus headers, custom schemes, incognito storage and trusted-input parity remain open for follow-up slices.
houko commentedon Nov 14, 2026
Draft PR #76 now adds
WebView.Incognito: Apple uses WKWebView\x27s non-persistent data store, Linux uses an ephemeral WebKitGTK network session, Windows uses WebView2 in-private controller options, and Android disables cache, form saving and DOM storage. Custom schemes and trusted-input parity remain open.houko commentedon Nov 14, 2026
Correction: Draft PR #76 uses WKWebView non-persistent data on Apple; the other Incognito behavior is unchanged from the preceding update.
houko commentedon Nov 14, 2026
Draft PR #76 now adds
Scope.ServeSchemefor app-ownedapp://-style content on Apple (WKURLSchemeHandler), Windows (WebView2 resource requests) and Linux (WebKitGTK URI schemes). Restricted web views allow registered schemes while still refusing unapproved network hosts; Android and web remain explicitly unsupported for this bridge. Focused tests and desktop cross-compilation pass. Trusted-input parity and gallery coverage remain open.houko commentedon Nov 14, 2026
Draft PR #76 now also exposes
Env.CanSendInput: macOS reports true for its AppKit trusted-event bridge, while Windows, Linux and iOS report false andRef.SendInputsafely does nothing there until a native trusted-input bridge exists. Custom schemes, downloads, headers and incognito storage remain covered by the same Draft PR.houko commentedon Nov 14, 2026
Draft PR #76 now also exposes
Env.HasWebView: desktop, Android, web and non-tvOS Apple targets report a web view host, while tvOS reports false.Env.CanSendInputcontinues to advertise the only trusted-input bridge currently available (macOS). App-owned schemes, downloads, headers and incognito storage remain covered.houko commentedon Nov 14, 2026
The gallery's desktop WebView demo now loads its inline page through the app-owned
gallery://inline/index.htmlscheme (with HTML fallback on targets without the bridge), and configures headers plus incognito storage. Focused gallery checks pass; Draft PR #76 remains open.houko commentedon Nov 14, 2026
Draft PR #76 now also supports Apple
file:pages with directory-scoped read access, so a page can load neighboring assets without exposing files outside its folder. Path boundary tests and Apple cross-compilation pass; the PR remains Draft.houko commentedon Nov 14, 2026
Draft PR #76 adds a lightweight web-scheme MIME helper and removes the desktop backends' direct
net/httpdependency.TestMinimalAppLinksnow passes for Darwin, Windows, Linux, Android and Web; the full suite is 1798 passed, 1 failed, 12 skipped. The remainingTestSmallJSON/v2failure is caused by the local Go 1.26 toolchain excludingencoding/json/v2. PR #76 remains Draft.houko commentedon Nov 20, 2026
I re-audited #33 against the latest
origin/mainand the merged PR #76. The requested parity work is now present across the supported targets:Ref.Evaluateand its page/error handling, request headers, Incognito storage modes, app-owned schemes, navigation restrictions, downloads on macOS/Linux/Windows/Android, andEnv.HasWebView/Env.CanSendInputcapability reporting. The web-view tests cover the shared command and answer paths, native download and scheme behavior, and the platform-specific storage and navigation bridges.Trusted input remains intentionally unavailable on Windows, Linux, and iOS, where
Env.CanSendInputreports false andRef.SendInputsafely does nothing. Android's custom-scheme bridge is also outside the supported native-scheme matrix. Those limitations are recorded as separate roadmap follow-ups, so the original parity scope is complete and I am closing this issue.