Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable inspector

Tags:

I'm trying to disable inspector on a simple A-Frame WebVR app with no success.

Tried to use and also disabling key press Ctrl + Alt + I using JavaScript. But, inspector is still loading.

Does anyone knows how to do that?

My scene is really simple:

<html>

<head>
  <script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
</head>

<body>
  <a-scene>
    <a-assets><img id="render" src="back.png"></a-assets>
    <a-sky src="#render"></a-sky>
  </a-scene>
</body>

</html>
like image 428
Rodrigo Brito Avatar asked Apr 27 '17 20:04

Rodrigo Brito


1 Answers

You can add a disable-inspector component that calls the remove function of the inspector, and then use this component on the scene.

AFRAME.registerComponent('disable-inspector', {
  dependencies: ['inspector'],
  init: function () {
    this.el.components.inspector.remove();
  }
});

and in your html file:

<a-scene disable-inspector>
  ...
</a-scene>
like image 127
goldor Avatar answered Sep 21 '22 10:09

goldor