main
John Lauer Publish 0.1.0 d8a45ab

Hydrogen auto-grants every webview permission

Hydrogen on Linux runs on WebKitGTK. Every webview it creates connects WebKit's permission-request signal and answers allow to every request: microphone, camera, clipboard, geolocation, notifications, media keys. So inside Hydrogen the user never sees a "this site wants to use your microphone / camera / clipboard / location" dialog (hydrogen-app/src/full_permissions.rs, linux_webkit).

The same module auto-confirms WebKit's native "Leave page?" (beforeunload) dialog, so reloading the editor never stalls on a modal. Other alert / confirm / prompt dialogs keep WebKit's default handling.

Why Hydrogen does this

Hydrogen is the user's trusted desktop app — they've already chosen to run it. Intermediate per-site Web permission prompts (especially the clipboard-paste dialog) are pure friction with no added safety here, since there's no untrusted third-party browsing context: the surfaces are Hydrogen's own panels and the user's own webview apps. So Hydrogen grants them all up front.

What this means for you when building webview apps

  • Don't instruct the user to "click Allow." There is no prompt — telling them to look for one is wrong and confusing. getUserMedia({ audio: true }), clipboard reads, geolocation, notifications all resolve without a dialog.
  • If a webview app gets no mic or camera data, the cause is not a denied prompt. Look at: no device present (arecord -l, v4l2-ctl --list-devices on the host), the device held by another app, PipeWire/PulseAudio routing, the page served from a non-secure context, or a code bug.
  • This is behavior baked into Hydrogen's webview host — it's not something the web page or the user configures.
  • The per-iframe allow attribute rewrite Hydrogen injects on its other platform is not applied on Linux yet; a deeply nested iframe with its own narrow allow list may still be limited by that list.

This auto-grant is only the low-level webview browser-permission layer. It is separate from the screen-share / microphone consent the AI itself requests when it wants to capture the user's screen or mic for a session — that flow is explicitly user-approved (the user sees and accepts an in-app consent UI). Don't conflate them: webview site permissions are silently allowed; the AI's capture/share request is a real, user-facing approval. See hydrogen-capture-share.

Third layer: Adom Bridge command approvals

When an Adom Bridge (ab) is attached to Hydrogen, gated ab commands (shell_execute, run_script, write_file, ...) are approved by ab, which mirrors the request into Hydrogen's in-app dialog; a click there is relayed to ab, first click on any surface wins. Hydrogen for Linux does not set ab up, so on a desktop without ab this layer does not appear.

  • Grants are HUMAN-ONLY by design. No API self-approves; /permission/resolve is de-escalation only. Never attempt to grant yourself permissions.
  • Requests fail closed if the human doesn't respond; the requester's stated reason is always shown attributed ("caller says: ..."), never as fact.
  • hydrogen-capture-share — the SEPARATE, user-approved screen-share / mic consent the AI requests
  • hydrogen-open-url — opening URLs/webview apps inside Hydrogen (where these permissions apply)
  • hydrogen-browser-picker: routing URLs to webviews vs the user's browsers
  • adom-bridge-permissions: ab's approval gate in full