Skip to content

docs: add Web Permissions guide and options reference (missing from #5567)#5592

Merged
leaanthony merged 5 commits into
masterfrom
docs/permissions-api
Jun 13, 2026
Merged

docs: add Web Permissions guide and options reference (missing from #5567)#5592
leaanthony merged 5 commits into
masterfrom
docs/permissions-api

Conversation

@leaanthony

@leaanthony leaanthony commented Jun 13, 2026

Copy link
Copy Markdown
Member

What's missing

PR #5567 shipped a cross-platform Permissions map for controlling camera, microphone, geolocation, notifications, and clipboard-read access from web content. No documentation was included.

What this adds

New page: Web Permissions

Full developer guide covering:

  • Quick-start example
  • PermissionType reference table (Microphone, Camera, Geolocation, Notifications, ClipboardRead)
  • Permission reference table (Default, Allow, Deny)
  • Per-platform behaviour — the critical stuff:
    • Linux/WebKitGTK: no native prompt, PermissionDefault allows media capture (the getUserMedia fix), denies other capabilities
    • Windows/WebView2: PermissionDefault shows native prompt; breaking change — when any Permissions entry is set, the old blanket SetGlobalPermission(Allow) is no longer applied
    • macOS/TCC: map has no effect, defers to system privacy framework
  • Common patterns: media app, deny-all kiosk, per-window policies, restoring pre-fix(v3): handle getUserMedia via a cross-platform Permissions map (Linux + Windows) #5567 Windows behaviour
  • Windows-specific WindowsWindow.Permissions override and evaluation order
  • Platform support matrix
  • Troubleshooting section

Updated: Window Options reference

  • Permissions field added to the WebviewWindowOptions struct summary
  • Dedicated ### Permissions section with type reference, platform callouts, and link to the full guide

Updated: Sidebar

Web Permissions entry added between Window Options and Multiple Windows.

Closes the documentation gap for #5567.

Summary by CodeRabbit

  • New Features

    • Added per-window webview permission controls for microphone, camera, geolocation, notifications, and clipboard with platform-aware behavior and explicit Windows evaluation order.
  • Documentation

    • New comprehensive permissions guide with examples, platform behavior notes (Linux, Windows, macOS), troubleshooting tips, and a platform support matrix.

PR #5567 added a cross-platform Permissions map to WebviewWindowOptions
but shipped with no documentation. This adds:

- New page: features/windows/permissions.mdx — full developer guide
  covering PermissionType/Permission API, per-platform behaviour
  (Linux WebKitGTK default-allow quirk, Windows prompt vs blanket-grant
  change, macOS TCC deferral), common patterns, Windows-specific override,
  and troubleshooting section

- Updated: features/windows/options.mdx — Permissions field added to
  the struct summary and a dedicated section with type reference and the
  Windows breaking-change callout

- Updated: astro.config.mjs sidebar — Web Permissions entry added
  between Window Options and Multiple Windows
Copilot AI review requested due to automatic review settings June 13, 2026 11:13
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

Adds documentation for WebviewWindowOptions.Permissions: a new permissions guide with platform behavior, examples, troubleshooting; updates the WebviewWindowOptions reference; and adds a sidebar link under Features → Windows.

Changes

Web Permissions Documentation

Layer / File(s) Summary
Permissions feature guide
docs/src/content/docs/features/windows/permissions.mdx
New MDX page documents the Permissions map on WebviewWindowOptions, defines PermissionType (microphone, camera, geolocation, notifications, clipboard read) and Permission (default/allow/deny), describes platform behavior for Linux/Windows/macOS, provides common patterns and examples, documents Windows-only Windows.Permissions override and evaluation order, includes a support matrix and troubleshooting guidance.
WebviewWindowOptions reference update
docs/src/content/docs/features/windows/options.mdx
Adds Permissions map[PermissionType]Permission field to WebviewWindowOptions and a "Permissions" subsection describing the field type, default, platform support, example map, supported constants, and Windows behavior (removes blanket auto-grant when map exists; unspecified capabilities fall through to native prompts).
Sidebar navigation wiring
docs/astro.config.mjs
Adds a "Permissions" navigation item under Features → Windows linking to the new permissions documentation page.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • wailsapp/wails#5567: Main PR implementing the cross-platform permissions policy feature for Linux (WebKitGTK) and Windows (WebView2) that this documentation describes.

Suggested labels

Documentation, Windows, MacOS, Linux, size:S

Suggested reviewers

  • Copilot

Poem

🐰 In docs I hop with ink so bright,
I map permissions, day and night,
From Windows prompts to Linux quirks,
I write the rules and tidy the perks,
A rabbit's note to guide your site.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is comprehensive and well-structured, covering what's missing, what is added (new page, updated references, sidebar changes), and the related issue. However, it does not follow the repository's required template with the 'Type of change' checkbox, 'How Has This Been Tested?' section, or 'Checklist' items. Fill in the PR template sections including Type of change (mark 'This change requires a documentation update'), testing details, and complete the checklist to match repository standards.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding Web Permissions documentation and options reference that was missing from PR #5567. It is clear, specific, and concise.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/permissions-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds missing documentation for the cross-platform Permissions map introduced in #5567, including a dedicated “Web Permissions” guide, updates to the Window Options reference, and a sidebar link so developers can discover the feature.

Changes:

  • Added new “Web Permissions” guide page with examples, platform behaviour notes, and troubleshooting.
  • Updated Window Options reference to document the Permissions field and link to the new guide.
  • Added “Web Permissions” to the Windows features sidebar navigation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
docs/src/content/docs/features/windows/permissions.mdx New guide page documenting the Permissions map, platform behaviour, examples, and troubleshooting.
docs/src/content/docs/features/windows/options.mdx Adds Permissions to the WebviewWindowOptions reference and links to the new guide.
docs/astro.config.mjs Adds the “Web Permissions” page to the sidebar navigation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/src/content/docs/features/windows/permissions.mdx Outdated
Comment on lines +60 to +64
| Policy | Media capture (camera/mic) | Other capabilities |
|---|---|---|
| `PermissionDefault` | **Allowed** (restores getUserMedia) | Denied |
| `PermissionAllow` | Allowed | Allowed |
| `PermissionDeny` | Denied | Denied |

### Media capture app (all platforms)

Grant camera and microphone, prompt for everything else:
Comment on lines +191 to +193
| Geolocation | ✅ | ✅ | TCC only |
| Notifications | ✅ | ✅ | TCC only |
| Clipboard Read | ✅ | ✅ | TCC only |
### Permissions

**Type:** `map[PermissionType]Permission`
**Default:** `nil` (platform default handling)
Comment on lines +699 to +703
**Permission values:**
- `PermissionDefault` (0) — platform's native handling: OS/WebView2 prompt on macOS/Windows; media capture allowed, others denied on Linux
- `PermissionAllow` (1) — grant without prompting
- `PermissionDeny` (2) — deny without prompting

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/src/content/docs/features/windows/permissions.mdx`:
- Line 24: Update the sentence "That's all. Camera and microphone requests from
that window's web content are granted without a browser prompt." to avoid
overgeneralizing: state that this prompt-free behavior applies to Windows and
Linux, and add a macOS caveat that the Permissions map currently has no effect
on macOS and TCC prompting still applies (or rephrase to say "on supported
platforms (Windows/Linux) ...; on macOS TCC prompting still applies"). Ensure
the revised wording appears in the same location in the permissions.mdx content.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8b8a6cd9-925a-42ff-bbad-38e095833b7f

📥 Commits

Reviewing files that changed from the base of the PR and between f085aa9 and ed10e22.

📒 Files selected for processing (3)
  • docs/astro.config.mjs
  • docs/src/content/docs/features/windows/options.mdx
  • docs/src/content/docs/features/windows/permissions.mdx

Comment thread docs/src/content/docs/features/windows/permissions.mdx Outdated
- Linux only handles camera/microphone; geolocation/notifications/clipboard
  remain unimplemented and always denied — table, matrix and patterns updated
- Removed implication that non-media capabilities can be allowed on Linux
- Added Linux-specific troubleshooting entry for unimplemented types
- Clarified PermissionAllow Linux caveat in options.mdx
@leaanthony

Copy link
Copy Markdown
Member Author

All Copilot review comments addressed in 488c361:

  1. Unused imports — already fixed in a prior commit; only Aside is imported now.
  2. Linux only handles camera/mic — confirmed via linux_cgo_gtk3.go:1778. The Linux table now splits camera/microphone from geolocation/notifications/clipboard and marks the latter as 'always denied / not yet implemented'.
  3. 'prompt' implication on Linux — media capture pattern no longer implies a prompt; says 'other capabilities remain denied' on Linux instead.
  4. Support matrix — geolocation/notifications/clipboard now show ❌ not yet on Linux.
  5. options.mdx PermissionDefault description — explicitly states camera/mic allowed on Linux, everything else denied.
  6. options.mdx PermissionAllow description — notes the Linux caveat (only camera/microphone; other types remain denied).

@leaanthony leaanthony merged commit 36c1550 into master Jun 13, 2026
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants