зеркало из https://github.com/mozilla/gecko-dev.git
Bug 775051 - Make sure there is a valid url before attempting to add perms for it, r=philikon
This commit is contained in:
Родитель
b32dccdd51
Коммит
3817442ad3
|
@ -58,14 +58,17 @@ function addPermissions(urls) {
|
|||
'content-camera', 'webcontacts-manage', 'wifi-manage', 'desktop-notification',
|
||||
'geolocation', 'device-storage', 'alarms'
|
||||
];
|
||||
|
||||
urls.forEach(function(url) {
|
||||
url = url.trim();
|
||||
if (url) {
|
||||
let uri = Services.io.newURI(url, null, null);
|
||||
let allow = Ci.nsIPermissionManager.ALLOW_ACTION;
|
||||
|
||||
permissions.forEach(function(permission) {
|
||||
Services.perms.add(uri, permission, allow);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче