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