You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#54285 introduces a new contribution point for context menus on webviews. This contribution point has been tested before, so for this test plan item, you just need to make sure the finalized API works without enabling any api proposals.
The contents of the webview can change the when clauses by setting data-vscode-context with json values of the new context. For example, if I right click inside of nav with the following html:
Test for #54285
Complexity: 5
Create Issue
Create Issue
Summary
#54285 introduces a new contribution point for context menus on webviews. This contribution point has been tested before, so for this test plan item, you just need to make sure the finalized API works without enabling any api proposals.
Here's a refresher on the API itself:
The contents of the webview can change the when clauses by setting
data-vscode-context
with json values of the new context. For example, if I right click inside ofnav
with the following html:The set contexts would be:
webviewSection
="nav"
(overrides the value from the. menu
element)countOfThing
=123
(inherited from the parent.menu
element)preventDefaultContextMenuItems
=true
The
preventDefaultContextMenuItems
context should prevent the default context menu items from showing up (copy, paste, ...)Testing
Using the webview extension sample, try testing:
You can register webview context menu items and use
webview == 'catCoding'
to register a new menu. For example:Your html can suppress the default context menu items using
preventDefaultContextMenuItems
withdata-vscode-context
(see above)Your html can set custom context using
data-vscode-context
Any set contexts should override contexts set by parent element (the above example shows this for
webviewSection
)The text was updated successfully, but these errors were encountered: