Bug 1264869 - Request STORAGE permission before downloading images. r=liuche, a=lizzard

MozReview-Commit-ID: KJGugrRw5iI
This commit is contained in:
Sebastian Kaspari 2016-04-15 10:22:22 +02:00
parent 08b33646fe
commit fcdaa31bf9

View File

@ -937,9 +937,15 @@ var BrowserApp = {
UITelemetry.addEvent("action.1", "contextmenu", null, "web_save_image");
UITelemetry.addEvent("save.1", "contextmenu", null, "image");
ContentAreaUtils.saveImageURL(aTarget.currentURI.spec, null, "SaveImageTitle",
false, true, aTarget.ownerDocument.documentURIObject,
aTarget.ownerDocument);
RuntimePermissions.waitForPermissions(RuntimePermissions.WRITE_EXTERNAL_STORAGE).then(function(permissionGranted) {
if (!permissionGranted) {
return;
}
ContentAreaUtils.saveImageURL(aTarget.currentURI.spec, null, "SaveImageTitle",
false, true, aTarget.ownerDocument.documentURIObject,
aTarget.ownerDocument);
});
});
NativeWindow.contextmenus.add(stringGetter("contextmenu.setImageAs"),