From 4b94416277852b160445e2c9facc522be4dd1b8e Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 20 Jan 2016 13:54:19 +0100 Subject: [PATCH] Set type="password" for the `PasswordPrompt` input dynamically, to prevent unnecessary warnings in Firefox for http:// documents (issue 6898) Fixes 6898. Note that this doesn't prevent the warning for PDF files that *do* ask for a password, e.g. http://async5.org/moz/passwordOU.pdf, but it's not clear to me if/how we could avoid that. --- web/password_prompt.js | 2 ++ web/viewer.html | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/web/password_prompt.js b/web/password_prompt.js index 4bd630e24..d2d1e2070 100644 --- a/web/password_prompt.js +++ b/web/password_prompt.js @@ -49,6 +49,7 @@ var PasswordPrompt = { open: function passwordPromptOpen() { OverlayManager.open(this.overlayName).then(function () { + this.passwordField.type = 'password'; this.passwordField.focus(); var promptString = mozL10n.get('password_label', null, @@ -66,6 +67,7 @@ var PasswordPrompt = { close: function passwordPromptClose() { OverlayManager.close(this.overlayName).then(function () { this.passwordField.value = ''; + this.passwordField.type = ''; }.bind(this)); }, diff --git a/web/viewer.html b/web/viewer.html index e5fb76293..fc8d2f70a 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -331,7 +331,8 @@ See https://github.com/adobe-type-tools/cmap-resources

Enter the password to open this PDF file:

- + +