Skip to content

Commit 08b84b5

Browse files
committed
doc: GM_registerMenuCommand id
1 parent 809e7d9 commit 08b84b5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

content/api/gm.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ const id2 = GM_registerMenuCommand('Text2', onClick, { title: 'Two' })
350350
const id3 = GM_registerMenuCommand('Text3', onClick, { autoClose: false })
351351
```
352352
353-
v2.15.9 and newer returns a randomly generated id or the `id` specified in the third parameter (previously v2.12.5...2.15.8 returned an `id` equal to `caption`), which allows changing the command in-place.
353+
Returns the command's `caption` since VM2.12.5 or `id` since VM2.15.9.
354354

355355
- <Field name="caption" type="string" />
356356

@@ -365,7 +365,8 @@ v2.15.9 and newer returns a randomly generated id or the `id` specified in the t
365365
- <Field name="options?" type="object" comment="since VM2.15.9" />
366366

367367
* <Field name="id?" type="string" />
368-
If not specified, a new random id is generated.
368+
Default: `caption` text since VM2.16.2.
369+
Default in 2.15.9-2.16.1: a randomly generated string.
369370

370371
* <Field name="title?" type="string" />
371372
A hint shown in the status bar when hovering the command.

0 commit comments

Comments
 (0)