Bug 1296900 - Hide commands API if manifest key is missing r?kmag
MozReview-Commit-ID: 7vld6MgSlqG
--- 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",