Bug 1279392: [webext] Move API permission definitions to the schemas. r=aswan

MozReview-Commit-ID: 8m7wJrAbFwS
This commit is contained in:
Kris Maglione
2016-06-09 17:44:47 -07:00
parent 5097b69e54
commit b2a33e3bf1
41 changed files with 195 additions and 87 deletions

View File

@@ -388,7 +388,7 @@ function queryHelper(query) {
});
}
extensions.registerSchemaAPI("downloads", "downloads", (extension, context) => {
extensions.registerSchemaAPI("downloads", (extension, context) => {
return {
downloads: {
download(options) {
@@ -566,10 +566,6 @@ extensions.registerSchemaAPI("downloads", "downloads", (extension, context) => {
},
open(downloadId) {
if (!extension.hasPermission("downloads.open")) {
throw new context.cloneScope.Error(
"Permission denied because 'downloads.open' permission is missing.");
}
return DownloadMap.lazyInit().then(() => {
let download = DownloadMap.fromId(downloadId).download;
if (download.succeeded) {