title: Detecting device motion/orientation support?
body: <p>I'm looking for a way to check if a device supports either the DeviceOrientationEvent or DeviceMotionEvent. <strong>To be more precisely I wan't to know if the device really has an accelerometer</strong>.</p>
  
  <p>Unfortunately <code>window.DeviceMotionEvent</code> and <code>window.ondevicemotion</code> respectively <code>window.DeviceOrientationEvent</code> and <code>window.ondeviceorientation</code> exists although the device - MacBook Retina - doesn't have an accelerometer.</p>
  
  <p>It's clear to me, that if the Event is never fired, the callback-function of an eventlistener will also never run. But in my case I, my program need's to know if the device has an accelerometer, because the user should receive a notification if there is no accelerometer.</p>
  
  <p>Answers of this post unfortunately didn't work for my problem.</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/2877393/detecting-support-for-a-given-javascript-event">Detecting support for a given JavaScript event?</a></li>
  </ul>