fix(detector): T-221/T-223 M7 Google challenge-pwd + LinkedIn AJAX#187
Merged
antonyblain merged 1 commit intodevelopfrom Apr 28, 2026
Merged
Conversation
TACHE-221 — Google /challenge/pwd : M7 restait inactif après soumission password. - Cause (a) : autocomplete="new-password" sur le champ Google déclenchait le filtre isNewPasswordField — faux-positif sur une page de CONNEXION. Fix : isSignInContext() détecte les URL /challenge, /signin, /login, /auth, etc. et bypass le filtre isNewPasswordField quand la page est identifiée comme connexion. - Cause (b) : bouton "Suivant" (type="button", FR) ignoré par la regex looksLikeSubmit. Fix : regex étendue — suivant|next|weiter|siguiente|continuer|proceed|anmelden... - Cause (c) : fieldIsCurrentPassword ajouté comme court-circuit inconditionnel — autocomplete="current-password" est toujours un champ de connexion. TACHE-223 — LinkedIn /login : M7 ne captait pas le submit AJAX. - Cause : LinkedIn utilise fetch() + event.preventDefault() — l'event submit DOM ne se déclenche jamais. Le filtre orphan-only (!f.form) était trop restrictif. Fix S3 : le listener click couvre désormais TOUS les champs password (orphans ET in-form), avec appel direct à handleFormSubmit(event, pwdField). - Fix snapshot : _snPasswordLastValue stocke la valeur via input/blur (capture) avant que l'AJAX la vide. handleFormSubmit utilise la valeur || snapshot || ''. Tests : +22 tests (T-221-00 à T-221-13, T-223-01 à T-223-08). Suite complète : 1155/1155 passed. format:check + lint + build : OK. .gitignore : scripts/edit_*.py ajoutés (feedback_agents_no_patch_scripts.md). Refs : TACHE-221, TACHE-223, INC-001, INC-006, P-017, PV recette 2026-04-24. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexte
Sprint correctif P0 post-recette manuelle MEP v1 (verdict BLOQUÉE, 2026-04-24).
Deux bugs P0 reproduits bloquaient la mise en production :
/challenge/pwd— M7 ne capte pas la soumission password/login— M7 ne capte pas le submit AJAXHypothèses validées / réfutées
TACHE-221 — Google /challenge/pwd
autocomplete="new-password"sur le champ Google déclencheisNewPasswordField()→ M7 filtré (faux-positif connexion)isNewPasswordField()retournaittruesur le champ Google qui utiliseautocomplete="new-password"à tort sur son écran de connexion. Le filtre M7 sautait la capture.type="button", texte FR) ignoré par la regexlooksLikeSubmitTACHE-223 — LinkedIn /login
fetch()+event.preventDefault()→ eventsubmitDOM jamais déclenchéclicksur le bouton était observable.!f.formdans le listener orphan-click excluait les champs in-form<form>parent. Le champ LinkedIn est dans un<form>.Corrections apportées
Stratégie avant/après
autocomplete="new-password"isNewPasswordField(field)→ skip M7 (trop large)isSignInContext()bypass le filtre si URL connexion détectéeautocomplete="current-password"fieldIsCurrentPassword=true→ M7 toujours actiflooksLikeSubmitsubmit|login|sign\s*in...)suivant|next|weiter|siguiente|continuer|proceed|anmelden|accedi|ingresar!f.form)pwdField.valueuniquementpwdField.value || _snPasswordLastValue.get(pwdField) || ''attachPasswordValueSnapshots()— écouteinput/bluren captureNouvelles fonctions / exports
isSignInContext(): détection URL-based des pages de connexion (/login,/signin,/challenge,/auth,/session,/identify,/identifier,/servicelogin)attachPasswordValueSnapshots(): stocke la valeur password dans_snPasswordLastValue(WeakMap) avant reset AJAX_snPasswordLastValue: WeakMap exporté pour les testsTests ajoutés
22 nouveaux tests dans
tests/unit/content-scripts/password-detector-t221-t223-m7-google-linkedin.test.ts:TACHE-221 — isSignInContext() regex :
/→false(base)/challenge/pwd→true/login,/account/login→true/signin,/sign-in,/sign_in→true/→false/register,/signup→falseTACHE-221 — regex
looksLikeSubmitmulti-langue :truetruetruefalsefalseTACHE-221 — handleFormSubmit bypass filtre :
passwordsans autocomplete + URL connexion (jsdom /) → M7 ACTIFnew-password+ URL non-connexion (jsdom /) → M7 ignorécurrent-password→ M7 ACTIFTACHE-223 — snapshot
_snPasswordLastValue:input→ snapshot stockéblur→ snapshot stockétype=text) dans_snPasswordInputs→ snapshot capturépwdField.valuevide + snapshot → M7 utilise snapshotTACHE-223 — Stratégie S3 champ in-form :
<form>avec valeur → M7 déclenché<form>vide + snapshot → M7 déclenché via snapshotChecklist pré-commit
npm run format:check— cleannpm run lint— 0 warningsnpm run build— successnpm run test— 1155/1155 passed (66 test files).gitignoremis à jour :scripts/edit_*.pyexclus (feedback_agents_no_patch_scripts.md)Fichiers modifiés
src/content-scripts/detectors/password-detector.ts— +200 lignes (isSignInContext, attachPasswordValueSnapshots, _snPasswordLastValue, filtres M7, Strategy S3)tests/unit/content-scripts/password-detector-t221-t223-m7-google-linkedin.test.ts— NEW (22 tests).gitignore—scripts/edit_*.pyajoutéRefs : TACHE-221, TACHE-223, INC-001, INC-006, P-017, PV recette 2026-04-24, ARB-UC02-01
🤖 Generated with Claude Code