Bug 1296900 - Hide commands API if manifest key is missing r?kmag draft
authorRob Wu <rob@robwu.nl>
Sat, 20 Aug 2016 23:01:43 -0700
changeset 417358 58b571e3fe97b4c1cdc53a42bca14cc967f43ff5
parent 417357 6d51d34a0fa744bff3837b57f1f9e91da8b60225
child 532076 b79dc820283b81ecb1815ebf15f9e371314d0b81
push id30387
push userbmo:rob@robwu.nl
push dateSat, 24 Sep 2016 08:37:10 +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",