Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: chrome/common/extensions/docs/static/experimental.keybinding.html

Issue 9465005: Updating the doc to reflect the new experimental.keybinding API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/static/experimental.keybinding.html
===================================================================
--- chrome/common/extensions/docs/static/experimental.keybinding.html (revision 0)
+++ chrome/common/extensions/docs/static/experimental.keybinding.html (revision 0)
@@ -0,0 +1,50 @@
+<!-- BEGIN AUTHORED CONTENT -->
+<p>
+The keybinding API allows you to add keyboard shortcuts that trigger actions in
+your extension. An action can be opening the browser action or page action popup
+or sending a command to the extension.
Mike West 2012/02/24 14:24:24 Can you add a link here to the experimental docs?
Finnur 2012/02/24 15:09:16 This is generated automatically when you build the
+</p>
+
+<h2 id="manifest">Manifest</h2>
+
+<p>
+You must declare the "keybinding" permission in your extension's manifest
+to use this API. Also note that "pageAction" and "browserAction" are reserved
Mike West 2012/02/24 14:24:24 I'd recommend separating this into two parts: `per
+commands, which, if specified, open the popup for the pageAction (if visible)
+and browserAction, respectively. All other commands are sent to the extension in
+the form of a javascript event.
+</p>
+
+<pre>{
+ "name": "My extension",
+ ...
+<b> "commands": {
+ "toggle-feature-foo": {
+ "key": "Ctrl+Shift+Y",
+ "description": "Toggle feature foo"
+ },
+ "browserAction": {
+ "key": "Ctrl+Shift+B"
Mike West 2012/02/24 14:24:24 Probably also worth mentioning that `Ctrl+Alt` isn
+ },
+ "pageAction": {
+ "key": "Alt+P"
+ }
+
+ }</b>,
+ ...
+<b> "permissions": [
+ "keybinding",
+ ]</b>,
+ ...
+}</pre>
+
+<h2>Examples</h2>
+<p>The following example adds a handler for the onCommand event:
+</p>
+
+<pre>
+chrome.experimental.keybinding.onCommand.addListener(function(command) {
+ console.log('Command:', command);
+});
+</pre>
+<!-- END AUTHORED CONTENT -->
Property changes on: chrome\common\extensions\docs\static\experimental.keybinding.html
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698