So, first off DISCLAIMER: This is experimental code and is under development. If you want to use it, you'll have to install it as a developer extension (or sim.).
When you click the extension button, it essentially goes through your webpage, finds all the <input
fields with type="password"
(by just parsing the document.getElementsByTagName
list) and then assigns them a new onpaste handler as follows:
var inputFields = document.getElementsByTagName('input');
for (var i = 0; i < inputFields.length; i++) {
var field = inputFields[i];
if (field.type == "password") {
field.onpaste = function(e) { this.value = e.clipboardData.getData('text/plain'); };
}
}
Much of the magic I have taken from this blog post: https://www.smashingmagazine.com/2017/04/browser-extension-edge-chrome-firefox-opera-brave-vivaldi/
This package should be agnostic across several different browsers and extension formats as they are mostly homogenous. It almost certainly won't work on Safari, but I'm sure someone will fix that.
- Go to
about:debugging
- click 'Load Temporary Add-on'
- Navigate to the
build/
directory and choose the extension zip file. - The extension is now enabled
The only problem with this is that you'll have to reload it every time you restart the browser. This will, ofc, change if and when it gets sent up to any platform.
- Go to
chrome://extensions
- Enable the slider for 'Developer mode' (top right, usually)
- Click on 'Load Unpacked Extension'
- Navigate to the
build/
directory in this repo and select the extension zip file. - The extension should now be loaded.
- Go to
about:flags
- Check "Enable Developer Features"
- click on '...'
- 'Load Extension' and navigate to the
build/
folder - Select the extension zip file
- Confirm 'Show button next to address bar'
This is some magic I doth not know... Sorry peeps... I think the blog post above explains how to do it, but I haven't tried it. YMMV.
It's under MIT license, because this makes the most sense. :-)