[Pkg-javascript-commits] [pdf.js] 141/414: Set type="password" for the `PasswordPrompt` input dynamically, to prevent unnecessary warnings in Firefox for http:// documents (issue 6898)

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:12:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 4b94416277852b160445e2c9facc522be4dd1b8e
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Wed Jan 20 13:54:19 2016 +0100

    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 4bd630e..d2d1e20 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 e5fb762..fc8d2f7 100644
--- a/web/viewer.html
+++ b/web/viewer.html
@@ -331,7 +331,8 @@ See https://github.com/adobe-type-tools/cmap-resources
               <p id="passwordText" data-l10n-id="password_label">Enter the password to open this PDF file:</p>
             </div>
             <div class="row">
-              <input type="password" id="password" class="toolbarField" />
+              <!-- The type="password" attribute is set via script, to prevent warnings in Firefox for all http:// documents. -->
+              <input id="password" class="toolbarField" />
             </div>
             <div class="buttonRow">
               <button id="passwordCancel" class="overlayButton"><span data-l10n-id="password_cancel">Cancel</span></button>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list