Include additional data when fetching browser preferences in the PDF Viewer (bug 1908401)

To avoid having to request and await various browser data early during the PDF Viewer initialization, we can include that data in the existing preference fetching instead. With other planned changes to the PDF Viewer, the current situation would only become worse over time.

*Note:* Technically this data aren't preference-values, however we're already including other non-prefs in this list (e.g. `isInAutomation`) and doing it this way simplifies the overall implementation.
This commit is contained in:
Jonas Jenwald 2024-07-12 07:46:05 +02:00
parent 15b71b82ed
commit 99f34f4c2e
4 changed files with 23 additions and 56 deletions

View file

@ -56,6 +56,11 @@ const OptionKind = {
* primitive types and cannot rely on any imported types.
*/
const defaultOptions = {
allowedGlobalEvents: {
/** @type {Object} */
value: null,
kind: OptionKind.BROWSER,
},
canvasMaxAreaInBytes: {
/** @type {number} */
value: -1,
@ -66,6 +71,16 @@ const defaultOptions = {
value: false,
kind: OptionKind.BROWSER,
},
localeProperties: {
/** @type {Object} */
value: null,
kind: OptionKind.BROWSER,
},
nimbusDataStr: {
/** @type {string} */
value: "",
kind: OptionKind.BROWSER,
},
supportsCaretBrowsingMode: {
/** @type {boolean} */
value: false,