1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

[CRX] Fixes to view local files again

pdfHandler-local.js references the isPdfDownloadable function from
pdfHandler.js, but the function didn't expect that the responseHeaders
property was absent. Added a check to prevent a runtime error when a
local file is displayed in a frame, and show local PDF files again.

Local files are rendered on the chrome-extension:-protocol. The previous
method of getting the PDF URL was incorrect, this has been fixed as well.
This commit is contained in:
Rob Wu 2013-08-14 23:36:40 +02:00
parent e5cd027dce
commit a4dd4b1789
2 changed files with 9 additions and 3 deletions

View file

@ -2259,13 +2259,19 @@ var DocumentOutlineView = function documentOutlineView(outline) {
document.addEventListener('DOMContentLoaded', function webViewerLoad(evt) {
PDFView.initialize();
//#if !(FIREFOX || MOZCENTRAL || CHROME)
//#if !(FIREFOX || MOZCENTRAL)
var params = PDFView.parseQueryString(document.location.search.substring(1));
var file = params.file || DEFAULT_URL;
//#else
//var file = window.location.href.split('#')[0];
//#endif
//#if CHROME
//if (location.protocol !== 'chrome-extension:') {
// file = location.href.split('#')[0];
//}
//#endif
//#if !(FIREFOX || MOZCENTRAL || CHROME)
var fileInput = document.createElement('input');
fileInput.id = 'fileInput';