aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
655 stars 203 forks source link

Open inspector pragmatically from API call #586

Closed LukeTOBrien closed 1 year ago

LukeTOBrien commented 5 years ago

Hello there,

I wondered is there a way to open the inspector pragmatically instead of using shortcut?
My scenario is that I have a A-Frame scene appear inside a <div> window inside my app, so the scene is not full-screen and I want to place a button underneath the scene that opens up the inspector.

So code similar to this is what I have imagined:

document.querySelector("a-scene").openInspector();
SubZtep commented 4 years ago

Hi, I always use the command below from the dev console:

AFRAME.scenes[0].inspect()

Made quickly a Codepen to try and seems the same command works for embedded A-Frame without querying its root, but the inspector becomes full screen.

LukeTOBrien commented 3 years ago

Hi chaps,

I have only just got around to looking at this. Is there any extra JS I need to include?
I am using the latest (1.1.0/aframe.min.js) and do nt see an AFRAME.INSPECTOR object nor a inspect() function on the scene.

aframe-no-inspector

kfarr commented 3 years ago

Try: window.postMessage('INJECT_AFRAME_INSPECTOR')

kfarr commented 1 year ago

Multiple solutions have been provided, can we close this issue @dmarcos ?