Bug 1197420 Part 1 Schema groundwork for optional permissions r=kmag
MozReview-Commit-ID: JIfPYjxjFfM
--- a/browser/components/extensions/schemas/bookmarks.json
+++ b/browser/components/extensions/schemas/bookmarks.json
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"namespace": "manifest",
"types": [
{
- "$extend": "Permission",
+ "$extend": "OptionalPermission",
"choices": [{
"type": "string",
"enum": [
"bookmarks"
]
}]
}
]
--- a/browser/components/extensions/schemas/history.json
+++ b/browser/components/extensions/schemas/history.json
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"namespace": "manifest",
"types": [
{
- "$extend": "Permission",
+ "$extend": "OptionalPermission",
"choices": [{
"type": "string",
"enum": [
"history"
]
}]
}
]
--- a/browser/components/extensions/schemas/tabs.json
+++ b/browser/components/extensions/schemas/tabs.json
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"namespace": "manifest",
"types": [
{
- "$extend": "Permission",
+ "$extend": "OptionalPermission",
"choices": [{
"type": "string",
"enum": [
"activeTab",
"tabs"
]
}]
}
--- a/mobile/android/components/extensions/schemas/tabs.json
+++ b/mobile/android/components/extensions/schemas/tabs.json
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"namespace": "manifest",
"types": [
{
- "$extend": "Permission",
+ "$extend": "OptionalPermission",
"choices": [{
"type": "string",
"enum": [
"activeTab",
"tabs"
]
}]
}
--- a/toolkit/components/extensions/schemas/cookies.json
+++ b/toolkit/components/extensions/schemas/cookies.json
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"namespace": "manifest",
"types": [
{
- "$extend": "Permission",
+ "$extend": "OptionalPermission",
"choices": [{
"type": "string",
"enum": [
"cookies"
]
}]
}
]
--- a/toolkit/components/extensions/schemas/manifest.json
+++ b/toolkit/components/extensions/schemas/manifest.json
@@ -174,16 +174,22 @@
"type": "string",
"deprecated": "Unknown permission ${value}"
}
]
},
"optional": true
},
+ "optional_permissions": {
+ "type": "array",
+ "items": { "$ref": "OptionalPermission" },
+ "optional": true
+ },
+
"web_accessible_resources": {
"type": "array",
"items": { "type": "string" },
"optional": true
},
"developer": {
"type": "object",
@@ -202,31 +208,42 @@
}
}
},
"additionalProperties": { "$ref": "UnrecognizedProperty" }
},
{
+ "id": "OptionalPermission",
+ "choices": [
+ {
+ "type": "string",
+ "enum": [
+ "clipboardRead",
+ "clipboardWrite",
+ "geolocation",
+ "idle",
+ "notifications"
+ ]
+ },
+ { "$ref": "MatchPattern" }
+ ]
+ },
+ {
"id": "Permission",
"choices": [
+ { "$ref": "OptionalPermission" },
{
"type": "string",
"enum": [
"alarms",
- "clipboardRead",
- "clipboardWrite",
- "geolocation",
- "idle",
- "notifications",
"storage"
]
- },
- { "$ref": "MatchPattern" }
+ }
]
},
{
"id": "HttpURL",
"type": "string",
"format": "url",
"pattern": "^https?://.*$"
},
--- a/toolkit/components/extensions/schemas/top_sites.json
+++ b/toolkit/components/extensions/schemas/top_sites.json
@@ -2,17 +2,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
[
{
"namespace": "manifest",
"types": [
{
- "$extend": "Permission",
+ "$extend": "OptionalPermission",
"choices": [{
"type": "string",
"enum": [
"topSites"
]
}]
}
]
--- a/toolkit/components/extensions/schemas/web_navigation.json
+++ b/toolkit/components/extensions/schemas/web_navigation.json
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"namespace": "manifest",
"types": [
{
- "$extend": "Permission",
+ "$extend": "OptionalPermission",
"choices": [{
"type": "string",
"enum": [
"webNavigation"
]
}]
}
]
--- a/toolkit/components/extensions/schemas/web_request.json
+++ b/toolkit/components/extensions/schemas/web_request.json
@@ -2,17 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"namespace": "manifest",
"types": [
{
- "$extend": "Permission",
+ "$extend": "OptionalPermission",
"choices": [{
"type": "string",
"enum": [
"webRequest",
"webRequestBlocking"
]
}]
}