Skip to content

Commit

Permalink
Refactor - auto update credential provider script (#21313)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Aug 20, 2024
1 parent 373f3e6 commit 32a554e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions firefox-ios/Client/Assets/CC_Script/AutofillTelemetry.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class AutofillTelemetryBase {
const extra = this.#initFormEventExtra("unavailable");

for (const fieldDetail of fieldDetails) {
let { filledState, value } = data[fieldDetail.elementId];
let { filledState, value } = data.get(fieldDetail.elementId);
switch (filledState) {
case FIELD_STATES.AUTO_FILLED:
filledState = "filled";
Expand Down Expand Up @@ -152,7 +152,7 @@ class AutofillTelemetryBase {
const extra = this.#initFormEventExtra("unavailable");

for (const fieldDetail of fieldDetails) {
let { filledState, value } = data[fieldDetail.elementId];
let { filledState, value } = data.get(fieldDetail.elementId);
switch (filledState) {
case FIELD_STATES.AUTO_FILLED:
filledState = "autofilled";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export class FormAutofillHandler {
* @param {object} profile
* A profile to be previewed with
*/
async previewFields(elementIds, profile) {
previewFields(elementIds, profile) {
this.getAdaptedProfiles([profile]);

for (const fieldDetail of this.fieldDetails) {
Expand Down Expand Up @@ -945,15 +945,15 @@ export class FormAutofillHandler {
* value: The value of the element
*/
collectFormFilledData() {
const filledData = {};
const filledData = new Map();

for (const fieldDetail of this.fieldDetails) {
const element = fieldDetail.element;
filledData[fieldDetail.elementId] = {
filledData.set(fieldDetail.elementId, {
filledState: element.autofillState,
filledValue: this.computeFillingValue(fieldDetail),
value: element.value,
};
});
}
return filledData;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export class FormAutofillSection {
};

for (const detail of this.fieldDetails) {
const { filledValue } = formFilledData[detail.elementId];
const { filledValue } = formFilledData.get(detail.elementId);

if (
!filledValue ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ export const HeuristicsRegExp = {
// Note: `cc-name` expression has been moved up, above `name`, in
// order to handle specialization through ordering.
"cc-number":
"(add)?(?:card|cc|acct).?(?:number|#|no|num|field)" +
"(add)?(?:card|cc|acct).?(?:number|#|no|num|field(?!s)|pan)" +
// In order to support webkit we convert all negative lookbehinds to a capture group
// (?<!not)word -> (?<neg>notword)|word
// TODO: Bug 1829583
Expand Down

0 comments on commit 32a554e

Please sign in to comment.