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
@ -319,11 +319,9 @@ let PDFViewerApplication = {
|
|||||||
let enabled = hashParams['pdfbug'].split(',');
|
let enabled = hashParams['pdfbug'].split(',');
|
||||||
waitOn.push(loadAndEnablePDFBug(enabled));
|
waitOn.push(loadAndEnablePDFBug(enabled));
|
||||||
}
|
}
|
||||||
// Locale can be changed only when special debugging flags is present in
|
// It is not possible to change locale for the (various) extension builds.
|
||||||
// the hash section of the URL, or development version of viewer is used.
|
if ((typeof PDFJSDev === 'undefined' ||
|
||||||
// It is not possible to change locale for Firefox extension builds.
|
PDFJSDev.test('!PRODUCTION || GENERIC')) && 'locale' in hashParams) {
|
||||||
if ((typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION') ||
|
|
||||||
!PDFJSDev.test('FIREFOX || MOZCENTRAL')) && 'locale' in hashParams) {
|
|
||||||
AppOptions.set('locale', hashParams['locale']);
|
AppOptions.set('locale', hashParams['locale']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,11 +83,9 @@ const defaultOptions = {
|
|||||||
value: './images/',
|
value: './images/',
|
||||||
kind: OptionKind.VIEWER,
|
kind: OptionKind.VIEWER,
|
||||||
},
|
},
|
||||||
locale: {
|
/**
|
||||||
/** @type {string} */
|
* The `locale` is, conditionally, defined below.
|
||||||
value: (typeof navigator !== 'undefined' ? navigator.language : 'en-US'),
|
*/
|
||||||
kind: OptionKind.VIEWER,
|
|
||||||
},
|
|
||||||
maxCanvasPixels: {
|
maxCanvasPixels: {
|
||||||
/** @type {number} */
|
/** @type {number} */
|
||||||
value: viewerCompatibilityParams.maxCanvasPixels || 16777216,
|
value: viewerCompatibilityParams.maxCanvasPixels || 16777216,
|
||||||
@ -203,6 +201,14 @@ const defaultOptions = {
|
|||||||
kind: OptionKind.WORKER,
|
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);
|
const userOptions = Object.create(null);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user