waldyrious / hash-my-pass

A bookmarklet to generate unique passwords per website, based on a single master password.
http://waldyrious.github.io/hash-my-pass/bookmarklet.min.html
Other
17 stars 4 forks source link

Silently fails on some sites #29

Open waldyrious opened 2 years ago

waldyrious commented 2 years ago

E.g. https://continente.pt. This is different from #28, since there's no error log in the console. I believe I used to be able to run the script on the site in the past, but can't be sure.

waldyrious commented 1 year ago

It seems that the issue is that there's an <input type=password> in the DOM, although it's not visible in the page.

To fix this, according to this SO answer, we would need to use something like:

pwd=document.querySelector("input[type='password']")
pwd.offsetParent === null

Note: window.getComputedStyle(pwd) could work in some cases, but in the case of continente.pt, the display property is set to "block", and visibility is set to "visible".

waldyrious commented 1 year ago

Hm, turns out I'm getting false positives with the offsetParent method. Perhaps an IntersectionObserver or checkVisibility() will be needed to make this work reliably.