Bug 1136055 - 'Save link as ...' should be treated as toplevel load. r=Gijs

This commit is contained in:
Christoph Kerschbaumer 2015-06-15 10:13:03 -07:00
Родитель e1c356ee7a
Коммит 89402898f0
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -1298,7 +1298,9 @@ nsContextMenu.prototype = {
}
}
// set up a channel to do the saving
// setting up a new channel for 'right click - save link as ...'
// which should be treated the same way as a toplevel load, hence
// we use TYPE_DOCUMENT, see also bug: 1136055
var ioService = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var channel = ioService.newChannelFromURI2(makeURI(linkURL),
@ -1306,7 +1308,7 @@ nsContextMenu.prototype = {
this.principal, // aLoadingPrincipal
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);
Ci.nsIContentPolicy.TYPE_DOCUMENT);
if (linkDownload)
channel.contentDispositionFilename = linkDownload;
if (channel instanceof Ci.nsIPrivateBrowsingChannel) {