Skip to content

fix(browser): grant storage-access so requestStorageAccess() stops rejecting - #15481

Merged
brennanb2025 merged 7 commits into
mainfrom
brennanb2025/browser-storage-access-permission
Aug 19, 2026
Merged

brennanb2025 merged 7 commits into
mainfrom
brennanb2025/browser-storage-access-permission

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​38 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​37
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​15 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14

ELI5

Websites sometimes have to ask the browser "may I use my own cookies and storage here?" Orca answered "no" to every site, every time, with no way for the user to say otherwise — and each refusal also burned the click the site was holding. Orca now answers yes, matching what Chrome answers under the same cookie settings.

What Changed

  • storage-access added to AUTO_GRANTED_BROWSER_PERMISSIONS, with a comment tying the grant to the conditions it depends on.
  • top-level-storage-access deliberately left out, with a comment explaining why, and a test pinning the denial.
  • Tests pin the grant on both the default and isolated-profile install paths, and pin that the user-visible denial notice stops firing.

Why

AUTO_GRANTED_BROWSER_PERMISSIONS omitted storage-access, and installBrowserSessionPartitionPolicies denies anything not in that set. So every document.requestStorageAccess() in the embedded browser was refused, on every site. It was not silent: each refusal raised a user-facing notice — https://www.google.com asked for storage-access, and Orca denied it. — that the user had no way to act on. Worse, per the Storage Access API contract a rejection consumes the caller's transient activation, so Orca was also burning the user gesture the site was holding for whatever it meant to do next.

Note the shape of the bug: with no handler installed at all, Electron grants storage-access and defaults the check handler to true. Orca's deny-by-default installer had regressed this permission below Electron's own default.

The obvious objection is that granting it unconditionally is a privacy hole. For cookies, that objection assumes Orca blocks third-party cookies. It does not — nothing in src/ blocks or partitions third-party cookies and no Chromium switch touches cookie policy, so Electron's default applies to every browser partition. This was confirmed at runtime, not just from source: a cross-site iframe read its SameSite=None; Secure cookie and sent it on a credentialed fetch before requestStorageAccess() was ever called, in builds both with and without this change.

Being precise about the blast radius, since it is wider than cookies alone: third-party storage partitioning is enabled by default and is independent of cookie policy, and the same permission lifts it for localStorage, IndexedDB, CacheStorage and friends when a site asks via the dictionary form, requestStorageAccess({localStorage: true}) — Orca's handler sees only the permission name, never the call shape, so one grant covers both. So the frame does not "already have" everything this grants. It is still the right answer, because Chrome grants this same permission automatically under this same cookie policy — this is Chrome parity, not a widening past it. The comment records the conditions that would invalidate the reasoning.

Why top-level-storage-access stays denied

These are not one decision. requestStorageAccessFor() becomes a distinct TOP_LEVEL_STORAGE_ACCESS request, which Chromium gates on Related Website Sets membership rather than on cookie policy — a permissive cookie setting never grants it there, it only ever acts as a veto. Orca has no Related Website Sets source, so granting it symmetrically would invent a permissive answer to a question the platform answers restrictively. It stays denied, deliberately and visibly, and a test pins it.

Scope

