docs: add Web Permissions guide and options reference (missing from #5567)#5592
Conversation
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
|
Caution Review failedPull request was closed or merged during review WalkthroughAdds 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. ChangesWeb Permissions Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
Permissionsfield 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.
| | 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: |
| | Geolocation | ✅ | ✅ | TCC only | | ||
| | Notifications | ✅ | ✅ | TCC only | | ||
| | Clipboard Read | ✅ | ✅ | TCC only | |
| ### Permissions | ||
|
|
||
| **Type:** `map[PermissionType]Permission` | ||
| **Default:** `nil` (platform default handling) |
| **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 | ||
|
|
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
docs/astro.config.mjsdocs/src/content/docs/features/windows/options.mdxdocs/src/content/docs/features/windows/permissions.mdx
- 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
|
All Copilot review comments addressed in 488c361:
|
What's missing
PR #5567 shipped a cross-platform
Permissionsmap 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:
PermissionTypereference table (Microphone, Camera, Geolocation, Notifications, ClipboardRead)Permissionreference table (Default, Allow, Deny)PermissionDefaultallows media capture (the getUserMedia fix), denies other capabilitiesPermissionDefaultshows native prompt; breaking change — when anyPermissionsentry is set, the old blanketSetGlobalPermission(Allow)is no longer appliedWindowsWindow.Permissionsoverride and evaluation orderUpdated: Window Options reference
Permissionsfield added to theWebviewWindowOptionsstruct summary### Permissionssection with type reference, platform callouts, and link to the full guideUpdated: Sidebar
Web Permissions entry added between Window Options and Multiple Windows.
Closes the documentation gap for #5567.
Summary by CodeRabbit
New Features
Documentation