Documentation: Chrome Commands API
A promise-based wrapper for the Chrome commands API.
getAllCommands(): Promise<chrome.commands.Command[]>
Retrieves all registered extension commands.
onCommand(callback: (command: string, tab: chrome.tabs.Tab) => void): () => void
Adds a listener for extension command events. Returns an unsubscribe function.
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.