Commits the currently highlighted item of the active command palette for the given WebView,
resolving its showCommandPalette promise with that item's id (mirrors how a click on a
command palette item resolves the promise). If the highlighted item is disabled, moves
forward to the next enabled item in the filtered list; if none are enabled, no-ops. No-op if no
command palette is active for that WebView.
Keyed by webViewId for the same reason as updateCommandPalette.
The ID of the WebView whose command palette selection should be committed
Dismisses the active command palette for the given WebView, resolving its showCommandPalette
promise with undefined. Works for both active and passive palettes. No-op if no command
palette is active for that WebView.
Keyed by webViewId for the same reason as updateCommandPalette.
The ID of the WebView whose command palette should be dismissed
Programmatically dismisses a popover, resolving its onPopoverDismissed promise with
undefined. No-op if the popover has already been dismissed or does not exist.
The overlay ID returned by showPopover
Returns a promise that resolves when the specified popover is dismissed. Resolves with the
PopoverAction id if the user clicked an action button, or undefined if the popover
was dismissed by clicking outside, calling dismissPopover, or via auto-dismiss timer.
Resolves immediately with undefined if the overlay ID is not found (already dismissed).
The overlay ID returned by showPopover
The action ID that triggered dismissal, or undefined
Shows a command palette with searchable/filterable items. Returns a promise that resolves with
the selected item's id, or undefined if dismissed.
LocalizeKey item text (label/description/badge) is resolved to localized strings when
the palette is shown, so all filtering — the palette's own search box and text forwarded via
updateCommandPalette — matches against the text the user actually sees.
The items, optional anchor position, and display options
The ID of the WebView requesting the command palette
The selected item's ID, or undefined if dismissed
Shows a context menu from menu.json contributions registered for the given webViewType. Fetches menu data, renders the menu, and auto-executes the selected command. Returns the command string that was executed, or undefined if dismissed.
The webViewType to look up in the menu data service
The ID of the WebView requesting the context menu. Pass globalThis.webViewId
from within a WebView iframe.
Optionaloptions: { position?: { x: number; y: number } }Optional context including the position for the menu
The command string that was executed, or undefined if dismissed
Shows a popover anchored to the specified position. Unlike context menus and modals, popovers return immediately with an overlay ID rather than waiting for dismissal. Use onPopoverDismissed to await the result, updatePopover to change content, and dismissPopover to close it programmatically.
The popover anchor, content, and behavioral options
The ID of the WebView requesting the popover. Pass globalThis.webViewId from
within a WebView iframe.
The overlay ID string, usable with other popover methods
Updates the filter text and/or moves the highlighted selection of the active command palette for the given WebView. No-op if no command palette is active for that WebView.
Unlike the popover family above (keyed by the overlay ID returned from showPopover), the
command palette mutators are keyed by webViewId instead. The service enforces one command
palette per WebView at a time (see this interface's class docs), so the requesting WebView's
own ID is a sufficient handle — passive-mode callers drive the palette without ever seeing an
overlay ID.
The ID of the WebView whose command palette should be updated
filterText and/or moveSelection (clamped to the filtered list's bounds).
filterText drives passive palettes' list directly and, for ACTIVE palettes, the
(controlled) search input — callers forward keystrokes this way when the cross-frame focus
handoff loses and the user's typing lands in their WebView instead of the palette.
Replaces the content of an existing popover without closing and reopening it. Useful for updating status messages or showing loading progress.
The overlay ID returned by showPopover
The new content to display
Service for showing overlays (context menus, popovers, command palettes) that render outside iframe boundaries in the renderer's top-level document. Renderer-only service.
Extensions in sandboxed WebView iframes cannot render UI above other content or outside their iframe bounds. This service accepts overlay requests from WebViews, translates their iframe-relative coordinates to document-level coordinates, and renders the overlay in the renderer's React tree. Each method returns a promise that resolves when the user interacts with the overlay or it is dismissed.
Only one overlay of each type (context menu, popover, command palette) can be active per WebView at a time. Requesting a new overlay of the same type from the same WebView replaces the previous one and rejects its promise with a PlatformError with code ABORTED.