Only define the validateFileURL
variable in GENERIC builds
There's no point in having this variable defined (implicitly) as `undefined` in e.g. the Firefox PDF Viewer. By defining it with `var` and using an ESLint ignore, rather than `let`, we can move it into the relevant pre-processor block instead. Note that since the entire viewer-code is placed, by Webpack, in a top-level closure this variable will thus not become globally accessible.
This commit is contained in:
parent
5a6cdffb4b
commit
0988915d06
@ -2178,14 +2178,14 @@ const PDFViewerApplication = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let validateFileURL;
|
|
||||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
||||||
const HOSTED_VIEWER_ORIGINS = [
|
const HOSTED_VIEWER_ORIGINS = [
|
||||||
"null",
|
"null",
|
||||||
"http://mozilla.github.io",
|
"http://mozilla.github.io",
|
||||||
"https://mozilla.github.io",
|
"https://mozilla.github.io",
|
||||||
];
|
];
|
||||||
validateFileURL = function (file) {
|
// eslint-disable-next-line no-var
|
||||||
|
var validateFileURL = function (file) {
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user