1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Add basic validation of the AppOptions BROWSER-kind

This commit is contained in:
Jonas Jenwald 2024-07-21 09:32:36 +02:00
parent 7bd920691f
commit 26989fdf24

View file

@ -477,6 +477,15 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING || LIB")) {
) {
throw new Error(`Invalid value for "PREFERENCE" kind: ${name}`);
}
} else if (kind & OptionKind.BROWSER) {
if (typeof compatParams === "object" && compatParams.has(name)) {
throw new Error(
`Should not have compatibility-value for "BROWSER" kind: ${name}`
);
}
if (value === undefined) {
throw new Error(`Invalid value for "BROWSER" kind: ${name}`);
}
}
}
}