зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1508961 - Don't prematurely check for permissions in pushManager.subscribe() permission requests. r=lina
This permission checking should be handled by PermissionUI.jsm, to be able to apply custom heuristics for denying the permission and also to be able to "post-prompt" after denying automatically. Differential Revision: https://phabricator.services.mozilla.com/D25416 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
9fb44dc7a9
Коммит
7d9bd82b23
|
@ -70,21 +70,11 @@ Push.prototype = {
|
|||
));
|
||||
};
|
||||
|
||||
let permission = Ci.nsIPermissionManager.UNKNOWN_ACTION;
|
||||
try {
|
||||
permission = this._testPermission();
|
||||
} catch (e) {
|
||||
permissionDenied();
|
||||
return;
|
||||
if (Services.prefs.getBoolPref("dom.push.testing.ignorePermission", false)) {
|
||||
resolve();
|
||||
}
|
||||
|
||||
if (permission == Ci.nsIPermissionManager.ALLOW_ACTION) {
|
||||
resolve();
|
||||
} else if (permission == Ci.nsIPermissionManager.DENY_ACTION) {
|
||||
permissionDenied();
|
||||
} else {
|
||||
this._requestPermission(isHandlingUserInput, resolve, permissionDenied);
|
||||
}
|
||||
this._requestPermission(isHandlingUserInput, resolve, permissionDenied);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче