mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
Make JS callers of ios.newChannel call ios.newChannel2 in browser/
This commit is contained in:
parent
e37a6016b9
commit
53f6a692d3
2 changed files with 44 additions and 28 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue