1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-08 20:50:28 +00:00

Fix shadow DOM detection and mutation handling for nested SPAs

- Use recursive shadow root query to find nested shadow DOMs
- Fix requirePageDetailsUpdate to actually schedule collection
- Ensures password fields in slow SPAs (like HBO Max) are detected
This commit is contained in:
Miles Blackwood
2026-02-03 16:16:09 -05:00
parent 69f949e261
commit d35b6babca
2 changed files with 7 additions and 1 deletions

View File

@@ -1100,6 +1100,7 @@ export class CollectAutofillContentService implements CollectAutofillContentServ
this.autofillOverlayContentService.pageDetailsUpdateRequired = true;
}
this.noFieldsFound = false;
this.updateAutofillElementsAfterMutation();
};
/**

View File

@@ -104,7 +104,12 @@ export class DomQueryService implements DomQueryServiceInterface {
* @returns True if any new shadow roots are found that aren't being observed
*/
checkForNewShadowRoots = (): boolean => {
const currentRoots = this.queryShadowRoots(globalThis.document.body);
let currentRoots: ShadowRoot[];
try {
currentRoots = this.recursivelyQueryShadowRoots(globalThis.document.body);
} catch {
currentRoots = this.queryShadowRoots(globalThis.document.body);
}
for (const root of currentRoots) {
if (!this.observedShadowRoots.has(root)) {