diff --git a/browser/extensions/formautofill/content/customElements.js b/browser/extensions/formautofill/content/customElements.js index e50435dee2dc..0f1260634dbe 100644 --- a/browser/extensions/formautofill/content/customElements.js +++ b/browser/extensions/formautofill/content/customElements.js @@ -141,8 +141,8 @@ this.getAttribute("ac-value") ); - this._label.textContent = primary; - this._comment.textContent = secondary; + this._label.textContent = primary.toString().replaceAll("*", "•"); + this._comment.textContent = secondary.toString().replaceAll("*", "•"); if (ariaLabel) { this.setAttribute("aria-label", ariaLabel); } diff --git a/browser/extensions/formautofill/test/mochitest/creditCard/test_preview_highlight_with_multiple_cc_number_fields.html b/browser/extensions/formautofill/test/mochitest/creditCard/test_preview_highlight_with_multiple_cc_number_fields.html index c39877d1b738..6b0d7a522c23 100644 --- a/browser/extensions/formautofill/test/mochitest/creditCard/test_preview_highlight_with_multiple_cc_number_fields.html +++ b/browser/extensions/formautofill/test/mochitest/creditCard/test_preview_highlight_with_multiple_cc_number_fields.html @@ -66,7 +66,7 @@ async function checkMultipleCCNumberFormStyle(profile, isPreviewing = true) { for (const element of elements) { let fillableValue; if (element.id.includes("cc-number") && isPreviewing) { - fillableValue = profile["cc-number"].slice(-8); + fillableValue = profile["cc-number"].slice(-8).replaceAll("*", "•"); } else if (element.id.includes("cc-number")) { fillableValue = profile["cc-number"]; } else { diff --git a/browser/extensions/formautofill/test/mochitest/formautofill_common.js b/browser/extensions/formautofill/test/mochitest/formautofill_common.js index 9cb81849092f..6dbfa7c91894 100644 --- a/browser/extensions/formautofill/test/mochitest/formautofill_common.js +++ b/browser/extensions/formautofill/test/mochitest/formautofill_common.js @@ -139,7 +139,8 @@ async function checkFormFieldsStyle(profile, isPreviewing = true) { previewValue = ""; } else { fillableValue = profile && profile[elem.id]; - previewValue = (isPreviewing && fillableValue) || ""; + previewValue = + (isPreviewing && fillableValue?.toString().replaceAll("*", "•")) || ""; } await checkFieldHighlighted(elem, !!fillableValue); await checkFieldPreview(elem, previewValue); diff --git a/toolkit/components/formautofill/ProfileAutoCompleteResult.sys.mjs b/toolkit/components/formautofill/ProfileAutoCompleteResult.sys.mjs index d8cc6e09c69e..15fc1a520c50 100644 --- a/toolkit/components/formautofill/ProfileAutoCompleteResult.sys.mjs +++ b/toolkit/components/formautofill/ProfileAutoCompleteResult.sys.mjs @@ -417,7 +417,11 @@ export class CreditCardResult extends ProfileAutoCompleteResult { const ccTypeName = ccTypeL10nId ? lazy.l10n.formatValueSync(ccTypeL10nId) : ccType ?? ""; // Unknown card type - const ariaLabel = [ccTypeName, primary.toString().replaceAll("*", ""), secondary] + const ariaLabel = [ + ccTypeName, + primary.toString().replaceAll("*", ""), + secondary, + ] .filter(chunk => !!chunk) // Exclude empty chunks. .join(" "); return { diff --git a/toolkit/components/formautofill/shared/FormAutofillSection.sys.mjs b/toolkit/components/formautofill/shared/FormAutofillSection.sys.mjs index ab4ece49e2d8..907dc960864f 100644 --- a/toolkit/components/formautofill/shared/FormAutofillSection.sys.mjs +++ b/toolkit/components/formautofill/shared/FormAutofillSection.sys.mjs @@ -433,7 +433,7 @@ export class FormAutofillSection { // Skip the field if the user has already entered text and that text is not the site prefilled value. continue; } - element.previewValue = value; + element.previewValue = value?.toString().replaceAll("*", "•"); this.handler.changeFieldState( fieldDetail, value ? FIELD_STATES.PREVIEW : FIELD_STATES.NORMAL diff --git a/toolkit/components/passwordmgr/test/browser/browser_relay_telemetry.js b/toolkit/components/passwordmgr/test/browser/browser_relay_telemetry.js index 238cbbebc287..e84f64d5c0b7 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_relay_telemetry.js +++ b/toolkit/components/passwordmgr/test/browser/browser_relay_telemetry.js @@ -138,11 +138,10 @@ async function openRelayAC(browser) { await openACPopup(popup, browser, "#form-basic-username"); const popupItem = document .querySelector("richlistitem") - .getAttribute("ac-label"); - const popupItemTitle = JSON.parse(popupItem).title; + .getAttribute("ac-value"); Assert.ok( - gRelayACOptionsTitles.some(title => title.value === popupItemTitle), + gRelayACOptionsTitles.some(title => title.value === popupItem), "AC Popup has an item Relay option shown in popup" );