mozilla/pdf.js — Issue #873: Opening PDF via file: in viewer fails with error
Author: ajlyon
Created: 2011-12-05 05:45:29+00:00
State: open

On opening a local file by URL, the viewer (viewer.html, latest XPI from the master branch) fails to open it, with the error message: "Message: Unexpected server response of 0."

For example, for a PDF in /tmp/1.pdf:

Opening the PDF by clicking Browse in the viewer works, and the PDF loads. When the PDF has loaded, the address bar shows:
chrome://pdf.js/content/web/viewer.html?file=file%3A%2F%2F%2Ftmp%2F1.pdf

But if I enter the very same address into the address bar directly, or any other path to a local PDF, I get the error above.

It looks like there is logic to not error out on a 0 response in core.js:34, but there's something preventing that from working in this case.