Is this specific to PDFs, I wonder? It is possible that getFirstPartyURI is failing here not just because of the range requests but because pdf.js is fetching portions of the file in that case. It might not happen with all PDFs, depending on how pdf.js decides to do rendering.
I was wondering that, too. There are definitely larger pdfs that get rendered without range requests. Then there are large non-pdf downloads where the server is sending an Accept-Ranges header but no range requests are issued by the browser. So far, I don't have non-pdf range requests seen which would clarify if that is purely pdf related.
We could disable range requests easily in pdfjs but that is affecting rendering speed with unknown impact. Thus, this is no great idea to do without testing at least in one alpha. Fixing the root cause of the problem, an extension issuing XHRs and thus having no window associated to the channel, is no option for an untested stable patch either. Therefore, removing this issue from the 4.5 radar. :(
Trac: Keywords: tbb-4.5-alpha deleted, N/Aadded Owner: gk to tbb-team
PDFs, which are not affected, are going through catchall circuit too when PDF Download button is pressed.
UPDATE: this is one of two issues of #17933 (moved).
Trac: Severity: N/Ato Normal Sponsor: N/AtoN/A Reviewer: N/AtoN/A
Security Error: Content at https://kpdyer.com/publications/usenix2014-fte.pdf#disableRange=true may not load data from https://people.torproject.org/~gk/misc/range-request-test.html.Load denied by X-Frame-Options: https://kpdyer.com/publications/usenix2014-fte.pdf#disableRange=true does not permit cross-origin framing. (unknown)
Patch to disable range-based requests in pdf.js. Fixes the domain isolation issue, at the expense of usability. With this pref flipped, the entire pdf must be downloaded before being viewed and interacted with.
Trac: Keywords: TorBrowserTeam201801 deleted, TorBrowserTeam201801R added Status: assigned to needs_review
Okay, let's try that in the alpha series a bit. I admit, though, I am a bit skeptical whether the possible usability issues are worth it. We'll see.
But before that, two things:
s/cannot/can/ (it seems to me one negation is already enough :) )
extension-overrides.js is the wrong place for the patch. We don't treat pdf.js as en extension but rather as part of the browse core (after all it does not show up in the about:addons menu etc.). So, our usual prefs file, 000-tor-browser.js, would be the better place.
Trac: Status: needs_review to needs_revision Keywords: TorBrowserTeam201801R deleted, TorBrowserTeam201802 added
Unfortunately, the user_pref setting doesn't seem to stick when placed in the usual 000-tor-browser.js, and it gets overwritten by pdfjs initialization code if specified in the usual fashion (verified with an rbm build).
Unfortunately, the user_pref setting doesn't seem to stick when placed in the usual 000-tor-browser.js, and it gets overwritten by pdfjs initialization code if specified in the usual fashion (verified with an rbm build).
Maybe we should patch the above code instead and also add the the setting to 000-tor-browser.js as a reminder that we care about the value for pdfjs.disableRange. Probably gk should decide which approach we want to use.
How bad is performance when loading a large PDF with this change in place? I assume "time to first page display" increases significantly.