[tbb-commits] [tor-browser/tor-browser-38.2.0esr-5.0-1] fixup! Bug #15502: Isolate blob, mediasource & mediastream URLs to first party

gk at torproject.org gk at torproject.org
Thu Aug 20 11:04:14 UTC 2015


commit 45d52ca216b12a23e83b6fdc9edcff5f49c70152
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Tue Aug 18 11:27:22 2015 -0400

    fixup! Bug #15502: Isolate blob, mediasource & mediastream URLs to first party
    
    Resurrect a workaround that allows pdf.js to save files.
    Fixes #16781.
---
 browser/extensions/pdfjs/content/PdfStreamConverter.jsm |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/browser/extensions/pdfjs/content/PdfStreamConverter.jsm b/browser/extensions/pdfjs/content/PdfStreamConverter.jsm
index f2ac778..24c2de1 100644
--- a/browser/extensions/pdfjs/content/PdfStreamConverter.jsm
+++ b/browser/extensions/pdfjs/content/PdfStreamConverter.jsm
@@ -250,6 +250,12 @@ ChromeActions.prototype = {
       filename = 'document.pdf';
     }
     var blobUri = data.blobUrl ? NetUtil.newURI(data.blobUrl) : originalUri;
+    var netChannel;
+    try {
+      netChannel = NetUtil.newChannel(blobUri);
+    } catch (e) {
+      netChannel = NetUtil.newChannel(originalUri);
+    }
     var extHelperAppSvc =
           Cc['@mozilla.org/uriloader/external-helper-app-service;1'].
              getService(Ci.nsIExternalHelperAppService);
@@ -257,7 +263,6 @@ ChromeActions.prototype = {
                          getService(Ci.nsIWindowWatcher).activeWindow;
 
     var docIsPrivate = this.isInPrivateBrowsing();
-    var netChannel = NetUtil.newChannel(blobUri);
     if ('nsIPrivateBrowsingChannel' in Ci &&
         netChannel instanceof Ci.nsIPrivateBrowsingChannel) {
       netChannel.setPrivate(docIsPrivate);



More information about the tbb-commits mailing list