Skip to content

Commit

Permalink
Merge pull request #6900 from Snuffleupagus/issue-6898
Browse files Browse the repository at this point in the history
Set type="password" for the `PasswordPrompt` input dynamically, to prevent unnecessary warnings in Firefox for http:// documents (issue 6898)
  • Loading branch information
yurydelendik committed Jan 20, 2016
2 parents 1eea0db + 4b94416 commit 2327482
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions web/password_prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -66,6 +67,7 @@ var PasswordPrompt = {
close: function passwordPromptClose() {
OverlayManager.close(this.overlayName).then(function () {
this.passwordField.value = '';
this.passwordField.type = '';
}.bind(this));
},

Expand Down
3 changes: 2 additions & 1 deletion web/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@
<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>
Expand Down

0 comments on commit 2327482

Please sign in to comment.