summaryrefslogtreecommitdiffstats
path: root/application/palemoon/base
diff options
context:
space:
mode:
authorJustOff <Off.Just.Off@gmail.com>2018-04-13 21:31:38 +0300
committerJustOff <Off.Just.Off@gmail.com>2018-04-13 21:31:38 +0300
commitc71dd74969195b6c402a2546df33c6addd8ae16d (patch)
tree9822e963ff352dc2eaea6f3173fe0a11db07831c /application/palemoon/base
parentc17c14ce6afc026e8b918b8bf48fba7515bebac3 (diff)
downloadUXP-c71dd74969195b6c402a2546df33c6addd8ae16d.tar
UXP-c71dd74969195b6c402a2546df33c6addd8ae16d.tar.gz
UXP-c71dd74969195b6c402a2546df33c6addd8ae16d.tar.lz
UXP-c71dd74969195b6c402a2546df33c6addd8ae16d.tar.xz
UXP-c71dd74969195b6c402a2546df33c6addd8ae16d.zip
Make JS callers of ios.newChannel call ios.newChannel2 in browser/
Diffstat (limited to 'application/palemoon/base')
-rw-r--r--application/palemoon/base/content/nsContextMenu.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/application/palemoon/base/content/nsContextMenu.js b/application/palemoon/base/content/nsContextMenu.js
index 1d3ceb17e..017ab87cc 100644
--- a/application/palemoon/base/content/nsContextMenu.js
+++ b/application/palemoon/base/content/nsContextMenu.js
@@ -1116,10 +1116,17 @@ nsContextMenu.prototype = {
}
}
- // set up a channel to do the saving
- var ioService = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
- var channel = ioService.newChannelFromURI(makeURI(linkURL));
+ // 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
+ });
+
if (linkDownload)
channel.contentDispositionFilename = linkDownload;
if (channel instanceof Ci.nsIPrivateBrowsingChannel) {
@@ -1152,7 +1159,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.