overwolf.os

Use the overwolf.os API for Operating System related functionalities.

Methods

setMenu(menu, callback)

Version added: 0.131

Create a tray icon for the calling extension with the supplied context menu object.

Permissions required: Tray

  • Parameter: menu <ExtensionTrayMenu >

    The menu object.

    Example:

    {
    	"menu_items": [{
    			"label": "View main window",
    			"id": "view_window"
    		},
    		{
    			"label": "More...",
    			"enabled": true,
    			"sub_items": [{
    				"label": "Version 1.0.0",
    				"id": "more_version",
    				"enabled": false
    			}]
    		},
    		{
    			"label": "-"
    		},
    		{
    			"label": "Visit website",
    			"id": "more_website"
    		}
    
    	]
    }

    Few notes:

    • In order to create a separator, use the label "-".
    • "id" must be set for items without "sub_items".
    • Separators don't need ids.
    • "Enabled" is set to true by default.
  • Parameter: callback <function>

Events How to use events

onMenuItemClicked

Version added: 0.131

Will be fired when an item from the tray icon’s context menu is selected.

Event value:
{ item: id }

onTrayIconDoubleClicked

Version added: 0.131

Will be fired when the tray icon is double clicked.

onTrayIconClicked

Version added: 0.131

Will be fired when the tray icon is left clicked.