Merge pull request #14566 from Snuffleupagus/misc-viewer-cleanup
Miscellaneous small viewer clean-up
This commit is contained in:
commit
d9a3a24353
@ -15,12 +15,16 @@
|
|||||||
|
|
||||||
const compatibilityParams = Object.create(null);
|
const compatibilityParams = Object.create(null);
|
||||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
||||||
const userAgent =
|
if (
|
||||||
(typeof navigator !== "undefined" && navigator.userAgent) || "";
|
typeof PDFJSDev !== "undefined" &&
|
||||||
const platform =
|
PDFJSDev.test("LIB") &&
|
||||||
(typeof navigator !== "undefined" && navigator.platform) || "";
|
typeof navigator === "undefined"
|
||||||
const maxTouchPoints =
|
) {
|
||||||
(typeof navigator !== "undefined" && navigator.maxTouchPoints) || 1;
|
globalThis.navigator = Object.create(null);
|
||||||
|
}
|
||||||
|
const userAgent = navigator.userAgent || "";
|
||||||
|
const platform = navigator.platform || "";
|
||||||
|
const maxTouchPoints = navigator.maxTouchPoints || 1;
|
||||||
|
|
||||||
const isAndroid = /Android/.test(userAgent);
|
const isAndroid = /Android/.test(userAgent);
|
||||||
const isIOS =
|
const isIOS =
|
||||||
@ -278,7 +282,7 @@ if (
|
|||||||
};
|
};
|
||||||
defaultOptions.locale = {
|
defaultOptions.locale = {
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
value: typeof navigator !== "undefined" ? navigator.language : "en-US",
|
value: navigator.language || "en-US",
|
||||||
kind: OptionKind.VIEWER,
|
kind: OptionKind.VIEWER,
|
||||||
};
|
};
|
||||||
defaultOptions.sandboxBundleSrc = {
|
defaultOptions.sandboxBundleSrc = {
|
||||||
|
@ -81,10 +81,9 @@ class PasswordPrompt {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
async close() {
|
||||||
this.overlayManager.close(this.overlayName).then(() => {
|
await this.overlayManager.close(this.overlayName);
|
||||||
this.input.value = "";
|
this.input.value = "";
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#verify() {
|
#verify() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user