Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有一种简单的方法可以将这种选项添加到浏览器扩展中(我正在使用 crossrider 框架来构建跨浏览器扩展)?
用户只需键入他们想要的快捷方式并单击保存按钮
这是来自send to kindlechrome 扩展的屏幕截图
send to kindle
使用 crossrider API,您可以添加键盘快捷键
appAPI.shortcut.add('ALT+CTRL+X', function (event) { alert('Alt+Ctrl+X'); }, {type: 'keydown'});
编辑:
您还可以将用户快捷方式首选项存储在扩展数据库中:
appAPI.db.set('user_shortcuts', ['Alt+Ctrl+X', 'Ctrl+F12']);