Merge pull request #3573 from Rob--W/crx-view-local-files

[CRX] Fixes to view local files again
This commit is contained in:
Yury Delendik 2013-08-21 07:37:32 -07:00
commit bde863a8ac
2 changed files with 9 additions and 3 deletions

View File

@ -31,8 +31,8 @@ function isPdfDownloadable(details) {
// if the file is displayed in the main frame.
if (details.type == 'main_frame')
return false;
var cdHeader = getHeaderFromHeaders(details.responseHeaders,
'content-disposition');
var cdHeader = details.responseHeaders &&
getHeaderFromHeaders(details.responseHeaders, 'content-disposition');
return cdHeader && /^attachment/i.test(cdHeader.value);
}

View File

@ -2293,13 +2293,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';