A couple years back, I had some fun proof-of-concepting the terrible UX of preventing password managers or pasting passwords.
It can get so much worse than just an alert()
when right-clicking.
A small note: It doesn't work with mobile virtual keyboards, since they don't send keystrokes. Maybe that's a bug, or maybe it's a security feature ;)
But yeah, best tried with a laptop or desktop computer.
How it detects password managers:
-
Unexpected CSS or DOM changes to the
input
element, such as an icon overlay for LastPass. -
Paste event listening.
-
Right clicking.
-
Detecting if more than one character is inserted or deleted at a time.
In hindsight, it could be even worse by using Object.defineProperty
to check if the value
property is manipulated or if setAttribute
is called with the value
attribute.