fix: make auth login selector targeting more reliable (#945)

Navigate with load, then wait for username/password/submit selectors using the default action timeout. This avoids networkidle hangs on pages with continuous background requests.
This commit is contained in:
Kevin Kipp
2026-03-20 09:01:00 -05:00
committed by GitHub
parent 8d14ecb92b
commit aed466b347
9 changed files with 354 additions and 34 deletions
+2
View File
@@ -259,6 +259,8 @@ Save options:
- `--password-selector <sel>` -- custom CSS selector for password field
- `--submit-selector <sel>` -- custom CSS selector for submit button
`auth login` navigates with `load` and then waits for the username/password/submit selectors to appear before interacting. This improves reliability on SPA login pages where fields render after initial page load.
```bash
echo "pass" | agent-browser auth save github --url https://github.com/login --username user --password-stdin
agent-browser auth login github
+2
View File
@@ -47,6 +47,8 @@ agent-browser auth show github
agent-browser auth delete github
```
`auth login` navigates with the `load` lifecycle event and then waits for form selectors to appear before filling/clicking. This makes delayed SPA login pages more reliable while avoiding `networkidle` hangs on pages with long-lived background requests.
Custom selectors can be specified if auto-detection fails:
```bash