Skip to content

fix: honor tabs permission for url and title in tabs.query results - #52597

Merged
MarshallOfSound merged 1 commit into
mainfrom
sam/extension-tab-privileged-fields
Sep 1, 2026
Merged

MarshallOfSound merged 1 commit into
mainfrom
sam/extension-tab-privileged-fields

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Description of Change

  • chrome.tabs.query() returned url/title even when the extension had neither the tabs permission nor host access to the tab; tabs.get/tabs.update already gated these, matching Chrome and our own tabs schema docs. Now all three go through one CanAccessPrivilegedTabFields check.
  • The check (and the query URL filter) is evaluated against the last committed URL rather than the visible URL, so a pending navigation can't change which page's fields are exposed.
  • Extends the no-privileges MV3 fixture and adds a spec for the query case.

Checklist

Release Notes

Notes: Fixed chrome.tabs.query() returning tab url and title to extensions without the tabs permission or host access, aligning with tabs.get.

@MarshallOfSound MarshallOfSound added semver/patch backwards-compatible bug fixes target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. labels Aug 2, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Aug 2, 2026

@jkleinsc jkleinsc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM; just needs rebase on main to resolve LSAN errors.

@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Aug 3, 2026
@ckerr
ckerr force-pushed the sam/extension-tab-privileged-fields branch from ee5273d to 4923c7d Compare August 4, 2026 15:39
@ckerr

ckerr commented Aug 4, 2026

Copy link
Copy Markdown
Member

rebased to origin/main to pick up the fixes to the unrelated CI failures

@MarshallOfSound

Copy link
Copy Markdown
Member Author

Heads up: Windows CI builds moved to new runners on Monday and the old ones have now been removed. This branch predates that, so its Windows build jobs still point at the old runners and will sit queued forever if CI runs again. Rebasing on main (or "Update branch") picks up the change, nothing else needed.

@github-actions github-actions Bot added the target/45-x-y PR should also be added to the "45-x-y" branch. label Aug 28, 2026
tabs.get and tabs.update only expose the privileged url and title
properties when the extension has the tabs permission or host access,
matching Chrome and our own tabs schema docs, but tabs.query populated
them unconditionally. Share one CanAccessPrivilegedTabFields check across
query, get and update, and evaluate it against the last committed URL.
@MarshallOfSound
MarshallOfSound force-pushed the sam/extension-tab-privileged-fields branch from 4923c7d to 968107e Compare August 31, 2026 22:05
@MarshallOfSound MarshallOfSound removed the target/41-x-y PR should also be added to the "41-x-y" branch. label Aug 31, 2026
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) August 31, 2026 22:11
@MarshallOfSound
MarshallOfSound merged commit d6529d6 into main Sep 1, 2026
135 of 138 checks passed
@MarshallOfSound
MarshallOfSound deleted the sam/extension-tab-privileged-fields branch September 1, 2026 00:59
@release-clerk

release-clerk Bot commented Sep 1, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed chrome.tabs.query() returning tab url and title to extensions without the tabs permission or host access, aligning with tabs.get.

@trop

trop Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "45-x-y", please check out #53353

@trop trop Bot added the in-flight/45-x-y label Sep 1, 2026
@trop

trop Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "44-x-y", please check out #53354

@trop trop Bot removed the target/45-x-y PR should also be added to the "45-x-y" branch. label Sep 1, 2026
@trop

trop Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "42-x-y", please check out #53355

@trop

trop Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "43-x-y", please check out #53356

@trop trop Bot added in-flight/44-x-y in-flight/42-x-y in-flight/43-x-y merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. and removed target/44-x-y PR should also be added to the "44-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. in-flight/42-x-y in-flight/43-x-y in-flight/44-x-y in-flight/45-x-y labels Sep 1, 2026
MarshallOfSound pushed a commit that referenced this pull request Sep 1, 2026
A merge race between #52744, which removed the uuid dev-dependency
and converted specs to randomUUID() from node:crypto, and #52597,
which added a tabs.query test using uuid.v4(), left one stray uuid
reference that breaks spec runner compilation (TS2304) on every
test shard. Swap it for randomUUID(), matching #52744's conversion.

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants