diff --git a/l10n/en-US/viewer.properties b/l10n/en-US/viewer.properties index 5fe094b769b28..1a7b908ebe88d 100644 --- a/l10n/en-US/viewer.properties +++ b/l10n/en-US/viewer.properties @@ -246,3 +246,6 @@ password_cancel=Cancel printing_not_supported=Warning: Printing is not fully supported by this browser. printing_not_ready=Warning: The PDF is not fully loaded for printing. web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts. +# LOCALIZATION NOTE (unsupported_feature_signatures): Should contain the same +# exact string as in the `chrome.properties` file. +unsupported_feature_signatures=This PDF document contains digital signatures. Validation of signatures is not supported. diff --git a/web/app.js b/web/app.js index d2287dcbd950f..6d74eb6c3a035 100644 --- a/web/app.js +++ b/web/app.js @@ -198,7 +198,7 @@ class DefaultExternalServices { const PDFViewerApplication = { initialBookmark: document.location.hash.substring(1), _initializedCapability: createPromiseCapability(), - fellback: false, + _fellback: false, appConfig: null, pdfDocument: null, pdfLoadingTask: null, @@ -830,6 +830,7 @@ const PDFViewerApplication = { this.pdfDocumentProperties.setDocument(null); } webViewerResetPermissions(); + this._fellback = false; this.store = null; this.isInitialViewSet = false; this.downloadComplete = false; @@ -1056,10 +1057,21 @@ const PDFViewerApplication = { } // Only trigger the fallback once so we don't spam the user with messages // for one PDF. - if (this.fellback) { + if (this._fellback) { return; } - this.fellback = true; + this._fellback = true; + + // Ensure that, for signatures, a warning is shown in non-Firefox builds. + if ( + (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) && + featureId === UNSUPPORTED_FEATURES.signatures + ) { + this.l10n.get("unsupported_feature_signatures").then(msg => { + this._otherError(msg); + }); + } + this.externalServices .fallback({ featureId, diff --git a/web/l10n_utils.js b/web/l10n_utils.js index 04e8a549dba30..ef3d21c115598 100644 --- a/web/l10n_utils.js +++ b/web/l10n_utils.js @@ -81,6 +81,8 @@ const DEFAULT_L10N_STRINGS = { printing_not_ready: "Warning: The PDF is not fully loaded for printing.", web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts.", + unsupported_feature_signatures: + "This PDF document contains digital signatures. Validation of signatures is not supported.", }; function getL10nFallback(key, args) { diff --git a/web/viewer.css b/web/viewer.css index 442f575809585..138519a0044f4 100644 --- a/web/viewer.css +++ b/web/viewer.css @@ -26,7 +26,7 @@ --main-color: rgba(12, 12, 13, 1); --body-bg-color: rgba(237, 237, 240, 1); - --errorWrapper-bg-color: rgba(255, 74, 74, 1); + --errorWrapper-bg-color: rgba(255, 110, 110, 1); --progressBar-color: rgba(10, 132, 255, 1); --progressBar-indeterminate-bg-color: rgba(221, 221, 222, 1); --progressBar-indeterminate-blend-color: rgba(116, 177, 239, 1); @@ -101,7 +101,7 @@ :root { --main-color: rgba(249, 249, 250, 1); --body-bg-color: rgba(42, 42, 46, 1); - --errorWrapper-bg-color: rgba(199, 17, 17, 1); + --errorWrapper-bg-color: rgba(169, 14, 14, 1); --progressBar-color: rgba(0, 96, 223, 1); --progressBar-indeterminate-bg-color: rgba(40, 40, 43, 1); --progressBar-indeterminate-blend-color: rgba(20, 68, 133, 1);