For some demo purposes, I'd like to add a toolbar at the very top of a page for better live demo capabilities. That means I don't know the structure of the web page, as I am running live demos on different web ages of customers. Currently, my script works on some pages quite well on others not.
Using developer Tools, for me, it looks like the main pain is when there is a class in the body, and I assume this is added dynamically by some logic. Open up the page then in Chrome - Developer tools, I can see my DIV at the top of the page, but closing the developer tools, it looks like the class in the body is overlaying my toolbar.
What I have tried is:
window.parent.document.body.insertBefore(toolbar, document.body.firstChild);
or
document.body.insertBefore(toolbar, document.body.firstChild);
and certainly the option in Tampermonkey:
// @run-at document-end
But unfortunately with no luck.
I case anybody has found a more stable way to add something at the top of te page would be much appreciated under the awareness, when I don't know the page, there might be room to fail.
Thank you!