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

Unified Diff: chrome/common/extensions/docs/templates/intros/commands.html

Issue 197783005: Enable the Commands API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 6 years, 9 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
« no previous file with comments | « chrome/common/extensions/command.cc ('k') | extensions/common/feature_switch.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/templates/intros/commands.html
diff --git a/chrome/common/extensions/docs/templates/intros/commands.html b/chrome/common/extensions/docs/templates/intros/commands.html
index 65c3b7ca318520fb9766e8444ab5086f9df70850..0416a57ff1ba97caf71439dd4df194116eb04a7e 100644
--- a/chrome/common/extensions/docs/templates/intros/commands.html
+++ b/chrome/common/extensions/docs/templates/intros/commands.html
@@ -74,3 +74,35 @@ generate events that you can handle. If you need to take action based on your
popup opening, consider listening for an 'onDomReady' event inside your popup's
code.
</p>
+
+<h2 id="usage">Scope</h2>
+<p>By default, Commands are scoped to the Chrome browser, which means that while
+the browser does not have focus, the shortcut will be inactive. On desktop
+Chrome, Commands can instead have global scope and will then also work while
+Chrome does *not* have focus. NOTE: The exception here is ChromeOS, where global
+commands are not allowed at the moment.</p>
+
+<p>The user is free to designate any shortcut as global using the UI in
+chrome://extensions \ Keyboard Shortcuts, but the extension developer is limited
+to specifying only Ctrl+Shift+[0..9] as global shortcuts. This is to minimize
+the risk of overriding shortcuts in other applications since if, for example,
+Alt+P were to be allowed as global, the printing shortcut might not work in
+other applications.</p>
+
+<p>Example:</p>
+
+<pre data-filename="manifest.json">
+{
+ "name": "My extension",
+ ...
+ "commands": {
+ "toggle-feature-foo": {
+ "suggested_key": {
+ "default": "Ctrl+Shift+5"
+ },
+ "description": "Toggle feature foo",
+ <b>"global": true</b>
+ }
+ },
+ ...
+}</pre>
« no previous file with comments | « chrome/common/extensions/command.cc ('k') | extensions/common/feature_switch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698