Skip to content

fix(extension-chrome): drop 'tabs' manifest permission + fallback#27

Merged
paperhurts merged 1 commit into
mainfrom
fix/drop-tabs-permission
May 24, 2026
Merged

fix(extension-chrome): drop 'tabs' manifest permission + fallback#27
paperhurts merged 1 commit into
mainfrom
fix/drop-tabs-permission

Conversation

@paperhurts
Copy link
Copy Markdown
Owner

Summary

The popup's getActiveTab fallback that called chrome.tabs.query({}) required the broad tabs permission (read access to ALL open tabs' title + URL). Drop the fallback and the permission. Production code now relies on activeTab which Chrome grants when the user clicks the toolbar action.

Why the fallback existed

Playwright e2e tests open popup.html as a regular tab rather than via the action gesture, so activeTab doesn't kick in there. The fallback masked that test limitation by scanning all tabs.

What this PR does

Test plan

  • pnpm test 94/94
  • pnpm typecheck clean
  • pnpm build clean — dist/manifest.json no longer requests tabs
  • pnpm e2e 4 passed, 2 skipped (documented)
  • CI green

Closes #3

The popup's getActiveTab() had a fallback that called
chrome.tabs.query({}) to find the most-recently-accessed regular tab
when the popup was opened as a page rather than the toolbar action.
That fallback required the broad 'tabs' permission, which grants the
extension read access to title + URL of ALL open tabs — way more than
the MVP needs.

The fallback existed only to make Playwright e2e tests pass: Playwright
opens popup.html as a normal page rather than via the action icon, so
'activeTab' doesn't kick in. In real Chrome, clicking the toolbar icon
IS the activeTab gesture; the user's tab is accessible without 'tabs'.

Drop the fallback. Drop 'tabs' from manifest.config.ts. The 2 affected
e2e tests are skipped with documentation linking to #3 + #5 (same
family as the Playwright SW-dispatch gap). Save-flow unit coverage in
test/save-flow.test.ts + test/bookmarks-file.test.ts remains intact;
the GitHub round-trip is also covered by sync.spec.ts.

Closes #3
@paperhurts paperhurts merged commit 4bf286f into main May 24, 2026
1 check passed
@paperhurts paperhurts deleted the fix/drop-tabs-permission branch May 24, 2026 04:07
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.

MV3 'tabs' permission is broader than necessary

1 participant