fix(browser): stop auto-approving Browser2 media/display-capture#512
Open
shaun0927 wants to merge 1 commit intorowboatlabs:devfrom
Open
fix(browser): stop auto-approving Browser2 media/display-capture#512shaun0927 wants to merge 1 commit intorowboatlabs:devfrom
shaun0927 wants to merge 1 commit intorowboatlabs:devfrom
Conversation
…missions Browser2 tabs should not inherit the app-wide media/display-capture auto-approval path. This change keeps the default session behavior intact while narrowing the embedded browser session to clipboard-only permissions and denying automatic display-source selection there. Constraint: Browser2 work is currently flowing through the dev branch and needs a minimal, low-risk patch Rejected: Remove session permission handling entirely | could break existing app-level capture flows outside Browser2 Confidence: high Scope-risk: narrow Reversibility: clean Directive: If Browser2 later needs media or display capture, add an explicit per-origin/user approval flow instead of widening the shared allowlist Tested: pnpm install; pnpm run deps; apps/main npm run build; source-backed permission validation JSON Not-tested: Manual interactive Electron permission prompt UX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a narrow follow-up to #507.
Browser2 tabs currently inherit the app-wide media / display-capture auto-approval path. That means embedded pages can receive automatic capture approval instead of going through an explicit consent boundary.
This patch keeps the existing app session behavior intact, but narrows the Browser2 session to clipboard-only permissions and returns an empty display-media response there.
Related issues
Changes
apps/x/apps/main/src/main.tsAPP_SESSION_PERMISSIONSandBROWSER_SESSION_PERMISSIONSconfigureSessionPermissions()so different sessions can have different permission policiesmedia/display-captureforsession.fromPartition(BROWSER_PARTITION){}from the display-media handler when the session does not explicitly allowdisplay-captureWhy this scope
I kept the patch intentionally small so it only restores an explicit consent boundary for Browser2. If Browser2 later needs capture features, a separate user-facing approval flow can be layered on top without widening the shared allowlist again.
Testing
cd apps/x && pnpm install && pnpm run depscd apps/main && npm run build{ "browserAllowed": ["clipboard-read", "clipboard-sanitized-write"], "browserMediaCheckAllowed": false, "browserDisplayCheckAllowed": false, "browserMediaRequestAllowed": false, "browserDisplayRequestAllowed": false, "browserDisplayResponse": {} }