I am creating a tampermonkey script for Google Earth that will hide the toolbar when you press a key. One of the elements that is supposed to be hidden looks like this:
<earth-toolbar id="toolbar" role="toolbar">...</earth-toolbar>
I am trying to hide it using this code:
document.getElementById('toolbar').style.display = 'none'
Note that it also does not work in the console.
However, I get this error.
Uncaught TypeError: Cannot read property 'style' of null at HTMLDocument.eval
Is it possible to access a custom element without modifying the code that actually created it, and if so what is it?