mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-11 10:10:25 +01:00
Handle detached table cells in autofill service (#10880)
Fixes errors and high CPU usage / browser lockup on offending webpages. HTMLTableCellElement.cellIndex will be -1 if the cell is not part of any row, which will cause getTextContentFromElement to fail since it will not receive a valid sibling cell.
This commit is contained in:
parent
4e1912e24e
commit
e3fc4547ae
@ -644,6 +644,10 @@ export class CollectAutofillContentService implements CollectAutofillContentServ
|
|||||||
}
|
}
|
||||||
|
|
||||||
const tableDataElementIndex = tableDataElement.cellIndex;
|
const tableDataElementIndex = tableDataElement.cellIndex;
|
||||||
|
if (tableDataElementIndex < 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const parentSiblingTableRowElement = tableDataElement.closest("tr")
|
const parentSiblingTableRowElement = tableDataElement.closest("tr")
|
||||||
?.previousElementSibling as HTMLTableRowElement;
|
?.previousElementSibling as HTMLTableRowElement;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user