title: Device Orientation API returns different values for desktop browsers
body: <p>Using the <a href="http://www.audero.it/demo/device-orientation-api-demo.html" rel="nofollow noreferrer">Device Orientation API demo</a> on desktop Firefox 44 and Chrome Version 47.0.2526.80 m return different results for the coordinates.</p>
  
  <p>Firefox returns <code>null</code> and Chrome <code>0</code>. So far so good.</p>
  
  <p>With this piece of code I am trying to check <code>deviceorientation</code> data.   </p>
  
  <p>So first I check if the Device Orientation event is supported and both Firefox and Chrome say it is with the first alert firing.</p>
  
  <pre><code>if(window.DeviceOrientationEvent) {
    alert("Device Orientation Event is supported.");
  
    window.addEventListener('deviceorientation', function(event) {
      var alpha = event.alpha;
      var beta = event.beta;
      var gamma = event.gamma;
  
      // https://stackoverflow.com/a/27550756
      if(alpha === null &amp;&amp; typeof alpha === "object")
        alert(alpha);
    }, false);
  }
  </code></pre>
  
  <p>However only Chrome correctly returns the second alert as <code>null</code> whereas Firefox does not trigger the alert at all. But it should do so looking at the data results from the Device Orientation API demo.</p>
  
  <p>I have also made sure to specifically check for <code>null</code> and not <code>""</code>, <code>undefined</code>, <code>false</code>, <code>0</code>, or <code>NaN</code> as per <a href="https://stackoverflow.com/a/27550756/1010918">How do I check for null values in JavaScript</a>?</p>
  
  <p>So how do I get Firefox to actually fire the second alert with the data of the <code>deviceorientation</code> ?</p>
  
  <p>Related questions:</p>
  
  <p><a href="https://stackoverflow.com/questions/9898325/device-orientation-not-working-firefox">Device Orientation not working firefox</a></p>
  
  <p><a href="https://stackoverflow.com/questions/22524954/deviceorientation-in-firefox">&#39;deviceorientation&#39; in Firefox?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/24617710/different-gyroscope-values-in-chrome-mobile-and-safari-mobile">Different gyroscope values in chrome mobile and safari mobile</a></p>
  
  <p><a href="https://stackoverflow.com/questions/9077325/testing-hardware-support-in-javascript-for-device-orientation-events-of-the-ipho">Testing hardware support in Javascript for device orientation events of the iPhone 3GS</a></p>