Removes frontWindow usage from the stream converter.

This commit is contained in:
Yury Delendik 2016-03-24 11:47:34 -05:00
parent da8e345d14
commit 2b246192e1

View File

@ -319,11 +319,9 @@ ChromeActions.prototype = {
var extHelperAppSvc =
Cc['@mozilla.org/uriloader/external-helper-app-service;1'].
getService(Ci.nsIExternalHelperAppService);
var frontWindow = Cc['@mozilla.org/embedcomp/window-watcher;1'].
getService(Ci.nsIWindowWatcher).activeWindow;
var docIsPrivate = this.isInPrivateBrowsing();
var netChannel = createNewChannel(blobUri, frontWindow.document, null);
var netChannel = createNewChannel(blobUri, this.domWindow.document, null);
if ('nsIPrivateBrowsingChannel' in Ci &&
netChannel instanceof Ci.nsIPrivateBrowsingChannel) {
netChannel.setPrivate(docIsPrivate);
@ -359,10 +357,14 @@ ChromeActions.prototype = {
var listener = {
extListener: null,
onStartRequest: function(aRequest, aContext) {
var loadContext = self.domWindow
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsILoadContext);
this.extListener = extHelperAppSvc.doContent(
(data.isAttachment ? 'application/octet-stream' :
'application/pdf'),
aRequest, frontWindow, false);
aRequest, loadContext, false);
this.extListener.onStartRequest(aRequest, aContext);
},
onStopRequest: function(aRequest, aContext, aStatusCode) {