diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js index 2f6156309b63..4fcc5e525622 100644 --- a/browser/base/content/nsContextMenu.js +++ b/browser/base/content/nsContextMenu.js @@ -1344,15 +1344,12 @@ nsContextMenu.prototype = { // * this.principal - as the loadingPrincipal // for now lets use systemPrincipal to bypass mixedContentBlocker // checks after redirects, see bug: 1136055 - var ioService = Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService); - var principal = Services.scriptSecurityManager.getSystemPrincipal(); - var channel = ioService.newChannelFromURI2(makeURI(linkURL), - null, // aLoadingNode - principal, // aLoadingPrincipal - null, // aTriggeringPrincipal - Ci.nsILoadInfo.SEC_NORMAL, - Ci.nsIContentPolicy.TYPE_OTHER); + var channel = NetUtil.newChannel({ + uri: makeURI(linkURL), + loadUsingSystemPrincipal: true, + securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL + }); + if (linkDownload) channel.contentDispositionFilename = linkDownload; if (channel instanceof Ci.nsIPrivateBrowsingChannel) { @@ -1385,7 +1382,7 @@ nsContextMenu.prototype = { timer.TYPE_ONE_SHOT); // kick off the channel with our proxy object as the listener - channel.asyncOpen(new saveAsListener(), null); + channel.asyncOpen2(new saveAsListener()); }, // Save URL of clicked-on link.