Keepassxc-browser: Question: How does this plugin find the input fields it wants?

Created on 4 Jan 2019  路  4Comments  路  Source: keepassxreboot/keepassxc-browser

I tried going through the code, but it's a huge mess (to me)

Thought I could improve some parts, but never figured out how any of it works

question

All 4 comments

The input field detection happens in keepassxc-browser.jsfile.
Basically only the function cipObserverHelper.getInputs() is used. It returns all input fields from the target element, which can be for example a div or the whole document. This function is called from several places, but also dynamically from MutationObserver when new elements are added or removed from the page.

Four additional checks are made in that function, which are:

  • Checks the target element nodeType and returns if it's not an element
  • Adds all non-hidden type input elements to an array (it's faster to ignore hidden elements here)
  • Only include first hundred input fields from the element/document (even that is quite.. suspicious)
  • Accept only input fields with type text, email, password, tel, number, username and fields without type set

The same detection is used in cipFields.getAllFields() but it extends the function above by ignoring any input fields that are not visible in the page or are not identified as a search field. This is not added to the basic checking because it's not needed every time.

I guess you can close this. Question answered. :smiley:

I want to leave this open for visibility :)

People can always search for it, thanks btw

Was this page helpful?
0 / 5 - 0 ratings