Skip to content

This API is not yet available in Zotero builds.

Objects

Zotero : object

Typedefs

MenuOptions : object

Zotero : object

Kind: global namespace

Zotero.MenuManager

Manages menu APIs.

Kind: static property of Zotero

Register custom menu

Kind: static method of MenuManager

ParamType
optionsMenuOptions

Unregister custom menu

Kind: static method of MenuManager

ParamType
paneIDstring

Kind: global typedef
Properties

NameTypeDescription
menuTypestringThe type of the menu item
[l10nID]stringThe l10n ID for the menu item
[l10nArgs]objectArguments for the l10n ID
[icon]stringThe icon for the menu item - For menu icons, it is recommended to use an SVG icon with a size of 16x16. Use fill="context-fill" in the SVG to use the default icon color for automatic hover and dark mode support.
[darkIcon]stringThe dark icon for the menu item - If not provided, the light icon will be used for both light and dark mode.
[enableForTabTypes]Array.<string>The type of tab for which the menu item should be enabled. Available types are "library", "reader/*", "reader/pdf", "reader/epub", "reader/snapshot", but other types are allowed as well for custom tab types. By default, the menu item is always enabled. Only for main window menubar menus and reader window menubar menus
[onShowing]functionFunction to run when the menu is about to be shown
[onShown]functionFunction to run when the menu is shown
[onHiding]functionFunction to run when the menu is about to be hidden
[onHidden]functionFunction to run when the menu is hidden
[onCommand]functionFunction to run when the menu is clicked
[menus]Array.<MenuData>The menu items to add to the menu
menuIDstringThe unique ID of the menu
pluginIDstringThe ID of the plugin registering the menu
targetstringThe target for the menu
[menus]Array.<MenuData>The menu items to add to the menu