Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert the password prompt to ES6 syntax #8293

Merged
merged 2 commits into from
Apr 16, 2017

Conversation

timvandermeij
Copy link
Contributor

@timvandermeij timvandermeij commented Apr 15, 2017

Moreover, remove the password prompt input type hack since it is no longer functional.

You can use http://async5.org/moz/passwordOU.pdf (password: 123456) to test this.

Easier review with https://github.com/mozilla/pdf.js/pull/8293/files?w=1.

@@ -33,12 +33,12 @@ import { PasswordResponses } from './pdfjs';
/**
* @class
Copy link
Collaborator

@Snuffleupagus Snuffleupagus Apr 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious if we still need this comment, now that the thing below is an actual proper Class?

Edit: Looking at http://usejsdoc.org/howto-es2015-classes.html, I'm guessing that the answer is that we don't need it any more :-)

Copy link
Contributor Author

@timvandermeij timvandermeij Apr 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find! Good to know that we can remove these comments as well.

Done in the new commit.

@@ -33,12 +33,12 @@ import { PasswordResponses } from './pdfjs';
/**
* @class
*/
var PasswordPrompt = (function PasswordPromptClosure() {
class PasswordPrompt {
/**
* @constructs PasswordPrompt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, since the thing below is now a constructor, I think that this line is now superfluous.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in the new commit.

The browsers have become smarter and made this hack no longer
functional. Since this is now enforced by practically all browsers,
there is nothing more we can do about this. It is up to the user to
serve the viewer over HTTPS or deal with the warning.

Note that this is in no way specific for PDF.js. Any site with password
inputs served over HTTP has this problem right now. This hack was
provided as a convenience for the users, but nothing more than that.
@timvandermeij
Copy link
Contributor Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/f0c33786b8c20ca/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/f0c33786b8c20ca/output.txt

Total script time: 2.92 mins

Published

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting rid of a bunch of boilerplate code, not to mention a couple of bind calls, is simply great; thank you for the patch(es)!

@Snuffleupagus Snuffleupagus merged commit 10592a3 into mozilla:master Apr 16, 2017
@timvandermeij timvandermeij deleted the es6-password-prompt branch April 16, 2017 13:47
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants