We all know that you can launch the inspector using strg+alt+i, but I am right now trying to add a button to my user interface that does the same thing:
function customEnterInspector () {
var scene = document.querySelector('a-scene');
if (scene) {
if (scene.hasLoaded) {
this.injectInspector();
} else {
scene.addEventListener('loaded', this.injectInspector());
}
}
}
$( "#intoinspector" ).click(function() {
customEnterInspector();
});
However, I do get the error:
Uncaught TypeError: this.injectInspector is not a function
at customEnterInspector (index.html:925)
at HTMLAnchorElement.<anonymous> (index.html:933)
at HTMLAnchorElement.dispatch (jquery-3.1.1.min.js:3)
at HTMLAnchorElement.q.handle (jquery-3.1.1.min.js:3)
I suppose the element (a-scene) that I am referencing is not the right one. I already tried with "window", but that didn't work either. Any advice on what I could else try?
Thanks & Best, - Max