Bug 814294 - Don't prompt for missing permissions (UNKNOWN_ACTION). r=sicking

This commit is contained in:
Gregor Wagner 2012-11-27 17:31:45 -08:00
parent 609c647a8a
commit 28f0f5ac29

View File

@ -60,6 +60,7 @@ function ContentPermissionPrompt() {}
ContentPermissionPrompt.prototype = {
handleExistingPermission: function handleExistingPermission(request) {
let promptForUnknown = ['geolocation'];
let access = (request.access && request.access !== "unused") ? request.type + "-" + request.access :
request.type;
let result = Services.perms.testExactPermissionFromPrincipal(request.principal, access);
@ -67,7 +68,8 @@ ContentPermissionPrompt.prototype = {
request.allow();
return true;
}
if (result == Ci.nsIPermissionManager.DENY_ACTION) {
if (result == Ci.nsIPermissionManager.DENY_ACTION ||
result == Ci.nsIPermissionManager.UNKNOWN_ACTION && promptForUnknown.indexOf(access) < 0) {
request.cancel();
return true;
}