I have a credit card site that I need to create an account on. Apparently they want their account holders to use the same password on all websites so they have to pay out as much money as possible when the next big account breach happens. Toward this end they've decided to disable the clipboard use on the password field on their website to discourage their account holders from using password managers.
It's really strange that the Paste menu item in the browser context menu is greyed out for Firefox and IE11 users. For Chrome users the paste and paste as plain text context menu items are missing altogether.
I've been looking at the markup and JavaScript on their site and see that they've added event listeners to the keyboard and mouse events to block clipboard access to the password field, but what's really baffling is how they've managed to change the contents of the context menu that appears when the user right clicks on an input in a browser. The password field is just an input element with type of password.
<input readonly tabindex="51" maxlength="20" style="height: 22px; width: 200px;" class="gwt-PasswordTextBox gwt-PasswordTextBox-readonly gwt-Focus" type="password">
I'm not really interested in how to block Ctrl-V or intercepting the mouse's paste access to a field via JavaScript. I know how to do that. My question is how are they changing the contents of the browser's Context Menu. See the proof-of-concept on my answer for why this isn't the same as the other question.