[PM-8833] Fixing an issue with SPA support
This commit is contained in:
parent
dc03c66f15
commit
90448c86f8
|
@ -73,6 +73,10 @@ class LegacyAutofillOverlayContentService implements LegacyAutofillOverlayConten
|
|||
* Satisfy the AutofillOverlayContentService interface.
|
||||
*/
|
||||
messageHandlers = {} as AutofillOverlayContentExtensionMessageHandlers;
|
||||
clearUserFilledFields() {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
async setupOverlayListeners(
|
||||
autofillFieldElement: ElementWithOpId<FormFieldElement>,
|
||||
autofillFieldData: AutofillField,
|
||||
|
|
|
@ -45,5 +45,6 @@ export interface AutofillOverlayContentService {
|
|||
pageDetails: AutofillPageDetails,
|
||||
): Promise<void>;
|
||||
blurMostRecentlyFocusedField(isClosingInlineMenu?: boolean): void;
|
||||
clearUserFilledFields(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
|
|
@ -216,6 +216,17 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all cached user filled fields.
|
||||
*/
|
||||
clearUserFilledFields() {
|
||||
Object.keys(this.userFilledFields).forEach((key) => {
|
||||
if (this.userFilledFields[key]) {
|
||||
delete this.userFilledFields[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats any found user filled fields for a login cipher and sends a message
|
||||
* to the background script to add a new cipher.
|
||||
|
@ -1662,11 +1673,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
|
|||
formFieldElement.removeEventListener(EVENTS.KEYUP, this.handleFormFieldKeyupEvent);
|
||||
this.formFieldElements.delete(formFieldElement);
|
||||
});
|
||||
Object.keys(this.userFilledFields).forEach((key) => {
|
||||
if (this.userFilledFields[key]) {
|
||||
delete this.userFilledFields[key];
|
||||
}
|
||||
});
|
||||
this.clearUserFilledFields();
|
||||
this.userFilledFields = null;
|
||||
globalThis.removeEventListener(EVENTS.MESSAGE, this.handleWindowMessageEvent);
|
||||
globalThis.document.removeEventListener(
|
||||
|
|
|
@ -961,6 +961,7 @@ export class CollectAutofillContentService implements CollectAutofillContentServ
|
|||
this.domRecentlyMutated = true;
|
||||
if (this.autofillOverlayContentService) {
|
||||
this.autofillOverlayContentService.pageDetailsUpdateRequired = true;
|
||||
this.autofillOverlayContentService.clearUserFilledFields();
|
||||
void this.sendExtensionMessage("closeAutofillInlineMenu", { forceCloseInlineMenu: true });
|
||||
}
|
||||
this.noFieldsFound = false;
|
||||
|
|
Loading…
Reference in New Issue