Change the casing of the originalURL
parameter, to originalUrl
, in the onOpenWithURL
method
The `onOpenWithURL` method, in `PDFViewerApplication.initPassiveLoading`, accepts a `originalURL` parameter which is then passed on to `PDFViewerApplication.open` as is. However, the latter method expects the name of the parameter to be `originalUrl` (note the casing), meaning that `getDocument` will fail in this case. For consistency, and to avoid confusion, the renaming is done in `web/chromecom.js` as well.
This commit is contained in:
parent
620da6f4df
commit
84920f39b2
@ -593,13 +593,13 @@ let PDFViewerApplication = {
|
||||
onOpenWithData(data) {
|
||||
PDFViewerApplication.open(data);
|
||||
},
|
||||
onOpenWithURL(url, length, originalURL) {
|
||||
onOpenWithURL(url, length, originalUrl) {
|
||||
let file = url, args = null;
|
||||
if (length !== undefined) {
|
||||
args = { length, };
|
||||
}
|
||||
if (originalURL !== undefined) {
|
||||
file = { url, originalURL, };
|
||||
if (originalUrl !== undefined) {
|
||||
file = { url, originalUrl, };
|
||||
}
|
||||
PDFViewerApplication.open(file, args);
|
||||
},
|
||||
|
@ -201,7 +201,7 @@ function requestAccessToLocalFile(fileUrl, overlayManager, callback) {
|
||||
let file = this.files[0];
|
||||
if (file) {
|
||||
let originalFilename = decodeURIComponent(fileUrl.split('/').pop());
|
||||
let originalURL = fileUrl;
|
||||
let originalUrl = fileUrl;
|
||||
if (originalFilename !== file.name) {
|
||||
let msg = 'The selected file does not match the original file.' +
|
||||
'\nOriginal: ' + originalFilename +
|
||||
@ -213,9 +213,9 @@ function requestAccessToLocalFile(fileUrl, overlayManager, callback) {
|
||||
}
|
||||
// There is no way to retrieve the original URL from the File object.
|
||||
// So just generate a fake path.
|
||||
originalURL = 'file:///fakepath/to/' + encodeURIComponent(file.name);
|
||||
originalUrl = 'file:///fakepath/to/' + encodeURIComponent(file.name);
|
||||
}
|
||||
callback(URL.createObjectURL(file), file.size, originalURL);
|
||||
callback(URL.createObjectURL(file), file.size, originalUrl);
|
||||
overlayManager.close('chromeFileAccessOverlay');
|
||||
}
|
||||
};
|
||||
@ -384,8 +384,8 @@ ChromeExternalServices.initPassiveLoading = function(callbacks) {
|
||||
let { overlayManager, } = PDFViewerApplication;
|
||||
// defaultUrl is set in viewer.js
|
||||
ChromeCom.resolvePDFFile(AppOptions.get('defaultUrl'), overlayManager,
|
||||
function(url, length, originalURL) {
|
||||
callbacks.onOpenWithURL(url, length, originalURL);
|
||||
function(url, length, originalUrl) {
|
||||
callbacks.onOpenWithURL(url, length, originalUrl);
|
||||
});
|
||||
};
|
||||
ChromeExternalServices.createDownloadManager = function(options) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user