mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
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
1 changed files with 2 additions and 2 deletions
|
@ -2178,14 +2178,14 @@ const PDFViewerApplication = {
|
|||
},
|
||||
};
|
||||
|
||||
let validateFileURL;
|
||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
||||
const HOSTED_VIEWER_ORIGINS = [
|
||||
"null",
|
||||
"http://mozilla.github.io",
|
||||
"https://mozilla.github.io",
|
||||
];
|
||||
validateFileURL = function (file) {
|
||||
// eslint-disable-next-line no-var
|
||||
var validateFileURL = function (file) {
|
||||
if (!file) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue