Skip to content

fix(google): print number match prompt and autofill multi-step logins - #1548

Open
lolgab wants to merge 1 commit into
Versent:masterfrom
lolgab:fix/google-number-match-and-browser-autofill
Open

lolgab wants to merge 1 commit into
Versent:masterfrom
lolgab:fix/google-number-match-and-browser-autofill

Conversation

@lolgab

@lolgab lolgab commented Nov 19, 2026

Copy link
Copy Markdown

Two fixes for Google Workspace logins.

GoogleApps provider: number match not printed

When Google asks to tap a number on the phone (device push with number matching), the CLI printed no number. Google now renders it as

<samp class="IEIJ3d" jsname="feLNVc" translate="no">96</samp>

outside the challenge form, while the code looked for div[jsname=feLNVc]. The selector now matches the jsname on any element, and falls back to the element holding only the number (samp, b, or inside the challenge form) in case the jsname changes again.

Browser provider: autofill doesn't work with Google

autoFill waited for a visible password field before doing anything. Google shows the email first and the password on a second step, so autofill waited until timeout. Google's email page also contains an aria-hidden hiddenPassword decoy input.

autoFill now:

  • waits for either a username or a password field
  • fills the username field directly (instead of Shift+Tab from the password field)
  • if no password field is visible yet, submits and waits for the password step
  • submits forms without a submit button by pressing Enter on the field, falling back to form.submit() as before

This also helps with #1295 / #1363 style multi-step pages.

Testing

  • Unit test for the current Google number markup (taken from a real page, personal data removed), plus the old fixture with a renamed jsname.
  • New loginpage-multi-step.html fixture mimicking Google's identifier/password steps. It fails with the old autoFill (timeout) and passes with the new one; the 3 existing fixtures still pass.
  • Tried manually against a real Google Workspace login: the number is extracted from the challenge page and browser autofill fills email and password.
  • go test ./... passes.

GoogleApps provider: Google now renders the device push number in a
<samp jsname="feLNVc"> instead of a <div>, so the CLI no longer printed
the number to tap. Match the jsname on any element and fall back to the
element holding only the number in case the jsname changes.

Browser provider: autofill waited for a visible password field, which
never appears on the first page of multi-step logins like Google, and
could be fooled by Google's aria-hidden password decoy. Fill the
username first, submit, then wait for the password step. Fields are
located directly instead of via Shift+Tab, and forms without a submit
button are submitted with Enter before falling back to form.submit().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant