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:
@@ -1100,6 +1100,7 @@ export class CollectAutofillContentService implements CollectAutofillContentServ
|
||||
this.autofillOverlayContentService.pageDetailsUpdateRequired = true;
|
||||
}
|
||||
this.noFieldsFound = false;
|
||||
this.updateAutofillElementsAfterMutation();
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user