Recently, I developed a Chrome extension that runs before the page fully loads by setting the attribute "run_at": "document_start"
.
One issue I encountered is that I need to insert a div
tag into the body of the webpage as soon as it is created.
However, at that point, document.body
is null so I can't append any tags to it.
I am not concerned with waiting for the full loading of the body, I just need it to exist.
I am currently exploring ways to be notified when the body
tag in HTML is created (not necessarily fully loaded, just created). Are there any event handlers available for this specific scenario that I could implement?
In addition, I would prefer not to rely on jQuery
or any other third-party library and instead utilize built-in functions.