[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser/tor-browser-38.2.1esr-5.5-2] fixup! Bug #15502: Isolate blob, mediasource & mediastream URLs to first party



commit d97c1f91bd955e6d7aa9bcb086fceb3d1edbcdf2
Author: Kathy Brade <brade@xxxxxxxxxxxxxxxxx>
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);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits