mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Ensure that the locale
viewer option is never defined in the (various) extension builds (PR 9493 follow-up)
This commit is contained in:
parent
275834ae66
commit
c8384061cf
2 changed files with 14 additions and 10 deletions
|
@ -83,11 +83,9 @@ const defaultOptions = {
|
|||
value: './images/',
|
||||
kind: OptionKind.VIEWER,
|
||||
},
|
||||
locale: {
|
||||
/** @type {string} */
|
||||
value: (typeof navigator !== 'undefined' ? navigator.language : 'en-US'),
|
||||
kind: OptionKind.VIEWER,
|
||||
},
|
||||
/**
|
||||
* The `locale` is, conditionally, defined below.
|
||||
*/
|
||||
maxCanvasPixels: {
|
||||
/** @type {number} */
|
||||
value: viewerCompatibilityParams.maxCanvasPixels || 16777216,
|
||||
|
@ -203,6 +201,14 @@ const defaultOptions = {
|
|||
kind: OptionKind.WORKER,
|
||||
},
|
||||
};
|
||||
if (typeof PDFJSDev === 'undefined' ||
|
||||
PDFJSDev.test('!PRODUCTION || GENERIC')) {
|
||||
defaultOptions.locale = {
|
||||
/** @type {string} */
|
||||
value: (typeof navigator !== 'undefined' ? navigator.language : 'en-US'),
|
||||
kind: OptionKind.VIEWER,
|
||||
};
|
||||
}
|
||||
|
||||
const userOptions = Object.create(null);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue