You could do that. As you type into any <input type="password"> the browser would buffer the text and not send it through to the DOM immediately. When you hit enter, leave the field, submit the form, etc then it'd get sent through to the DOM where it'd be available to (potentially malicious) javascript. While the password is in the buffer the browser could check for "non-throwaway password + http" and block it if need be.
This does require the browser to know which passwords are which, though, at which point it might as well be entering them for you (and only being willing to do that over https).
Re:901614 – Adopt Tor as a feature in Firefox
by mistercow on Monday August 26, 2013 @02:56PM
(#6279117)
Ideally yes, but almost no sites send passwords as they are typed. The only likely situation where that would be a problem is if the site itself is compromised, in which case nothing can save you.
Re:901614 – Adopt Tor as a feature in Firefox
by nitrogen on Tuesday August 27, 2013 @01:22AM
(#6281621)
Not just a site compromise; a path compromise (malicious exit node, shady ISP, or fake WiFi access point) can inject Javascript in an unencrypted page. CA-signed SSL with cert pinning prevents MITM injection.
You'd need to warn them before they even start typing a password in on an http page.