From 9583e9b141290afe7dbc8154c79a7067788caa4d Mon Sep 17 00:00:00 2001 From: Frank-Rainer Grahl Date: Mon, 9 Jul 2018 17:00:21 +0200 Subject: [PATCH] Bug 1326377 - Media view 'Save As ...' for embedded(?) picture fails. r=IanN --- suite/browser/pageinfo/pageInfo.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/suite/browser/pageinfo/pageInfo.js b/suite/browser/pageinfo/pageInfo.js index b339ae8167..d8c0fa1d07 100644 --- a/suite/browser/pageinfo/pageInfo.js +++ b/suite/browser/pageinfo/pageInfo.js @@ -914,16 +914,17 @@ function saveMedia() else if (item instanceof HTMLAudioElement) titleKey = "SaveAudioTitle"; - saveURL(url, null, titleKey, false, true, makeURI(item.baseURI), - gDocument); + saveURL(url, null, titleKey, false, false, makeURI(item.baseURI), + null, (opener.gPrivate ? true : false)); } } else { selectSaveFolder(function(aDirectory) { if (aDirectory) { var saveAnImage = function(aURIString, aChosenData, aBaseURI) { uniqueFile(aChosenData.file); - internalSave(aURIString, null, null, null, null, false, "SaveImageTitle", - aChosenData, aBaseURI, null, false, null, gDocument.isContentWindowPrivate); + internalSave(aURIString, null, null, null, null, false, + "SaveImageTitle", aChosenData, aBaseURI, null, false, + null, (opener.gPrivate ? true : false)); }; for (var i = 0; i < rowArray.length; i++) { @@ -1246,8 +1247,9 @@ function getContentTypeFromHeaders(cacheEntryDescriptor) if (!cacheEntryDescriptor) return null; - return (/^Content-Type:\s*(.*?)\s*(?:\;|$)/mi - .exec(cacheEntryDescriptor.getMetaDataElement("response-head")))[1]; + let headers = cacheEntryDescriptor.getMetaDataElement("response-head"); + let type = /^Content-Type:\s*(.*?)\s*(?:\;|$)/mi.exec(headers); + return type && type[1]; } //******** Other Misc Stuff