in src/parsers/manifestjson.js [913:945]
validateRestrictedPermissions() {
const permissions = Array.isArray(this.parsedJSON.permissions)
? this.parsedJSON.permissions
: [];
const permissionsInManifest = permissions.map((permission) =>
String(permission).toLowerCase()
);
if (permissionsInManifest.length === 0) {
return;
}
const minVersionSetInManifest = String(
this.getMetadata().firefoxMinVersion
);
for (const permission of this.restrictedPermissions.keys()) {
if (permissionsInManifest.includes(permission)) {
const permMinVersion = this.restrictedPermissions.get(permission);
if (
!minVersionSetInManifest ||
mozCompare(minVersionSetInManifest, permMinVersion) === -1
) {
this.collector.addError(
messages.makeRestrictedPermission(permission, permMinVersion)
);
this.isValid = false;
}
}
}
}