From db0222e83a7daf56c8df589e3a41182efb778f2f Mon Sep 17 00:00:00 2001 From: Zenny <78681533+ZennDev1337@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:34:22 +0100 Subject: [PATCH] first commit --- waitForKeyElements.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/waitForKeyElements.js b/waitForKeyElements.js index f144eda..3ab2580 100644 --- a/waitForKeyElements.js +++ b/waitForKeyElements.js @@ -31,7 +31,14 @@ function waitForKeyElements( search. */ ) { - let targetNodes, btargetsFound; + /** + * @typedef targetNodes + * @type {Array} + */ + + /** @type {targetNodes} */ + let targetNodes; + let btargetsFound; if (typeof iframeSelector == "undefined") targetNodes = document.querySelector(selectorTxt); @@ -43,7 +50,7 @@ function waitForKeyElements( /*--- Found target node(s). Go through each and act if they are new. */ - targetNodes.each(function () { + targetNodes.forEach(function () { let jThis = this; let alreadyFound = jThis.data("alreadyFound") || false;