add max limit for dom listner (#2132)
This commit is contained in:
@@ -2194,6 +2194,15 @@ function asyncSleepFor(ms) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function addIncrementalNodeToMap(parentNode, childrenNode) {
|
async function addIncrementalNodeToMap(parentNode, childrenNode) {
|
||||||
|
const maxParsedElement = 3000;
|
||||||
|
if ((await window.globalParsedElementCounter.get()) > maxParsedElement) {
|
||||||
|
console.warn(
|
||||||
|
"Too many elements parsed, stopping the observer to parse the elements",
|
||||||
|
);
|
||||||
|
await window.globalParsedElementCounter.add();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// make the dom parser async
|
// make the dom parser async
|
||||||
await waitForNextFrame();
|
await waitForNextFrame();
|
||||||
if (window.globalListnerFlag) {
|
if (window.globalListnerFlag) {
|
||||||
|
|||||||
Reference in New Issue
Block a user