Skip to content

Simplify setTabValue and removeTabValue examples - #45672

Open
sharadvc wants to merge 1 commit into
mdn:mainfrom
sharadvc:cursor/simplify-sessions-tabvalue-examples-b0fc
Open

sharadvc wants to merge 1 commit into
mdn:mainfrom
sharadvc:cursor/simplify-sessions-tabvalue-examples-b0fc

Conversation

@sharadvc

Copy link
Copy Markdown

Summary

Examples on sessions.setTabValue and sessions.removeTabValue used redundant browser.tabs.query to get the active tab. menus.onClicked already provides the relevant tabs.Tab as the second argument, so the examples now use tab.id directly (aligned with the menus.onClicked examples).

Test plan

  • Diff is the two example pages only
  • Preview examples render correctly

Fixes #45607

Use the tab argument from menus.onClicked instead of tabs.query.

Fixes mdn#45607
@sharadvc
sharadvc requested a review from a team as a code owner September 13, 2026 08:10
@sharadvc
sharadvc requested review from willdurand and removed request for a team September 13, 2026 08:10
@github-actions github-actions Bot added Content:WebExt WebExtensions docs size/s [PR only] 6-50 LoC changed labels Sep 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebExt WebExtensions docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sessions.setTabValue: Improve example

2 participants