Merge pull request #2198 from yurydelendik/bug792582
Bug 792582 - Explicitly set privacy status of channels created by pdf.js
This commit is contained in:
		
						commit
						ca666e9914
					
				| @ -213,7 +213,22 @@ ChromeActions.prototype = { | |||||||
|     var frontWindow = Cc['@mozilla.org/embedcomp/window-watcher;1']. |     var frontWindow = Cc['@mozilla.org/embedcomp/window-watcher;1']. | ||||||
|                          getService(Ci.nsIWindowWatcher).activeWindow; |                          getService(Ci.nsIWindowWatcher).activeWindow; | ||||||
| 
 | 
 | ||||||
|     NetUtil.asyncFetch(blobUri, function(aInputStream, aResult) { |     let docIsPrivate = false; | ||||||
|  |     try { | ||||||
|  |       docIsPrivate = this.domWindow | ||||||
|  |                          .QueryInterface(Ci.nsIInterfaceRequestor) | ||||||
|  |                          .getInterface(Ci.nsIWebNavigation) | ||||||
|  |                          .QueryInterface(Ci.nsILoadContext) | ||||||
|  |                          .usePrivateBrowsing; | ||||||
|  |     } catch (x) { | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     let netChannel = NetUtil.newChannel(blobUri); | ||||||
|  |     if ('nsIPrivateBrowsingChannel' in Ci && | ||||||
|  |         netChannel instanceof Ci.nsIPrivateBrowsingChannel) { | ||||||
|  |       netChannel.setPrivate(docIsPrivate); | ||||||
|  |     } | ||||||
|  |     NetUtil.asyncFetch(netChannel, function(aInputStream, aResult) { | ||||||
|       if (!Components.isSuccessCode(aResult)) { |       if (!Components.isSuccessCode(aResult)) { | ||||||
|         if (sendResponse) |         if (sendResponse) | ||||||
|           sendResponse(true); |           sendResponse(true); | ||||||
| @ -226,6 +241,10 @@ ChromeActions.prototype = { | |||||||
|       channel.setURI(originalUri); |       channel.setURI(originalUri); | ||||||
|       channel.contentStream = aInputStream; |       channel.contentStream = aInputStream; | ||||||
|       channel.QueryInterface(Ci.nsIChannel); |       channel.QueryInterface(Ci.nsIChannel); | ||||||
|  |       if ('nsIPrivateBrowsingChannel' in Ci && | ||||||
|  |           channel instanceof Ci.nsIPrivateBrowsingChannel) { | ||||||
|  |         channel.setPrivate(docIsPrivate); | ||||||
|  |       } | ||||||
| 
 | 
 | ||||||
|       var listener = { |       var listener = { | ||||||
|         extListener: null, |         extListener: null, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user