Skip to content

Latest commit

 

History

History
49 lines (30 loc) · 974 Bytes

File metadata and controls

49 lines (30 loc) · 974 Bytes

commands

Documentation: Chrome Commands API

A promise-based wrapper for the Chrome commands API.

Methods

Events


getAllCommands

getAllCommands(): Promise<chrome.commands.Command[]>

Retrieves all registered extension commands.

onCommand

onCommand(callback: (command: string, tab: chrome.tabs.Tab) => void): () => void

Adds a listener for extension command events. Returns an unsubscribe function.

onSpecificCommand

onSpecificCommand(
  command: string,
  callback: (tab?: chrome.tabs.Tab) => any
): () => void

Adds a listener that triggers only when the specified command is invoked. Returns an unsubscribe function.