2

Is there a simple way to add this kind of options to browser extension(I'm using the crossrider framework to build cross browser extension)?

Users just need to type the shortcut they want and click the save button

This is a screenshoot from the send to kindle chrome extension

shortcut

Li Song
  • 659
  • 1
  • 6
  • 12
  • The feature isn't built-in in the Chrome Extension API. I've implemented shortcuts in an extension (which enables Ctrl+Shift+T in incognito mode), but that doesn't work in places which cannot be accessed by a Chrome extension, including all pages which are not located at `http:`, `https:` and `file:`. The webstore is also excluded, as well as the omnibar and search field. – Rob W Jul 28 '12 at 13:14
  • I should have worded it differently: The feature *does* exist, but extensions containing the API cannot be published to the Chrome Web store, because it's still experimental. See [`chrome.experimental.keybinding`](http://code.google.com/chrome/extensions/experimental.keybinding.html). – Rob W Jul 30 '12 at 09:31

1 Answers1

4

With crossrider API you can add keyboard shortcuts

appAPI.shortcut.add('ALT+CTRL+X', function (event) {
    alert('Alt+Ctrl+X');
}, {type: 'keydown'});

Edit:

You can also store the user shortcut preferences on the extension database:

appAPI.db.set('user_shortcuts', ['Alt+Ctrl+X', 'Ctrl+F12']);
mx0
  • 6,445
  • 12
  • 49
  • 54
Roman Krom
  • 146
  • 7
  • The [documentation is here](http://crossrider.wiki.zoho.com/Keyboard-Shortcuts.html). I've created, tested and debugged a sample extension using this code (http://crossrider.com/apps/13727/ide, username `h899414@rtrtr.com` + password `tester`), and the shortcut feature is suffering from the restrictions which I mentioned in the comment at the question. Furthermore, by bad design, the shortcut does not work unless a page is refreshed. – Rob W Jul 29 '12 at 10:09