fallback get incremental tree without waiting (#2118)

This commit is contained in:
Shuchang Zheng
2025-04-09 11:36:27 -07:00
committed by GitHub
parent c11d0f63eb
commit 03d5383a42
2 changed files with 23 additions and 9 deletions

View File

@@ -2344,12 +2344,14 @@ async function stopGlobalIncrementalObserver() {
window.globalDomDepthMap = new Map();
}
async function getIncrementElements() {
while (
(await window.globalParsedElementCounter.get()) <
window.globalOneTimeIncrementElements.length
) {
await asyncSleepFor(100);
async function getIncrementElements(wait_until_finished = true) {
if (wait_until_finished) {
while (
(await window.globalParsedElementCounter.get()) <
window.globalOneTimeIncrementElements.length
) {
await asyncSleepFor(100);
}
}
// cleanup the chidren tree, remove the duplicated element