Can I find if there is an initialized variable for a particular div id in an html web page?

38 views Asked by At
<div id="div-id1" style="height:250px; width:300px;">
    <div id="child_divId1" style="border: 0pt none;">
        <iframe id="iframe_from_div" title="some tests" name="iframe_fromdiv" width="300" height="250" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" srcdoc="" style="border: 0px; vertical-align: bottom;" data-load-complete="true">
        </iframe>
    </div>
</div>

<script type="text/javascript">
    var initializedVar = document.getElementById("div-id1");
</script>

Here is a simplified version of the situation, but main idea is to use an chrome extension where I use queryselectorall to obtain a nodelist of my divs I want. After that I clone the node and I append it to parentNode with div id +"genuine" syntax. All of that because I need to filter the mutation of those divs.
I cannot use observer.observ because that assume to see the mutation after has been made, so I need to use proxy instead. The problem is that the scripts from the webpages will continuously modify the divs and I need to filter that replacing the initialized variable used by scripts with my proxied one.

So, can I check if a variable has been initialized for a specific div id ?

Thanks.

0

There are 0 answers