aframe-inspector icon indicating copy to clipboard operation
aframe-inspector copied to clipboard

Open inspector pragmatically from API call

Open LukeTOBrien opened this issue 6 years ago • 3 comments

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();

LukeTOBrien avatar Sep 24 '19 14:09 LukeTOBrien

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.

SubZtep avatar Oct 27 '20 23:10 SubZtep

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

LukeTOBrien avatar Jan 08 '21 22:01 LukeTOBrien

Try: window.postMessage('INJECT_AFRAME_INSPECTOR')

kfarr avatar Sep 23 '21 03:09 kfarr

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

kfarr avatar Jan 25 '23 00:01 kfarr