mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Merge pull request #11825 from Snuffleupagus/extensions-viewer-less-AppOptions-lookup
Avoid reading the "disablePreferences"/"locale" options, when initializing the viewer, in extension builds
This commit is contained in:
commit
571f287983
2 changed files with 18 additions and 15 deletions
14
web/app.js
14
web/app.js
|
@ -229,7 +229,11 @@ const PDFViewerApplication = {
|
|||
* @private
|
||||
*/
|
||||
async _readPreferences() {
|
||||
if (AppOptions.get("disablePreferences") === true) {
|
||||
if (
|
||||
(typeof PDFJSDev === "undefined" ||
|
||||
PDFJSDev.test("!PRODUCTION || GENERIC")) &&
|
||||
AppOptions.get("disablePreferences")
|
||||
) {
|
||||
// Give custom implementations of the default viewer a simpler way to
|
||||
// opt-out of having the `Preferences` override existing `AppOptions`.
|
||||
return;
|
||||
|
@ -328,9 +332,11 @@ const PDFViewerApplication = {
|
|||
* @private
|
||||
*/
|
||||
async _initializeL10n() {
|
||||
this.l10n = this.externalServices.createL10n({
|
||||
locale: AppOptions.get("locale"),
|
||||
});
|
||||
this.l10n = this.externalServices.createL10n(
|
||||
typeof PDFJSDev === "undefined" || PDFJSDev.test("!PRODUCTION || GENERIC")
|
||||
? { locale: AppOptions.get("locale") }
|
||||
: null
|
||||
);
|
||||
const dir = await this.l10n.getDirection();
|
||||
document.getElementsByTagName("html")[0].dir = dir;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue