Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Try it now in CWS

Context menus

Sample that shows how to use the context menu API in an app to manage various application context menus, such as menus that only apply to particular windows, menus that apply to selections or media types, and context menus that work on the app launcher.

A single context menu structure is normally global to the entire app, and thus all windows would have the same menu. This sample uses a focus event handler in each window to detect when a window is brought to the foreground. When it is, the contents of the context menu are updated with that window's commands, while leaving the other menus intact. The chrome.contextMenus.onClicked event handler also only handles events that occur in that window.

APIs

Screenshot

screenshot