Password reveal button not always placed correctly
After removing the dependency on jquery for the whole extension, my custom password reveal button is not always positioned correctly in relation to the password field.
Goals
- Improved placement algorithm for the reveal button
I've encountered this a lot. It would be nice if this could be disabled via a setting as well--I generally don't use that button in favor of the url bar toggle.
I haven't had much time to work on the extension recently, I'll look into adding an option to disable the reveal button, as fixing the positioning is rather harder than adding another option.
I can maybe poke at it if you give me a bit of guidance on where to look.
The button is implemented by hand using some javascript in https://github.com/simu/passwordhasherplus/blob/b9c7f7cccb742028af4760d33654d1f4e803164b/content-script.js#L57-L85
A new option can be implemented in options.html/options.js and used in content-script.js to not create the button by simply not calling createMaskButton() in bind().
I created https://github.com/simu/passwordhasherplus/pull/23 to have an option to disable the button and I'm working on fixing the styles to just anchor it to the bottom right corner. I just need to finish testing my changes, then I'll have a PR for that too.
I created https://github.com/simu/passwordhasherplus/pull/25 to fix the button placement as well as a few other minor things. If #23 lands first, I'll have to rebase #25 to handle the new place to call requestAnimationFrame, otherwise I'll have to rebase #23 to do it. Either way, let me know and I'll get the other fixed up.
@lord2800 thanks for the contributions, I'll try to have a look ASAP
@lord2800 Sorry for the long delay, work was super busy. I've merged #23. #25 LGTM as well under the assumption that the new call site to initAllElements is properly updated.
On it!
While #25 and #28 improve the positioning on some pages, others still struggle, e.g. gitlab.com:

I'm going to leave this issue open for now, in case someone (or myself when I'm bored enough) can try to come up with a better way. I think what's missing is that the content-script.js isn't really able to react correctly when already existing elements are moved around. Maybe there's a way to subscribe on position updates for individual elements and react to those, but that's an idea for another day.
I'll see what I can do! Knowing that gitlab has an issue still makes it easier for me to test out different solutions.
Other pages which I've found where the button is still placed weird are:
- Google
Interesting. I explicitly tested there too. :(
maybe my changes to make it work on my default test (https://store.steampowered.com/login/?redir=&redir_ssl=1) (cf. #28) broke it on Google again, but that just shows that it's really tricky to get this right in all cases :(