[PSA] Support for "tab" Context in chrome.contextMenus (M150)
tl;dr: Starting in Chrome 150, the chrome.contextMenus API now supports a new tab context menu. This allows extensions to seamlessly integrate custom actions directly into the native browser tab strip's right-click menu, eliminating the need for disjointed UI workarounds.
This update addresses a long-standing ecosystem request (Issue 40246822) by adding a "tab" option to the existing ContextType enum.
API Update: The chrome.contextMenus API reference was updated to reflect the new "tab" context.
Event Payload: When a custom menu item is clicked from a tab's context menu, the chrome.contextMenus.onClicked listener fires asynchronously and receives:
info (OnClickData): The pageUrl property is automatically populated with the URL of the tab where the right-click occurred (web_contents->GetLastCommittedURL()).
tab (tabs.Tab): A standard tab object representing the right-clicked tab.
Multiple Tab Selection: If a user has multiple tabs selected (e.g., via Shift+Click), the tab argument in the event listener represents only the specific tab that was right-clicked to open the context menu. This is consistent with Firefox's existing implementation.
Favicon Attribution: Registered extension items will automatically feature the extension's icon/favicon next to their label in the native menu for clear user attribution.
Test Your Extensions: We highly recommend testing your tab management or utility extensions in Chrome Canary (M150).
Adopt the New Context: You can begin registering your context menus with the "tab" context:

Provide Feedback: We encourage you to try this out and report any issues, regressions, or general feedback on crbug.com
Chrome 150 (Canary/Dev): Available now for testing.
Chrome 150 (Stable): Expected release in line with the Chrome M150 release cycle.
On behalf of the Chrome Extensions team, Miguel Ruiz
| ||||||||||
Thanks for your feedback and suggestions!
You're correct that documentUrlPatterns is not supported for the new "tab" context. This is because documentUrlPatterns filters based on the URL of the document or frame where the right-click event occurs. With the "tab" context, the click happens on the browser's tab UI element itself, which isn't part of any specific web document's context in the same way.
We understand the desire for more granular control over when extension items appear. We're initially aiming to establish a consistent behavior in line with how tab contexts are handled in other browsers.
We really appreciate you sharing these thoughtful suggestions, and we'll certainly consider them for future enhancements as we continue to evolve the API.
We've been testing the new contexts: ["tab"] support in our extension (VertiTab – a tab management extension) on Chrome 150 Canary, and encountered a critical crash bug.
Issue: Chrome crashes immediately when right-clicking a tab if an extension has registered more than one context menu item for the "tab" context.
Environment:
I have filed a bug report at https://issues.chromium.org/issues/514442561.
The "tab" context is an excellent addition to this API; once sub-menu functionality is supported, we look forward to fully leveraging this feature.
Thank you!