[PM-38992] Fix Targeting Rules autofilling new password inputs with current password values (#21238)

* fix Targeting Rules autofilling new password inputs with current password values

* fix Targeting Rules not being used for explicitly defined new password field inline menu typing
This commit is contained in:
Jonathan Prusik 2026-06-12 15:10:23 -04:00 committed by GitHub
parent 0d0fed94b3
commit 25bec0e5b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 4 deletions

View File

@ -3,6 +3,7 @@ import "lit/polyfill-support.js";
import { FocusableElement, tabbable } from "tabbable";
import {
AutofillTargetingRuleTypes,
AUTOFILL_OVERLAY_HANDLE_REPOSITION,
AUTOFILL_OVERLAY_HANDLE_SCROLL,
AUTOFILL_TRIGGER_FORM_FIELD_SUBMIT,
@ -1177,6 +1178,11 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
// which are distinct from the heuristic AutofillFieldQualifierType values.
const qualifier = autofillFieldData.fieldQualifier as AutofillTargetingRuleType;
if (qualifier === AutofillTargetingRuleTypes.newPassword) {
autofillFieldData.inlineMenuFillType = InlineMenuFillTypes.PasswordGeneration;
return;
}
if (loginQualifiers.includes(qualifier)) {
autofillFieldData.inlineMenuFillType = CipherType.Login;
return;

View File

@ -921,12 +921,12 @@ export default class AutofillService implements AutofillServiceInterface {
if (fieldType === AutofillTargetingRuleTypes.username) {
return cipher.login?.username ?? null;
}
if (
fieldType === AutofillTargetingRuleTypes.password ||
fieldType === AutofillTargetingRuleTypes.newPassword
) {
if (fieldType === AutofillTargetingRuleTypes.password) {
return cipher.login?.password ?? null;
}
if (fieldType === AutofillTargetingRuleTypes.newPassword) {
return null;
}
// Card fields
if (fieldType === AutofillTargetingRuleTypes.cardholderName) {