From 56369fe86af9e265883559685026b9c0a3fb9666 Mon Sep 17 00:00:00 2001 From: Zenny <78681533+ZennDev1337@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:28:44 +0100 Subject: [PATCH] first commit --- waitForKeyElements.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/waitForKeyElements.js b/waitForKeyElements.js index 97cba3c..f144eda 100644 --- a/waitForKeyElements.js +++ b/waitForKeyElements.js @@ -33,8 +33,10 @@ function waitForKeyElements( ) { let targetNodes, btargetsFound; - if (typeof iframeSelector == "undefined") targetNodes = selectorTxt; - else targetNodes = iframeSelector.contents().find(selectorTxt); + if (typeof iframeSelector == "undefined") + targetNodes = document.querySelector(selectorTxt); + else + targetNodes = iframeSelector.contentDocument.querySelector(selectorTxt); if (targetNodes && targetNodes.length > 0) { btargetsFound = true;