Detect login fields with a scoring classifier instead of heuristics
field-detect.js is a pure UMD module: every input becomes a descriptor
(name/id/placeholder/aria-label/label text, visibility state, type,
autocomplete token) scored against multilingual keyword tables with
anti-keywords for traps (search, newsletter, cc, otp and now repeat-
password fields). findLoginTargets pairs one username with one password
per form context, merges confirm-password pairs, and falls back to the
closest preceding input in anonymous SPA forms.

content.js reduces to DOM probing (descriptor building + scan) and the
card/interceptor flow; the manifest loads field-detect.js first.

The module is unit-tested without a browser via tools/test-field-detect.js
(16 plain-node cases over a fake tree) and verified end-to-end in Chromium
on a page mixing russian placeholders, newsletter/search/otp/cc traps and
a confirm-password signup form: three cards, correct pairs, Use fills the
right fields only.

Makefile: the per-file $(SRC) replaces the directory prerequisite (a
stale edit inside src/ never rebuilt the bundles), recipes copy with
cp --parents, and make test runs the node suite.

Co-Authored-By: Claude Code <noreply@anthropic.com>
1 parent 569f503 commit 4b7e292515e6c6e6b4da36852ce96db635953289
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 3 hours ago
Showing 5 changed files
View
extensions/extension/Makefile
View
extensions/extension/manifest.json
View
extensions/extension/src/content.js
View
extensions/extension/src/field-detect.js 0 → 100644
View
extensions/extension/tools/test-field-detect.js 0 → 100644