Skip to content

Commit

Permalink
[Credentials] Autofill when elements are in shadow (#592)
Browse files Browse the repository at this point in the history
Currently if a form contains elements that are within shadow root, the auto scanner misses out on all the elements of the form, and fails to categorize the inputs, although it does pierce through the shadow and find the hidden input element that was clicked on. This PR expands that a bit more:

When any of the input elements are clicked, scanner tries to find the parent form (using getParentForm),
getParentForm code was modified to traverse through the shadow boundary, and find the enclosing form element,
The found parent form is then passed to findEligibleInputs, which was also modified to find other related inputs in the form that are hidden.
TLDR; This way essentially we do a two way scan - identify the clicked input which is in the shadow, traverse up the form and find the closest form and then build out the rest of the form from there.
  • Loading branch information
dbajpeyi committed Jul 19, 2024
1 parent ac2d162 commit 88c8291
Show file tree
Hide file tree
Showing 13 changed files with 550 additions and 93 deletions.
101 changes: 84 additions & 17 deletions dist/autofill-debug.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 88c8291

Please sign in to comment.