This does not fix Google sign-in. That was a separate defect (#15216, fixed by #15221) where Orca cancelled its own navigations; sign-in completes end to end with this denial still in place, verified. This PR fixes an independent bug found while investigating that one.

Testing

Unit coverage drives the real handlers installed by installBrowserSessionPartitionPolicies, not the pure predicate:

  • storage-access granted through both the request and check handlers, on the default partition and on the isolated-profile path (createProfile), mirroring the pointerLock precedent — the default-partition suite does not reach that install path. Both verified red with the grant removed.
  • The user-visible symptom is pinned: the denial-notification list is asserted after the new requests, so a regression that re-denied storage-access fails. Verified red pre-fix, in isolation.
  • top-level-storage-access denied through both handlers. Green before and after by design — a pinning test, not evidence of this change, and not counted as such.

781/781 pass across src/main/browser; typecheck, oxlint and oxfmt clean.

Empirical verification (see QA comment below): in an isolated Orca dev instance, a genuinely cross-site iframe with a proven user gesture. Without the grant, requestStorageAccess() rejects with NotAllowedError and Orca raises its denial banner; with it, the promise resolves and no banner appears. This refutes the objection that Orca's handler is never consulted — the promise's resolution is live. It does not show that Chromium's cookie-unlocking plumbing is wired in Electron; that plumbing is moot here because third-party cookies already flow, which is exactly what the tripwire in the comment guards.

Platform

The policy is pure and has no platform-specific behaviour, so macOS, Windows and Linux behave identically; the only platform branch in the permission path is macOS TCC media handling, which returns before the allow-set is consulted. Permission handlers are installed per-session in the host process and are not part of any client/host wire contract, so there is no remote or mixed-version surface.

… cookies

AUTO_GRANTED_BROWSER_PERMISSIONS omitted storage-access, and the installed
permission handlers deny anything absent from that set, so every
document.requestStorageAccess() in the embedded browser was refused silently.

Granting it unconditionally looks like a privacy hole, but that objection
assumes Orca blocks third-party cookies. It does not: nothing blocks or
partitions them and no Chromium switch touches cookie policy, so Electron's
default applies. A cross-site frame therefore already reads and writes its
unpartitioned cookies at the network layer, and denying the permission grants
no protection - it only breaks sites that take the API's failure path. Chrome
resolves requestStorageAccess() without a prompt under the same cookie policy;
Electron has no such fast path and forwards to the embedder, so the embedder
supplies it. The comment records the condition that would invalidate this.

top-level-storage-access stays denied. requestStorageAccessFor() is a separate
platform decision: Chromium consults Related Website Sets and has no
third-party-cookie auto-grant, and Orca has no such data source, so granting it
would invent a permissive answer to a restrictive question. A test pins it.

Does not fix Google sign-in - that was #15216. Sign-in completes with this
denial in place; this is an independent defect found while investigating it.
@coderabbitai

coderabbitai Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 637c41ef-c2bd-44f0-8944-31e553525ee4

📥 Commits

Reviewing files that changed from the base of the PR and between 328ff7b and a8d0ee4.

📒 Files selected for processing (2)
  • src/main/browser/browser-session-permission-policy.ts
  • src/main/browser/browser-session-registry.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/browser/browser-session-registry.test.ts
  • src/main/browser/browser-session-permission-policy.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The changes clarify the rationale for storage-access and top-level-storage-access handling. Persistence tests assert direct storage permission outcomes and denial notifications. Isolated-partition tests verify that storage-access is granted while top-level-storage-access is denied. A permission-query test description now identifies pass-through behavior for non-intercepted permissions.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ⚠️ Warning The description references #15216 and #15221, but neither is identified as the issue resolved by this pull request. Add a linked issue using the required Fixes #<issue-number> entry for the defect addressed by this pull request.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly covers the problem, change, rationale, scope, testing, platform impact, and QA results, although some template headings are omitted.
Out of Scope Changes check ✅ Passed The changes are limited to the permission policy, explanatory comments, and regression tests, with Google sign-in explicitly excluded.
Title check ✅ Passed The title clearly identifies the main change: granting storage-access so requestStorageAccess() succeeds.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

The suite proved the handler answers true but never pinned the symptom users
actually reported — the "asked for storage-access, and Orca denied it" notice.
The existing notified-list assertion runs before the storage-access request, so
a regression that re-denied it would have left that list untouched. Assert the
list after the new requests instead; it goes red pre-fix with 'storage-access'
present.

Drop the two vi.waitFor wrappers around the same requests. The request handler
is synchronous for every non-media permission, so the wait bought nothing and
imposed vi.waitFor's 1000ms default on a suite that allows 30s. The waitFor
guarding the media path is genuinely async and stays.
…lated partitions

Trim the grant's comment to the facts that change a reader's decision. The
mechanics of how the request reaches the embedder already live in the commit
message; what belongs at the call site is why the answer is grant, and why the
check handler must agree with the request handler — Electron builds neither
Chrome's activation gate nor its auto-grant, so a disagreeing check pushes
compliant sites onto the gesture path, where a rejection consumes the gesture.

Move the top-level-storage-access note below the set. It sat after the last
element with no trailing comma, so it read as a commented-out entry, and any
permission appended at the natural insertion point landed above it.

Cover the isolated-partition install path. createProfile and hydrateFromPersisted
call installBrowserSessionPartitionPolicies separately from the default-partition
path the persistence suite drives, and the two previous changes to this set each
added a matching isolated test. Verified red without the grant.

Rename the anti-detection case that claimed storage-access has a native denied
state; it is granted in production now, and the case really pins pass-through.
@brennanb2025

Copy link
Copy Markdown
Contributor Author

QA: empirical answer — the storage-access grant is NOT inert in Electron 43

Rig: my own isolated Orca dev instance (Electron 43.1.0 / Chromium 150.0.7871.47) on this branch, driven only via Playwright + CDP. Two loopback HTTP servers give a genuinely cross-site pair — parent http://localhost:8991 embedding an iframe from http://127.0.0.1:8992 — loaded in Orca's embedded browser. requestStorageAccess() is invoked from a click handler inside the iframe, and the click is a real Input.dispatchMouseEvent hit-tested into the OOPIF (navigator.userActivation.isActive === true is recorded in-band, so the gesture is proven, not assumed).

Before/after are a matched pair: same rig, same tab, same steps — the only difference is 'storage-access' present or absent from AUTO_GRANTED_BROWSER_PERMISSIONS, with a full main-process rebuild between them (verified: the BEFORE bundle contains 0 occurrences of the string, the AFTER bundle 1).

Results

Probe (cross-site iframe) BEFORE (grant removed) AFTER (PR as committed)
navigator.userActivation.isActive true true
document.hasStorageAccess() (before) true true
navigator.permissions.query({name:'storage-access'}) denied granted
document.cookie (before) "sa_none=NONE_VALUE" "sa_none=NONE_VALUE"
credentialed fetch — cookie the server saw (before) "sa_none=NONE_VALUE" "sa_none=NONE_VALUE"
document.requestStorageAccess() REJECTED — NotAllowedError: requestStorageAccess not allowed RESOLVED
document.hasStorageAccess() (after) true true
document.cookie (after) "sa_none=NONE_VALUE" "sa_none=NONE_VALUE"
credentialed fetch — cookie the server saw (after) "sa_none=NONE_VALUE" "sa_none=NONE_VALUE"

Reported as two separate claims, per the ask:

(A) The promise resolves — CONFIRMED, and it is the PR that makes it resolve. Chromium reaches the embedder's answer for STORAGE_ACCESS_GRANT and acts on it: deny ⇒ NotAllowedError, grant ⇒ resolve. The "no-op in Electron due to missing backend support" claim does not hold for this Electron build. This alone is the behavior the PR is for — sites stop taking the API's failure path.

(B) Unpartitioned cookie access — already conferred, unchanged by the API either way. The cross-site iframe reads sa_none (SameSite=None; Secure, set earlier in a first-party visit to 127.0.0.1:8992) and sends it on a credentialed fetch before requestStorageAccess() is ever called, in BOTH builds. So the PR's stated premise — this session already allows unpartitioned third-party cookies, so gating the API protected nothing — is directly confirmed. The grant confers no new cookie access; it removes a gratuitous rejection.

Also verified

  • top-level-storage-access stays denied, as the PR's comment intends: from the top-level page, permissions.query({name:'top-level-storage-access', …}) → denied and document.requestStorageAccessFor(...) → NotAllowedError, with the PR code in place.
  • No gesture needed once granted. With the PR, a bare no-activation call also resolves (permissions.query already reports granted); without it, both the gestured and bare calls reject. Both variants were run; the table above is the gestured one.
  • The new unit test is genuinely red pre-fix. browser-session-registry.persistence.test.ts passes 17/17 on the branch, and fails (expected [ false ] to deeply equal [ true ] at the storage-access request-handler assertion) with 'storage-access' removed from the set.

Screenshots

BEFORE — the request is rejected, and Orca surfaces its own denial banner (asked for storage-access, and Orca denied it):

qa-15481-before-storage-access-denied.png

AFTER — same rig, PR code: granted / RESOLVED, no banner:

qa-15481-after-storage-access-granted.png

One incidental observation (pre-existing, not introduced here)

In the BEFORE shot the denial banner names http://localhost:8991 — the embedder's URL — even though the requester was the cross-site frame at http://127.0.0.1:8992. notifyPermissionDenied passes webContents.getURL(), which for a <webview> is the top-level document, so any sub-frame permission denial is attributed to the top-level site. Out of scope for this PR; noting it since this change is what stops that banner from firing for storage-access.

The revisit trigger was backwards. If Orca ever blocked third-party cookies the
grant would not become dangerous, it would become useless for cookies: Electron
builds no HostContentSettingsMap, so no STORAGE_ACCESS content setting is ever
written, and IsAllowedByStorageAccessGrant needs one. Point the tripwire at a
cookie or storage-partitioning control instead, which is the change that would
actually invalidate the reasoning.

The premise was also narrower than the grant. Third-party storage partitioning
is enabled by default and independent of cookie policy, and the same permission
lifts it for localStorage, IndexedDB, CacheStorage and friends via
StorageAccessHandle, which gates only on IsFullCookieAccessAllowed. So the frame
does not "already have" everything this grants. It stays the right answer
because Chrome grants the same permission under the same cookie policy, but the
comment should not claim a narrower blast radius than the change has.

@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: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e7af2272-5f7a-47a4-9c70-16a29a8acac1

📥 Commits

Reviewing files that changed from the base of the PR and between b80f060 and 3a6ea26.

📒 Files selected for processing (3)
  • src/main/browser/anti-detection.test.ts
  • src/main/browser/browser-session-permission-policy.ts
  • src/main/browser/browser-session-registry.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/browser/browser-session-permission-policy.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.

Comment on lines +262 to +266
requestHandler(guestWc, 'storage-access', callback, {})

expect(callback).toHaveBeenCalledWith(true)
expect(checkHandler(null, 'storage-access', '', {})).toBe(true)
expect(checkHandler(null, 'top-level-storage-access', '', {})).toBe(false)

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert top-level denial through the request handler.

The test checks top-level-storage-access only through checkHandler at Line 266. A regression that grants the request but keeps the check denied would pass. Call requestHandler with top-level-storage-access and assert that its callback receives false.

Proposed assertion
+    const deniedCallback = vi.fn()
+    requestHandler(guestWc, 'top-level-storage-access', deniedCallback, {})
+    expect(deniedCallback).toHaveBeenCalledWith(false)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
requestHandler(guestWc, 'storage-access', callback, {})
expect(callback).toHaveBeenCalledWith(true)
expect(checkHandler(null, 'storage-access', '', {})).toBe(true)
expect(checkHandler(null, 'top-level-storage-access', '', {})).toBe(false)
requestHandler(guestWc, 'storage-access', callback, {})
expect(callback).toHaveBeenCalledWith(true)
expect(checkHandler(null, 'storage-access', '', {})).toBe(true)
expect(checkHandler(null, 'top-level-storage-access', '', {})).toBe(false)
const deniedCallback = vi.fn()
requestHandler(guestWc, 'top-level-storage-access', deniedCallback, {})
expect(deniedCallback).toHaveBeenCalledWith(false)

@brennanb2025 brennanb2025 changed the title fix(browser): grant storage-access so cross-site frames can use their cookies fix(browser): grant storage-access so requestStorageAccess() stops rejecting Aug 19, 2026
Say what goes wrong, not just when to look. If Orca ever blocks third-party
cookies or gains a partitioning control, three separate gates stay shut in
Electron - the network-service grant check, the frame's trusted status, and the
STORAGE_ACCESS content setting that is never written - so the promise would
resolve while access stayed blocked. Sites follow the documented pattern of
reloading after a successful request, and on reload the check handler still
reports granted, so no gesture is needed to ask again. That loops.

Qualify the non-cookie clause: the no-arg call resolves undefined and touches
only cookies. It is the dictionary form that returns a handle, and since the
handler sees the permission name and never the call shape, one grant covers
both. Also give "check must agree with request" its reason.

Justify the isolated-partition test by the precedent it follows rather than by
a call-site divergence the shared mock cannot actually distinguish.
A live probe pinned down what the grant actually widens. The frame's ambient
window.localStorage and window.indexedDB stay partitioned before and after a
successful request; the unpartitioned view is reachable only through the handle
the dictionary form returns. Existing code in the frame is unaffected unless the
site explicitly calls through that handle, so say handle-scoped rather than
leaving a reader to assume the globals change.
@brennanb2025

brennanb2025 commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Review loop complete — 6 commits, 6 agents, no blockers found

Full review-until-clean loop plus empirical QA. Not merged — leaving that call to @BrennanKB5.

The objection that would have killed this PR, and why it failed

A reference implementation asserts Storage Access is a "no-op in Electron due to missing backend support." If true, this PR is cosmetic and should be superseded. It was tested rather than argued: an isolated Orca dev instance (Electron 43.1.0 / Chromium 150.0.7871.47), a genuinely cross-site iframe (127.0.0.1:8992 inside localhost:8991), a real CDP click for transient activation, and a full main-process rebuild between arms with each arm verified against the built bundle.

Probe Without the grant With the grant
permissions.query({name:'storage-access'}) denied granted
requestStorageAccess() NotAllowedError RESOLVED
requestStorageAccess({localStorage:true}) NotAllowedError RESOLVED — StorageAccessHandle
cross-site cookie on credentialed fetch, before any call sa_none=NONE_VALUE sa_none=NONE_VALUE

The grant is not inert. Chromium does act on the embedder's answer.

Two corrections the loop forced into the code

1. The revisit tripwire pointed the wrong way. It read "Revisit if Orca ever blocks third-party cookies", implying the grant would become dangerous. It would become useless — Electron never writes the STORAGE_ACCESS content setting the grant would need. Worse, the promise would then resolve while access stayed blocked, and since the check handler still reports granted on reload, a site following the documented reload-on-success pattern needs no gesture to re-ask. That loops. The tripwire now names that consequence.

2. The privacy premise was narrower than the grant. "The frame already has this access" is true for cookies — confirmed at runtime — and false for non-cookie storage. Third-party storage partitioning is on by default, independent of cookie policy. A follow-up probe measured it:

  • Ambient localStorage / indexedDB read null in both arms for a marker the same origin wrote at top level, while document.cookie showed the cookie ambiently. That asymmetry is the whole point.
  • With the grant, {all:true} returns a handle exposing sessionStorage, indexedDB, caches, OPFS, BroadcastChannel, SharedWorker, locks — reading the unpartitioned TOP_VALUE / TOP_IDB_VALUE.
  • Ambient globals stay partitioned before and after. The widening is handle-scoped, not global.

Both overloads request the same storage-access permission and the handler only ever sees the permission name, so granting the cookie case necessarily grants the storage-handle case. It remains the right answer — Chrome grants the same permission under the same cookie policy — but the code now says so plainly instead of claiming a smaller blast radius than it has.

Also corrected

  • Title. Was "…so cross-site frames can use their cookies". Cookies already flowed in both arms, so that causal claim was unsupported. The repo squash-merges, so the title is what lands in main.
  • Body overclaim. It said the QA "refutes a plausible objection that the grant might be inert." A resolving promise refutes only that Orca's handler is never consulted — not that Chromium's cookie plumbing is wired. It isn't. Narrowed.
  • The real shape of the bug: with no handler installed, Electron grants storage-access and defaults the check handler to true. Orca's deny-by-default installer had regressed this permission below Electron's own default — and per the API contract, every rejection also consumed the caller's transient activation.

Test work

  • Pinned the user-visible symptom: the denial-notification list is now asserted after the new requests. Verified red pre-fix in isolation (+ "storage-access").
  • Dropped two vi.waitFor wrappers around a synchronous handler that imposed a 1000 ms budget on a 30 s suite.
  • Added an isolated-partition test mirroring the pointerLock precedent; the default-partition suite does not reach that install path. Verified red without the grant.
  • Both mutation directions reproduced independently by two reviewers.

Gates: 781/781 across src/main/browser, all three typecheck projects exit 0, oxlint and oxfmt clean.

Deliberately not done

  • humanizePermission renders top-level-storage-access to users as a raw token. Pre-existing; this PR makes it the only storage denial a user can still hit. Wants its own ticket.
  • The permission-denied notice names the embedder's URL, not the requesting frame's, because notifyPermissionDenied passes webContents.getURL(). Every sub-frame denial is misattributed. Pre-existing, separate ticket.
  • Commit 1's message says requests were refused "silently" — false, and corrected in this body. Not rewritten because squash-merge discards it.

Addendum. A follow-up probe settled the non-cookie question empirically rather than by Chromium lore. In both arms the frame's ambient localStorage/indexedDB read null for a marker the same origin wrote at top level, while document.cookie showed the cookie ambiently. Without the grant, {localStorage:true} and {all:true} both reject; with it, both resolve a handle reading the unpartitioned TOP_VALUE/TOP_IDB_VALUE. Ambient globals stay partitioned either way — the widening is handle-scoped.

Note the two gates are distinct: cookie unlocking needs the STORAGE_ACCESS content setting Electron never writes, while handle creation is gated on IsFullCookieAccessAllowed and works today.

Closing readiness pass: PASS, efficacy SATISFIED, no P0/P1. An independent red/green in a throwaway worktree put both new tests red in both mutation directions — removing storage-access, and adding top-level-storage-access. 781/781 across src/main/browser, all typecheck projects exit 0, oxlint and oxfmt clean.

…re scope

"the isolated twin every other entry in this set already has" is false. Counting
occurrences in browser-session-registry.test.ts: fullscreen, clipboard-read and
clipboard-sanitized-write have none. Cite the pointerLock precedent the test
actually mirrors, which is the case directly above it.

Separate the two gates in the tripwire. The STORAGE_ACCESS content setting gates
cookies; the handle path is gated on IsFullCookieAccessAllowed instead, and a
live probe confirmed it works today. Saying "access stayed blocked" read as a
claim that the handle is backed by nothing, which contradicted the sentence
above it. Say cookie access, and say the handle survives.
@brennanb2025
brennanb2025 merged commit a3b3254 into main Aug 19, 2026
44 of 45 checks passed
brennanb2025 added a commit that referenced this pull request Aug 20, 2026
…notices (#15542)

* fix(browser): name the requesting frame and the permission in denial notices

Two defects in the same notice, both found by the review of #15481 and left out
of it deliberately.

The notice named the wrong site. setPermissionRequestHandler passed
webContents.getURL(), which is the top-level document, so a permission request
from a cross-origin sub-frame was attributed to the embedder. Every
PermissionRequest variant carries requestingUrl, so all three call sites now use
it and fall back to the top-level document only when it is absent.

The notice also showed raw Chromium permission names. humanizePermission mapped
two permissions and returned the raw token for the rest. That now matters more:
#15481 granted ordinary storage-access and left top-level-storage-access denied,
making it the storage denial a user can still hit - rendered as its raw token.

The default still returns the raw token. Inventing prose for a permission nobody
has seen is worse than showing its real name.

Does not change any permission verdict, and does not fix Google sign-in (#15221).

* fix(browser): keep permission denial attribution accurate

Capture fallback URLs before asynchronous media permission handling and treat opaque requesters as unknown rather than blaming the top-level page. Clarify permission descriptions and cover origin normalization, navigation races, and mapped copy.
AmethystLiang pushed a commit that referenced this pull request Aug 20, 2026
…jecting (#15481)

* fix(browser): grant storage-access so cross-site frames can use their cookies

AUTO_GRANTED_BROWSER_PERMISSIONS omitted storage-access, and the installed
permission handlers deny anything absent from that set, so every
document.requestStorageAccess() in the embedded browser was refused silently.

Granting it unconditionally looks like a privacy hole, but that objection
assumes Orca blocks third-party cookies. It does not: nothing blocks or
partitions them and no Chromium switch touches cookie policy, so Electron's
default applies. A cross-site frame therefore already reads and writes its
unpartitioned cookies at the network layer, and denying the permission grants
no protection - it only breaks sites that take the API's failure path. Chrome
resolves requestStorageAccess() without a prompt under the same cookie policy;
Electron has no such fast path and forwards to the embedder, so the embedder
supplies it. The comment records the condition that would invalidate this.

top-level-storage-access stays denied. requestStorageAccessFor() is a separate
platform decision: Chromium consults Related Website Sets and has no
third-party-cookie auto-grant, and Orca has no such data source, so granting it
would invent a permissive answer to a restrictive question. A test pins it.

Does not fix Google sign-in - that was #15216. Sign-in completes with this
denial in place; this is an independent defect found while investigating it.

* test(browser): pin the denial notice storage-access used to raise

The suite proved the handler answers true but never pinned the symptom users
actually reported — the "asked for storage-access, and Orca denied it" notice.
The existing notified-list assertion runs before the storage-access request, so
a regression that re-denied it would have left that list untouched. Assert the
list after the new requests instead; it goes red pre-fix with 'storage-access'
present.

Drop the two vi.waitFor wrappers around the same requests. The request handler
is synchronous for every non-media permission, so the wait bought nothing and
imposed vi.waitFor's 1000ms default on a suite that allows 30s. The waitFor
guarding the media path is genuinely async and stays.

* refactor(browser): tighten the storage-access rationale and cover isolated partitions

Trim the grant's comment to the facts that change a reader's decision. The
mechanics of how the request reaches the embedder already live in the commit
message; what belongs at the call site is why the answer is grant, and why the
check handler must agree with the request handler — Electron builds neither
Chrome's activation gate nor its auto-grant, so a disagreeing check pushes
compliant sites onto the gesture path, where a rejection consumes the gesture.

Move the top-level-storage-access note below the set. It sat after the last
element with no trailing comma, so it read as a commented-out entry, and any
permission appended at the natural insertion point landed above it.

Cover the isolated-partition install path. createProfile and hydrateFromPersisted
call installBrowserSessionPartitionPolicies separately from the default-partition
path the persistence suite drives, and the two previous changes to this set each
added a matching isolated test. Verified red without the grant.

Rename the anti-detection case that claimed storage-access has a native denied
state; it is granted in production now, and the case really pins pass-through.

* docs(browser): correct the storage-access rationale

The revisit trigger was backwards. If Orca ever blocked third-party cookies the
grant would not become dangerous, it would become useless for cookies: Electron
builds no HostContentSettingsMap, so no STORAGE_ACCESS content setting is ever
written, and IsAllowedByStorageAccessGrant needs one. Point the tripwire at a
cookie or storage-partitioning control instead, which is the change that would
actually invalidate the reasoning.

The premise was also narrower than the grant. Third-party storage partitioning
is enabled by default and independent of cookie policy, and the same permission
lifts it for localStorage, IndexedDB, CacheStorage and friends via
StorageAccessHandle, which gates only on IsFullCookieAccessAllowed. So the frame
does not "already have" everything this grants. It stays the right answer
because Chrome grants the same permission under the same cookie policy, but the
comment should not claim a narrower blast radius than the change has.

* docs(browser): give the storage-access tripwire its consequence

Say what goes wrong, not just when to look. If Orca ever blocks third-party
cookies or gains a partitioning control, three separate gates stay shut in
Electron - the network-service grant check, the frame's trusted status, and the
STORAGE_ACCESS content setting that is never written - so the promise would
resolve while access stayed blocked. Sites follow the documented pattern of
reloading after a successful request, and on reload the check handler still
reports granted, so no gesture is needed to ask again. That loops.

Qualify the non-cookie clause: the no-arg call resolves undefined and touches
only cookies. It is the dictionary form that returns a handle, and since the
handler sees the permission name and never the call shape, one grant covers
both. Also give "check must agree with request" its reason.

Justify the isolated-partition test by the precedent it follows rather than by
a call-site divergence the shared mock cannot actually distinguish.

* docs(browser): scope the non-cookie clause to the handle

A live probe pinned down what the grant actually widens. The frame's ambient
window.localStorage and window.indexedDB stay partitioned before and after a
successful request; the unpartitioned view is reachable only through the handle
the dictionary form returns. Existing code in the frame is unaffected unless the
site explicitly calls through that handle, so say handle-scoped rather than
leaving a reader to assume the globals change.

* docs(browser): correct the isolated-test justification and the tripwire scope

"the isolated twin every other entry in this set already has" is false. Counting
occurrences in browser-session-registry.test.ts: fullscreen, clipboard-read and
clipboard-sanitized-write have none. Cite the pointerLock precedent the test
actually mirrors, which is the case directly above it.

Separate the two gates in the tripwire. The STORAGE_ACCESS content setting gates
cookies; the handle path is gated on IsFullCookieAccessAllowed instead, and a
live probe confirmed it works today. Saying "access stayed blocked" read as a
claim that the handle is backed by nothing, which contradicted the sentence
above it. Say cookie access, and say the handle survives.
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 21, 2026
…jecting (stablyai#15481)

* fix(browser): grant storage-access so cross-site frames can use their cookies

AUTO_GRANTED_BROWSER_PERMISSIONS omitted storage-access, and the installed
permission handlers deny anything absent from that set, so every
document.requestStorageAccess() in the embedded browser was refused silently.

Granting it unconditionally looks like a privacy hole, but that objection
assumes Orca blocks third-party cookies. It does not: nothing blocks or
partitions them and no Chromium switch touches cookie policy, so Electron's
default applies. A cross-site frame therefore already reads and writes its
unpartitioned cookies at the network layer, and denying the permission grants
no protection - it only breaks sites that take the API's failure path. Chrome
resolves requestStorageAccess() without a prompt under the same cookie policy;
Electron has no such fast path and forwards to the embedder, so the embedder
supplies it. The comment records the condition that would invalidate this.

top-level-storage-access stays denied. requestStorageAccessFor() is a separate
platform decision: Chromium consults Related Website Sets and has no
third-party-cookie auto-grant, and Orca has no such data source, so granting it
would invent a permissive answer to a restrictive question. A test pins it.

Does not fix Google sign-in - that was stablyai#15216. Sign-in completes with this
denial in place; this is an independent defect found while investigating it.

* test(browser): pin the denial notice storage-access used to raise

The suite proved the handler answers true but never pinned the symptom users
actually reported — the "asked for storage-access, and Orca denied it" notice.
The existing notified-list assertion runs before the storage-access request, so
a regression that re-denied it would have left that list untouched. Assert the
list after the new requests instead; it goes red pre-fix with 'storage-access'
present.

Drop the two vi.waitFor wrappers around the same requests. The request handler
is synchronous for every non-media permission, so the wait bought nothing and
imposed vi.waitFor's 1000ms default on a suite that allows 30s. The waitFor
guarding the media path is genuinely async and stays.

* refactor(browser): tighten the storage-access rationale and cover isolated partitions

Trim the grant's comment to the facts that change a reader's decision. The
mechanics of how the request reaches the embedder already live in the commit
message; what belongs at the call site is why the answer is grant, and why the
check handler must agree with the request handler — Electron builds neither
Chrome's activation gate nor its auto-grant, so a disagreeing check pushes
compliant sites onto the gesture path, where a rejection consumes the gesture.

Move the top-level-storage-access note below the set. It sat after the last
element with no trailing comma, so it read as a commented-out entry, and any
permission appended at the natural insertion point landed above it.

Cover the isolated-partition install path. createProfile and hydrateFromPersisted
call installBrowserSessionPartitionPolicies separately from the default-partition
path the persistence suite drives, and the two previous changes to this set each
added a matching isolated test. Verified red without the grant.

Rename the anti-detection case that claimed storage-access has a native denied
state; it is granted in production now, and the case really pins pass-through.

* docs(browser): correct the storage-access rationale

The revisit trigger was backwards. If Orca ever blocked third-party cookies the
grant would not become dangerous, it would become useless for cookies: Electron
builds no HostContentSettingsMap, so no STORAGE_ACCESS content setting is ever
written, and IsAllowedByStorageAccessGrant needs one. Point the tripwire at a
cookie or storage-partitioning control instead, which is the change that would
actually invalidate the reasoning.

The premise was also narrower than the grant. Third-party storage partitioning
is enabled by default and independent of cookie policy, and the same permission
lifts it for localStorage, IndexedDB, CacheStorage and friends via
StorageAccessHandle, which gates only on IsFullCookieAccessAllowed. So the frame
does not "already have" everything this grants. It stays the right answer
because Chrome grants the same permission under the same cookie policy, but the
comment should not claim a narrower blast radius than the change has.

* docs(browser): give the storage-access tripwire its consequence

Say what goes wrong, not just when to look. If Orca ever blocks third-party
cookies or gains a partitioning control, three separate gates stay shut in
Electron - the network-service grant check, the frame's trusted status, and the
STORAGE_ACCESS content setting that is never written - so the promise would
resolve while access stayed blocked. Sites follow the documented pattern of
reloading after a successful request, and on reload the check handler still
reports granted, so no gesture is needed to ask again. That loops.

Qualify the non-cookie clause: the no-arg call resolves undefined and touches
only cookies. It is the dictionary form that returns a handle, and since the
handler sees the permission name and never the call shape, one grant covers
both. Also give "check must agree with request" its reason.

Justify the isolated-partition test by the precedent it follows rather than by
a call-site divergence the shared mock cannot actually distinguish.

* docs(browser): scope the non-cookie clause to the handle

A live probe pinned down what the grant actually widens. The frame's ambient
window.localStorage and window.indexedDB stay partitioned before and after a
successful request; the unpartitioned view is reachable only through the handle
the dictionary form returns. Existing code in the frame is unaffected unless the
site explicitly calls through that handle, so say handle-scoped rather than
leaving a reader to assume the globals change.

* docs(browser): correct the isolated-test justification and the tripwire scope

"the isolated twin every other entry in this set already has" is false. Counting
occurrences in browser-session-registry.test.ts: fullscreen, clipboard-read and
clipboard-sanitized-write have none. Cite the pointerLock precedent the test
actually mirrors, which is the case directly above it.

Separate the two gates in the tripwire. The STORAGE_ACCESS content setting gates
cookies; the handle path is gated on IsFullCookieAccessAllowed instead, and a
live probe confirmed it works today. Saying "access stayed blocked" read as a
claim that the handle is backed by nothing, which contradicted the sentence
above it. Say cookie access, and say the handle survives.
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 21, 2026
…notices (stablyai#15542)

* fix(browser): name the requesting frame and the permission in denial notices

Two defects in the same notice, both found by the review of stablyai#15481 and left out
of it deliberately.

The notice named the wrong site. setPermissionRequestHandler passed
webContents.getURL(), which is the top-level document, so a permission request
from a cross-origin sub-frame was attributed to the embedder. Every
PermissionRequest variant carries requestingUrl, so all three call sites now use
it and fall back to the top-level document only when it is absent.

The notice also showed raw Chromium permission names. humanizePermission mapped
two permissions and returned the raw token for the rest. That now matters more:
stablyai#15481 granted ordinary storage-access and left top-level-storage-access denied,
making it the storage denial a user can still hit - rendered as its raw token.

The default still returns the raw token. Inventing prose for a permission nobody
has seen is worse than showing its real name.

Does not change any permission verdict, and does not fix Google sign-in (stablyai#15221).

* fix(browser): keep permission denial attribution accurate

Capture fallback URLs before asynchronous media permission handling and treat opaque requesters as unknown rather than blaming the top-level page. Clarify permission descriptions and cover origin normalization, navigation races, and mapped copy.
dallascrilley pushed a commit to dallascrilley/orca that referenced this pull request Aug 27, 2026
…jecting (stablyai#15481)

* fix(browser): grant storage-access so cross-site frames can use their cookies

AUTO_GRANTED_BROWSER_PERMISSIONS omitted storage-access, and the installed
permission handlers deny anything absent from that set, so every
document.requestStorageAccess() in the embedded browser was refused silently.

Granting it unconditionally looks like a privacy hole, but that objection
assumes Orca blocks third-party cookies. It does not: nothing blocks or
partitions them and no Chromium switch touches cookie policy, so Electron's
default applies. A cross-site frame therefore already reads and writes its
unpartitioned cookies at the network layer, and denying the permission grants
no protection - it only breaks sites that take the API's failure path. Chrome
resolves requestStorageAccess() without a prompt under the same cookie policy;
Electron has no such fast path and forwards to the embedder, so the embedder
supplies it. The comment records the condition that would invalidate this.

top-level-storage-access stays denied. requestStorageAccessFor() is a separate
platform decision: Chromium consults Related Website Sets and has no
third-party-cookie auto-grant, and Orca has no such data source, so granting it
would invent a permissive answer to a restrictive question. A test pins it.

Does not fix Google sign-in - that was stablyai#15216. Sign-in completes with this
denial in place; this is an independent defect found while investigating it.

* test(browser): pin the denial notice storage-access used to raise

The suite proved the handler answers true but never pinned the symptom users
actually reported — the "asked for storage-access, and Orca denied it" notice.
The existing notified-list assertion runs before the storage-access request, so
a regression that re-denied it would have left that list untouched. Assert the
list after the new requests instead; it goes red pre-fix with 'storage-access'
present.

Drop the two vi.waitFor wrappers around the same requests. The request handler
is synchronous for every non-media permission, so the wait bought nothing and
imposed vi.waitFor's 1000ms default on a suite that allows 30s. The waitFor
guarding the media path is genuinely async and stays.

* refactor(browser): tighten the storage-access rationale and cover isolated partitions

Trim the grant's comment to the facts that change a reader's decision. The
mechanics of how the request reaches the embedder already live in the commit
message; what belongs at the call site is why the answer is grant, and why the
check handler must agree with the request handler — Electron builds neither
Chrome's activation gate nor its auto-grant, so a disagreeing check pushes
compliant sites onto the gesture path, where a rejection consumes the gesture.

Move the top-level-storage-access note below the set. It sat after the last
element with no trailing comma, so it read as a commented-out entry, and any
permission appended at the natural insertion point landed above it.

Cover the isolated-partition install path. createProfile and hydrateFromPersisted
call installBrowserSessionPartitionPolicies separately from the default-partition
path the persistence suite drives, and the two previous changes to this set each
added a matching isolated test. Verified red without the grant.

Rename the anti-detection case that claimed storage-access has a native denied
state; it is granted in production now, and the case really pins pass-through.

* docs(browser): correct the storage-access rationale

The revisit trigger was backwards. If Orca ever blocked third-party cookies the
grant would not become dangerous, it would become useless for cookies: Electron
builds no HostContentSettingsMap, so no STORAGE_ACCESS content setting is ever
written, and IsAllowedByStorageAccessGrant needs one. Point the tripwire at a
cookie or storage-partitioning control instead, which is the change that would
actually invalidate the reasoning.

The premise was also narrower than the grant. Third-party storage partitioning
is enabled by default and independent of cookie policy, and the same permission
lifts it for localStorage, IndexedDB, CacheStorage and friends via
StorageAccessHandle, which gates only on IsFullCookieAccessAllowed. So the frame
does not "already have" everything this grants. It stays the right answer
because Chrome grants the same permission under the same cookie policy, but the
comment should not claim a narrower blast radius than the change has.

* docs(browser): give the storage-access tripwire its consequence

Say what goes wrong, not just when to look. If Orca ever blocks third-party
cookies or gains a partitioning control, three separate gates stay shut in
Electron - the network-service grant check, the frame's trusted status, and the
STORAGE_ACCESS content setting that is never written - so the promise would
resolve while access stayed blocked. Sites follow the documented pattern of
reloading after a successful request, and on reload the check handler still
reports granted, so no gesture is needed to ask again. That loops.

Qualify the non-cookie clause: the no-arg call resolves undefined and touches
only cookies. It is the dictionary form that returns a handle, and since the
handler sees the permission name and never the call shape, one grant covers
both. Also give "check must agree with request" its reason.

Justify the isolated-partition test by the precedent it follows rather than by
a call-site divergence the shared mock cannot actually distinguish.

* docs(browser): scope the non-cookie clause to the handle

A live probe pinned down what the grant actually widens. The frame's ambient
window.localStorage and window.indexedDB stay partitioned before and after a
successful request; the unpartitioned view is reachable only through the handle
the dictionary form returns. Existing code in the frame is unaffected unless the
site explicitly calls through that handle, so say handle-scoped rather than
leaving a reader to assume the globals change.

* docs(browser): correct the isolated-test justification and the tripwire scope

"the isolated twin every other entry in this set already has" is false. Counting
occurrences in browser-session-registry.test.ts: fullscreen, clipboard-read and
clipboard-sanitized-write have none. Cite the pointerLock precedent the test
actually mirrors, which is the case directly above it.

Separate the two gates in the tripwire. The STORAGE_ACCESS content setting gates
cookies; the handle path is gated on IsFullCookieAccessAllowed instead, and a
live probe confirmed it works today. Saying "access stayed blocked" read as a
claim that the handle is backed by nothing, which contradicted the sentence
above it. Say cookie access, and say the handle survives.
dallascrilley pushed a commit to dallascrilley/orca that referenced this pull request Aug 27, 2026
…notices (stablyai#15542)

* fix(browser): name the requesting frame and the permission in denial notices

Two defects in the same notice, both found by the review of stablyai#15481 and left out
of it deliberately.

The notice named the wrong site. setPermissionRequestHandler passed
webContents.getURL(), which is the top-level document, so a permission request
from a cross-origin sub-frame was attributed to the embedder. Every
PermissionRequest variant carries requestingUrl, so all three call sites now use
it and fall back to the top-level document only when it is absent.

The notice also showed raw Chromium permission names. humanizePermission mapped
two permissions and returned the raw token for the rest. That now matters more:
stablyai#15481 granted ordinary storage-access and left top-level-storage-access denied,
making it the storage denial a user can still hit - rendered as its raw token.

The default still returns the raw token. Inventing prose for a permission nobody
has seen is worse than showing its real name.

Does not change any permission verdict, and does not fix Google sign-in (stablyai#15221).

* fix(browser): keep permission denial attribution accurate

Capture fallback URLs before asynchronous media permission handling and treat opaque requesters as unknown rather than blaming the top-level page. Clarify permission descriptions and cover origin normalization, navigation races, and mapped copy.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…jecting (stablyai#15481)

* fix(browser): grant storage-access so cross-site frames can use their cookies

AUTO_GRANTED_BROWSER_PERMISSIONS omitted storage-access, and the installed
permission handlers deny anything absent from that set, so every
document.requestStorageAccess() in the embedded browser was refused silently.

Granting it unconditionally looks like a privacy hole, but that objection
assumes Orca blocks third-party cookies. It does not: nothing blocks or
partitions them and no Chromium switch touches cookie policy, so Electron's
default applies. A cross-site frame therefore already reads and writes its
unpartitioned cookies at the network layer, and denying the permission grants
no protection - it only breaks sites that take the API's failure path. Chrome
resolves requestStorageAccess() without a prompt under the same cookie policy;
Electron has no such fast path and forwards to the embedder, so the embedder
supplies it. The comment records the condition that would invalidate this.

top-level-storage-access stays denied. requestStorageAccessFor() is a separate
platform decision: Chromium consults Related Website Sets and has no
third-party-cookie auto-grant, and Orca has no such data source, so granting it
would invent a permissive answer to a restrictive question. A test pins it.

Does not fix Google sign-in - that was stablyai#15216. Sign-in completes with this
denial in place; this is an independent defect found while investigating it.

* test(browser): pin the denial notice storage-access used to raise

The suite proved the handler answers true but never pinned the symptom users
actually reported — the "asked for storage-access, and Orca denied it" notice.
The existing notified-list assertion runs before the storage-access request, so
a regression that re-denied it would have left that list untouched. Assert the
list after the new requests instead; it goes red pre-fix with 'storage-access'
present.

Drop the two vi.waitFor wrappers around the same requests. The request handler
is synchronous for every non-media permission, so the wait bought nothing and
imposed vi.waitFor's 1000ms default on a suite that allows 30s. The waitFor
guarding the media path is genuinely async and stays.

* refactor(browser): tighten the storage-access rationale and cover isolated partitions

Trim the grant's comment to the facts that change a reader's decision. The
mechanics of how the request reaches the embedder already live in the commit
message; what belongs at the call site is why the answer is grant, and why the
check handler must agree with the request handler — Electron builds neither
Chrome's activation gate nor its auto-grant, so a disagreeing check pushes
compliant sites onto the gesture path, where a rejection consumes the gesture.

Move the top-level-storage-access note below the set. It sat after the last
element with no trailing comma, so it read as a commented-out entry, and any
permission appended at the natural insertion point landed above it.

Cover the isolated-partition install path. createProfile and hydrateFromPersisted
call installBrowserSessionPartitionPolicies separately from the default-partition
path the persistence suite drives, and the two previous changes to this set each
added a matching isolated test. Verified red without the grant.

Rename the anti-detection case that claimed storage-access has a native denied
state; it is granted in production now, and the case really pins pass-through.

* docs(browser): correct the storage-access rationale

The revisit trigger was backwards. If Orca ever blocked third-party cookies the
grant would not become dangerous, it would become useless for cookies: Electron
builds no HostContentSettingsMap, so no STORAGE_ACCESS content setting is ever
written, and IsAllowedByStorageAccessGrant needs one. Point the tripwire at a
cookie or storage-partitioning control instead, which is the change that would
actually invalidate the reasoning.

The premise was also narrower than the grant. Third-party storage partitioning
is enabled by default and independent of cookie policy, and the same permission
lifts it for localStorage, IndexedDB, CacheStorage and friends via
StorageAccessHandle, which gates only on IsFullCookieAccessAllowed. So the frame
does not "already have" everything this grants. It stays the right answer
because Chrome grants the same permission under the same cookie policy, but the
comment should not claim a narrower blast radius than the change has.

* docs(browser): give the storage-access tripwire its consequence

Say what goes wrong, not just when to look. If Orca ever blocks third-party
cookies or gains a partitioning control, three separate gates stay shut in
Electron - the network-service grant check, the frame's trusted status, and the
STORAGE_ACCESS content setting that is never written - so the promise would
resolve while access stayed blocked. Sites follow the documented pattern of
reloading after a successful request, and on reload the check handler still
reports granted, so no gesture is needed to ask again. That loops.

Qualify the non-cookie clause: the no-arg call resolves undefined and touches
only cookies. It is the dictionary form that returns a handle, and since the
handler sees the permission name and never the call shape, one grant covers
both. Also give "check must agree with request" its reason.

Justify the isolated-partition test by the precedent it follows rather than by
a call-site divergence the shared mock cannot actually distinguish.

* docs(browser): scope the non-cookie clause to the handle

A live probe pinned down what the grant actually widens. The frame's ambient
window.localStorage and window.indexedDB stay partitioned before and after a
successful request; the unpartitioned view is reachable only through the handle
the dictionary form returns. Existing code in the frame is unaffected unless the
site explicitly calls through that handle, so say handle-scoped rather than
leaving a reader to assume the globals change.

* docs(browser): correct the isolated-test justification and the tripwire scope

"the isolated twin every other entry in this set already has" is false. Counting
occurrences in browser-session-registry.test.ts: fullscreen, clipboard-read and
clipboard-sanitized-write have none. Cite the pointerLock precedent the test
actually mirrors, which is the case directly above it.

Separate the two gates in the tripwire. The STORAGE_ACCESS content setting gates
cookies; the handle path is gated on IsFullCookieAccessAllowed instead, and a
live probe confirmed it works today. Saying "access stayed blocked" read as a
claim that the handle is backed by nothing, which contradicted the sentence
above it. Say cookie access, and say the handle survives.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…notices (stablyai#15542)

* fix(browser): name the requesting frame and the permission in denial notices

Two defects in the same notice, both found by the review of stablyai#15481 and left out
of it deliberately.

The notice named the wrong site. setPermissionRequestHandler passed
webContents.getURL(), which is the top-level document, so a permission request
from a cross-origin sub-frame was attributed to the embedder. Every
PermissionRequest variant carries requestingUrl, so all three call sites now use
it and fall back to the top-level document only when it is absent.

The notice also showed raw Chromium permission names. humanizePermission mapped
two permissions and returned the raw token for the rest. That now matters more:
stablyai#15481 granted ordinary storage-access and left top-level-storage-access denied,
making it the storage denial a user can still hit - rendered as its raw token.

The default still returns the raw token. Inventing prose for a permission nobody
has seen is worse than showing its real name.

Does not change any permission verdict, and does not fix Google sign-in (stablyai#15221).

* fix(browser): keep permission denial attribution accurate

Capture fallback URLs before asynchronous media permission handling and treat opaque requesters as unknown rather than blaming the top-level page. Clarify permission descriptions and cover origin normalization, navigation races, and mapped copy.
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.

1 participant