命令

有關 commands manifest.json 鍵 中指定的命令的設定資訊。

commands.getAll() 返回的物件陣列。

型別

此型別的值是一個包含命令的這些屬性的物件

name

string。命令的名稱。此名稱會傳遞給 commands.onCommand 事件監聽器。

description 可選

string。命令的描述。用於向用戶解釋該命令的功能。

shortcut 可選

string。用於執行命令的按鍵,以字串形式指定。有關更多詳細資訊,請參閱 commands manifest 鍵文件的 快捷鍵值 部分。

descriptionshortcut 反映了 commands manifest 中提供的值,除非它們已被 commands.update() 更新,或者在快捷鍵的情況下,被使用者自定義。

瀏覽器相容性

注意: 此 API 基於 Chromium 的 chrome.commands API。