Merge pull request #14959 from Snuffleupagus/pageColors-thumbnails

Support custom `pageColors` in the thumbnails (PR 14874)
This commit is contained in:
Jonas Jenwald 2022-05-28 15:46:06 +02:00 committed by GitHub
commit d80035b716
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 52 additions and 12 deletions

View file

@ -270,13 +270,15 @@ class BaseViewer {
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
if (
options.pageColors &&
(!CSS.supports("color", options.pageColors.background) ||
!CSS.supports("color", options.pageColors.foreground))
this.pageColors &&
!(
CSS.supports("color", this.pageColors.background) &&
CSS.supports("color", this.pageColors.foreground)
)
) {
if (options.pageColors.background || options.pageColors.foreground) {
if (this.pageColors.background || this.pageColors.foreground) {
console.warn(
"Ignoring `pageColors`-option, since the browser doesn't support the values used."
"BaseViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."
);
}
this.pageColors = null;