Skip to content

GM_registerMenuCommand

shen yin edited this page Jan 28, 2022 · 1 revision

This method allows user scripts to add an item to the Stay settings menu.

Availability

Stay 2.0.2+

Declaration

GM_registerMenuCommand( caption, commandFunc, accessKey )

Parameters

caption
The caption to display on the menu item.

commandFunc
The function to call when this menu item is selected by the user.

accessKey
A single character that can be used to select command when the menu is open. (Ignored on Stay)

Return Value

void

Example

GM_registerMenuCommand("Hello, world (simple)", () => alert("Hello, world!"));