1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 05:13:29 +00:00

[PM-18287] Bugfix - Vault autofill suggestions view hangs on load when the current tab is on the blocked domains list (#13496)

* Fix vault autofill suggestions view hanging on load when the current tab is on the blocked domains list

Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com>

* fix broken tests

* use blockedInteractionsUris$ observable instead of currentTabIsOnBlocklist$ in _currentPageDetails$

---------

Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com>
This commit is contained in:
Jonathan Prusik
2025-02-20 18:44:18 -05:00
committed by GitHub
parent 49dc3e0d28
commit a19c860a14
2 changed files with 17 additions and 1 deletions

View File

@@ -67,6 +67,7 @@ describe("VaultPopupAutofillService", () => {
.mockReturnValue(true);
mockAutofillService.collectPageDetailsFromTab$.mockReturnValue(new BehaviorSubject([]));
mockDomainSettingsService.blockedInteractionsUris$ = new BehaviorSubject({});
testBed = TestBed.configureTestingModule({
providers: [

View File

@@ -145,7 +145,22 @@ export class VaultPopupAutofillService {
if (!tab) {
return of([]);
}
return this.autofillService.collectPageDetailsFromTab$(tab);
return this.domainSettingsService.blockedInteractionsUris$.pipe(
switchMap((blockedURIs) => {
// This blocked URI logic will be updated to use the common util in PM-18219
if (blockedURIs && tab?.url?.length) {
const tabURL = new URL(tab.url);
const tabIsBlocked = Object.keys(blockedURIs).includes(tabURL.hostname);
if (tabIsBlocked) {
return of([]);
}
}
return this.autofillService.collectPageDetailsFromTab$(tab);
}),
);
}),
shareReplay({ refCount: false, bufferSize: 1 }),
);