概念和用法
借助 Commands API,扩展程序开发者可以定义特定命令,并将其绑定到默认组合键。扩展程序接受的每个命令都必须在扩展程序的清单中声明为 "commands" 对象的属性。
属性键将用作命令的名称。命令对象可以具有两个属性。
manifest.json中配置方式
{
"name": "My extension",
...
"commands": {
"run-foo": {
"suggested_key": {
"default": "Ctrl+Shift+Y",
"mac": "Command+Shift+Y"
},
"description": "Run \"foo\" on the current page."
},
"_execute_action": {
"suggested_key": {
"windows": "Ctrl+Shift+Y",
"mac": "Command+Shift+Y",
"chromeos": "Ctrl+Shift+U",
&n

最低0.47元/天 解锁文章
4万+

被折叠的 条评论
为什么被折叠?



