moderator-toolbox-nxg-for-reddit / store/contextMenu

store/contextMenu

Functions

addContextItem()

addContextItem(id, options): void

Defined in: extension/data/store/contextMenu.ts:33

Adds or updates an item in the Toolbox context menu. No-ops when the page is running in an embedded frame.

Parameters

id

string

Stable identifier for this item; used for deduplication and removal.

options

AddContextItemOptions

The menu item’s content and behaviour (see AddContextItemOptions).

Returns

void


removeContextItem()

removeContextItem(id): void

Defined in: extension/data/store/contextMenu.ts:52

Removes the context menu item with the given id. No-ops when the page is running in an embedded frame.

Parameters

id

string

Returns

void

Interfaces

AddContextItemOptions

Defined in: extension/data/store/contextMenu.ts:9

Options for adding a context menu item.

Properties

attention?

optional attention?: boolean

Defined in: extension/data/store/contextMenu.ts:19

When true, briefly highlights the menu to draw the user’s attention.

dataAttributes?

optional dataAttributes?: Record<string, string>

Defined in: extension/data/store/contextMenu.ts:17

Additional data-* attributes set on the <li> element.

icon

icon: "modqueue" | "unmoderated" | "overlay" | "close" | "list" | "remove" | "modmail" | "comments" | "ban" | "mute" | "settings" | "add" | "delete" | "edit" | "archive" | "unarchive" | "addBox" | "addCircle" | "arrowLeft" | "arrowRight" | "dotMenu" | "dragHandle" | "flair" | "help" | "history" | "modlog" | "profile" | "refresh" | "sortDown" | "sortUp" | "subTraffic" | "tbConsole" | "tbReload" | "tbSettingLink" | "tbSubConfig" | "userInbox" | "usernote" | "prerelease" | "unknownDocument" | "trainingMode"

Defined in: extension/data/store/contextMenu.ts:13

Icon name from the icons map.

order?

optional order?: number

Defined in: extension/data/store/contextMenu.ts:24

Sort position for this item. Lower numbers appear first. Items without an order are sorted to the end in insertion order.

text

text: string

Defined in: extension/data/store/contextMenu.ts:11

Display text for the menu item.

title?

optional title?: string

Defined in: extension/data/store/contextMenu.ts:15

Tooltip shown on hover.