Opened 4 years ago

Closed 4 years ago

#15899 closed defect (fixed)

PDF files cannot be downloaded in Tor Browser 4.5 via the PDF viewer

Reported by: gk Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Keywords: tbb-4.5-regression, tbb-usability, TorBrowserTeam201505R
Cc: arthuredelstein, gk Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

PDF files cannot be downloaded in Tor Browser 4.5 anymore. One gets an error back:

************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "Access to restricted URI denied"  code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)"  location: "<unknown>"]
************************************************************

This is working fine in 4.5a5. Looking at the fix for #15502 I highly suspect this is the culprit.

Child Tickets

Change History (12)

comment:1 Changed 4 years ago by arthuredelstein

With this PDF,
http://cs.brynmawr.edu/Courses/cs380/fall2012/CrickCentralDogma1970.pdf
I get
TypeError: Permission to call 'URL.createObjectURL' denied. pdf.worker.js:1051
in the web console. I guess this is probably the same error?

I'm working on a fix.

comment:2 Changed 4 years ago by arthuredelstein

Status: newneeds_review

comment:3 Changed 4 years ago by arthuredelstein

Keywords: TorBrowserTeam201505R added; TorBrowserTeam201505 removed

comment:4 Changed 4 years ago by gk

Keywords: GeorgKoppen201505R added

comment:5 in reply to:  1 Changed 4 years ago by gk

Status: needs_reviewneeds_revision
Summary: PDF files cannot be downloaded in Tor Browser 4.5PDF files cannot be downloaded in Tor Browser 4.5 via the pdf viewer

Replying to arthuredelstein:

With this PDF,
http://cs.brynmawr.edu/Courses/cs380/fall2012/CrickCentralDogma1970.pdf
I get
TypeError: Permission to call 'URL.createObjectURL' denied. pdf.worker.js:1051
in the web console. I guess this is probably the same error?

I don't think so. The code that generates the error in my bug description is https://gitweb.torproject.org/tor-browser.git/tree/browser/extensions/pdfjs/content/web/viewer.js?h=tor-browser-31.6.0esr-4.5-1#n536. And its effect is that you can't download pdf files if you are clicking on the download symbol in the pdf viewer. It seems I should have made the latter clearer (I assumed everyone is downloading pdf files this way, actually :) ).

comment:6 Changed 4 years ago by gk

Summary: PDF files cannot be downloaded in Tor Browser 4.5 via the pdf viewerPDF files cannot be downloaded in Tor Browser 4.5 via the PDF viewer

comment:7 Changed 4 years ago by gk

Keywords: TorBrowserTeam201505 added; TorBrowserTeam201505R GeorgKoppen201505R removed

comment:8 Changed 4 years ago by mikeperry

There are actually a few different ways to download a pdf in the pdf.js UI. On the assumption that this fixes one of them, I've merged it into the pre-rebased 4.5 branch. My plan is to list this in the changelog as a partial fix, unless we can also fix the other issue before we start building.

gk - Can you describe the exact UI path to the issue you experienced?

comment:9 Changed 4 years ago by arthuredelstein

Here's an additional fix for the bug gk reported:
https://github.com/arthuredelstein/tor-browser/commit/d83ab28b170642e95b15b56f0a775067ed9fa422

With this fix, I was able to download a PDF to disk using

  • The pdf.js toolbar "Download" button (as described by gk)
  • Choosing "Save Page As..." from the Tor Browser File menu
  • Choosing "Save Page As..." by right-clicking on the PDF document

comment:10 Changed 4 years ago by arthuredelstein

Keywords: TorBrowserTeam201505R added; TorBrowserTeam201505 removed
Status: needs_revisionneeds_review

comment:11 Changed 4 years ago by gk

Looks good to me now. Thanks, Arthur.

comment:12 Changed 4 years ago by mikeperry

Resolution: fixed
Status: needs_reviewclosed

Merged for 4.5.1.

Note: See TracTickets for help on using tickets.