Bug 1398229 - Save-link-as feature should use the loading principal - part 2 - context menu using nsIContentPolicy.TYPE_SAVE_AS_DOWNLOAD, r=ckerschb

This commit is contained in:
Andrea Marchesini 2017-11-16 12:26:30 +01:00
Родитель 7fc45ac652
Коммит 5ed6994506
1 изменённых файлов: 3 добавлений и 6 удалений

Просмотреть файл

@ -1153,14 +1153,11 @@ nsContextMenu.prototype = {
};
// setting up a new channel for 'right click - save link as ...'
// ideally we should use:
// * doc - as the loadingNode, and/or
// * this.principal - as the loadingPrincipal
// for now lets use systemPrincipal to bypass mixedContentBlocker
// checks after redirects, see bug: 1136055
var channel = NetUtil.newChannel({
uri: makeURI(linkURL),
loadUsingSystemPrincipal: true
loadingPrincipal: this.principal,
contentPolicyType: Ci.nsIContentPolicy.TYPE_SAVEAS_DOWNLOAD,
securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS,
});
if (linkDownload)