Bug 1296900 - Hide commands API if manifest key is missing r=kmag
authorRob Wu <rob@robwu.nl>
Sat, 20 Aug 2016 23:01:43 -0700
changeset 417631 9c43276b9d7de96b983a006a7bf0f47b252ee08b
parent 417630 3e89a12f219e1ed00deb408bc71096ff64795cd9
child 417632 0de5ca60147c1657cafd088e1b8b094736eb5d41
push id30444
push userbmo:pbrosset@mozilla.com
push dateMon, 26 Sep 2016 14:07:09 +0000
reviewerskmag
bugs1296900
milestone52.0a1
Bug 1296900 - Hide commands API if manifest key is missing r=kmag MozReview-Commit-ID: 7vld6MgSlqG
browser/components/extensions/schemas/commands.json
browser/components/extensions/test/mochitest/test_ext_all_apis.html
--- a/browser/components/extensions/schemas/commands.json
+++ b/browser/components/extensions/schemas/commands.json
@@ -77,16 +77,17 @@
           }
         }
       }
     ]
   },
   {
     "namespace": "commands",
     "description": "Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the xtension.",
+    "permissions": ["manifest:commands"],
     "types": [
       {
         "id": "Command",
         "type": "object",
         "properties": {
           "name":        {
             "type": "string",
             "optional": true,
--- a/browser/components/extensions/test/mochitest/test_ext_all_apis.html
+++ b/browser/components/extensions/test/mochitest/test_ext_all_apis.html
@@ -11,20 +11,16 @@
 <body>
 <script>
 "use strict";
 /* exported expectedContentApisTargetSpecific, expectedBackgroundApisTargetSpecific */
 let expectedContentApisTargetSpecific = [
 ];
 
 let expectedBackgroundApisTargetSpecific = [
-  // TODO(robwu): commands API should be hidden by default, and only be visible
-  // if the commands manifest attribute is set.
-  "commands.getAll",
-  "commands.onCommand",
   "tabs.MutedInfoReason",
   "tabs.TAB_ID_NONE",
   "tabs.TabStatus",
   "tabs.WindowType",
   "tabs.ZoomSettingsMode",
   "tabs.ZoomSettingsScope",
   "tabs.connect",
   "tabs.create",