From 02aa5610034bdbfb2f9b410038126dd407203853 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 30 Jul 2023 17:13:39 +0200 Subject: [PATCH 1/2] Ensure that the password dialog is always closed with the document If the current PDF document is closed while the password dialog is open, e.g. manually by calling `PDFViewerApplication.close()` from the console, the password dialog wouldn't be closed as intended. *Please note:* This could only affect the GENERIC viewer, although it's very unlikely to ever happen, since that's the only one that supports opening more than one PDF document. --- web/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/app.js b/web/app.js index 451d05f76..b3a1cf055 100644 --- a/web/app.js +++ b/web/app.js @@ -1005,7 +1005,10 @@ const PDFViewerApplication = { this._saveInProgress = false; this._hasAnnotationEditors = false; - promises.push(this.pdfScriptingManager.destroyPromise); + promises.push( + this.pdfScriptingManager.destroyPromise, + this.passwordPrompt.close() + ); this.setTitle(); this.pdfSidebar?.reset(); From ffb932b84a247389763c1528b90e2ba6294d00e8 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 30 Jul 2023 17:23:21 +0200 Subject: [PATCH 2/2] [GeckoView] Add missing CSS variables for the dialog functionality Without this patch the password dialog is pretty difficult to use in the GeckoView-viewer, because of a number of missing CSS variables. *Please note:* This patch makes no effort at actually styling the dialog to better suite the overall look of the GeckoView-viewer, but focuses solely on making it actually usable (since password protected PDF documents are somewhat rare). --- web/viewer-geckoview.css | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/viewer-geckoview.css b/web/viewer-geckoview.css index 9ca9287ee..b0823a57c 100644 --- a/web/viewer-geckoview.css +++ b/web/viewer-geckoview.css @@ -26,6 +26,10 @@ --body-bg-color: rgba(212, 212, 215, 1); --scrollbar-color: auto; --scrollbar-bg-color: auto; + --field-color: rgba(6, 6, 6, 1); + --field-bg-color: rgba(255, 255, 255, 1); + --field-border-color: rgba(187, 187, 188, 1); + --doorhanger-bg-color: rgba(255, 255, 255, 1); --dialog-button-border: none; --dialog-button-bg-color: rgba(12, 12, 13, 0.1); --dialog-button-hover-bg-color: rgba(12, 12, 13, 0.3); @@ -48,6 +52,10 @@ --body-bg-color: rgba(42, 42, 46, 1); --scrollbar-color: rgba(121, 121, 123, 1); --scrollbar-bg-color: rgba(35, 35, 39, 1); + --field-color: rgba(250, 250, 250, 1); + --field-bg-color: rgba(64, 64, 68, 1); + --field-border-color: rgba(115, 115, 115, 1); + --doorhanger-bg-color: rgba(74, 74, 79, 1); --dialog-button-bg-color: rgba(92, 92, 97, 1); --dialog-button-hover-bg-color: rgba(115, 115, 115, 1); @@ -62,6 +70,7 @@ --dialog-button-border: 1px solid Highlight; --dialog-button-hover-bg-color: Highlight; --dialog-button-hover-color: ButtonFace; + --field-border-color: ButtonText; --main-color: CanvasText; } }