1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PS-94] Ensure autofill always uses the same tab (#3066)

* Require specifying a tab in doAutoFill options to ensure only the desired tab is filled

* Specify well defined type for added tab properties

* Replace new tabToAutoFill property with parameter
This commit is contained in:
Shane Melton
2022-07-21 10:56:09 -07:00
committed by GitHub
parent eaec97506e
commit 9eefb4ad16
4 changed files with 13 additions and 8 deletions

View File

@@ -143,7 +143,7 @@ export default class RuntimeBackground {
tab: msg.tab,
details: msg.details,
});
this.autofillTimeout = setTimeout(async () => await this.autofillPage(), 300);
this.autofillTimeout = setTimeout(async () => await this.autofillPage(msg.tab), 300);
break;
default:
break;
@@ -205,8 +205,9 @@ export default class RuntimeBackground {
}
}
private async autofillPage() {
private async autofillPage(tabToAutoFill: chrome.tabs.Tab) {
const totpCode = await this.autofillService.doAutoFill({
tab: tabToAutoFill,
cipher: this.main.loginToAutoFill,
pageDetails: this.pageDetailsToAutoFill,
fillNewPassword: true,