-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Convert the password prompt to ES6 syntax #8293
Conversation
web/password_prompt.js
Outdated
@@ -33,12 +33,12 @@ import { PasswordResponses } from './pdfjs'; | |||
/** | |||
* @class |
There was a problem hiding this comment.
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 :-)
There was a problem hiding this comment.
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.
web/password_prompt.js
Outdated
@@ -33,12 +33,12 @@ import { PasswordResponses } from './pdfjs'; | |||
/** | |||
* @class | |||
*/ | |||
var PasswordPrompt = (function PasswordPromptClosure() { | |||
class PasswordPrompt { | |||
/** | |||
* @constructs PasswordPrompt |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
29ec637
to
dfd338a
Compare
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/f0c33786b8c20ca/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/f0c33786b8c20ca/output.txt Total script time: 2.92 mins Published |
There was a problem hiding this 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)!
Convert the password prompt to ES6 syntax
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.