Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GENERIC viewer] Don't display the errorWrapper, for documents with signatures (PR 13217 follow-up) #13249

Merged
merged 2 commits into from
Apr 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions l10n/en-US/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,3 @@ 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.
17 changes: 0 additions & 17 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1048,30 +1048,13 @@ const PDFViewerApplication = {
featureId,
});

// Don't show the fallback bar for things that are *very* unlikely to cause
// user-visible errors, to avoid bothering the user unnecessarily.
switch (featureId) {
case UNSUPPORTED_FEATURES.errorFontLoadNative:
case UNSUPPORTED_FEATURES.errorFontMissing:
return;
}
// Only trigger the fallback once so we don't spam the user with messages
// for one PDF.
if (this._fellback) {
return;
}
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,
Expand Down
2 changes: 0 additions & 2 deletions web/l10n_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ 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) {
Expand Down