I am able to track all the dynamically created tags, using Brock Adams' answer to "Log a web page's dynamically-created, DOM elements with a userscript".
Now I want to get the attributes of the tags. I tried it by adding an if condition in LogNewTagCreations ()
but it didn't work.
In this example I am checking attributes for script tags:
if(tagName=="script")
{
console.log("------------",elem.attributes.src.Value);
}
Please help me.
Because a
<script>
ssrc
is set outside thecreateElement()
call, adapting the previous script requires a little more work than that. You must check for thesrc
attribute essentially asynchronously.One way to do that is with another polling interval. Rolling that into the previous script (along with some housekeeping), the script code becomes: