From 26989fdf24fa526e8e8f95995deaf6b0bd28e47e Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 21 Jul 2024 09:32:36 +0200 Subject: [PATCH] Add basic validation of the AppOptions `BROWSER`-kind --- web/app_options.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/app_options.js b/web/app_options.js index 4e5a7e88d..962cac375 100644 --- a/web/app_options.js +++ b/web/app_options.js @@ -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}`); + } } } }