In fill-credentials.lisp, I have rudimentary filling in of login credentials which can be made semi-automatic from buffer-loaded-hook if you load it and do something like
The entry-point is a command fill-credentials which offers a choice of credentials and tries to fill in a login on the current page. The hook calls this if it sees a login on the page.
Limitations:
I have only implemented the unix password-store password-interface (though experts should be able to fill in the details for the other password-interfaces).
The detection of logins is super-primitive and a work in progress. Any wisdom or prior art here would be gratefully received.
The code is very clunky! In particular, I would appreciate a better way of detecting whether a page has an element with a given attribute (would the new dom stuff help here?).
In any case, maybe someone else will find this useful/amusing/a starting point for something better!
Yes, new DOM could be of help there! You could find password field with (clss:select "input[type="password" (nyxt/web-mode:document-model (current-mode 'web))). The node you get this way you can recursively ascend to the plump:parent of. Then you can look for inputs that are not the password one, inside the parent elements.
Thanks! I realised how to do this an hour after I made the original post. The clss:select approach is easier to reason about than my parenscript approach but runs 10 times slower (though maybe that doesn't matter: it is still fast). This may be the way forward.
See element-hint.lisp for examples of function that act on our DOM. In short, define-parenscript that will look for a certain nyxt-identifier in JS DOM and act on it in JS world.