new device API for Firefox 3.6: orientation

One new feature that we’re including as part of Firefox 3.6 is support for web pages to access machine orientation information if it’s available. As you can see from the demo above you can use it to figure out if the machine is moving and what direction it’s facing.

Using the API is very simple. All you have to do is add a simple event listener:

window.addEventListener("MozOrientation", function(e) {
                        /* 3 values: e.x, e.y, e.z */
                        }, true);

Originally built as something that we would include for our upcoming mobile browser release, we’ve made it available on desktop systems as well. Many modern Macbooks and Thinkpads contain devices and drivers that expose this information. We’ve added support for Linux, Macs and some Thinkpads where drivers and devices are available. (Note, on some Macbooks detect the orientation information backwards – we’re working on that.)

You can find more information on two posts by Doug Turner and an update on documentation for orientation from Eric Shepherd.

Paul Rouget has this and some other demos up in one of his posts.


  1. […] duruma göre vazife çıkaracak ve görünümünü ayarlayacak. Nasıl olduğunu görmek için videoyu izleyin. Çoğunlukla Mac kullanıcılarının kullanacağı bir özellik […]

    January 21st, 2010 at 15:11

  2. […] на копмјутерот во 3Д светот благодарение на новото API. Исто така можете да ги користите drag&drop функциите […]

    January 21st, 2010 at 15:18

  3. sakrist


    look my version

    January 24th, 2010 at 08:18

  4. Melroy van den Berg

    Very nice :|

    January 27th, 2010 at 13:43

  5. […] stimulate discussion. I talked about HTML5 (inclusive of the WebApps APIs, such as the File API and Orientation Events), CSS3’s @font-face property, and discussed the potential this had for Indic fonts. We closed […]

    March 11th, 2010 at 03:59

  6. […] ever since the introduction of onclick back in JavaScript’s infancy. And then, there’s Orientation Events, supported in Firefox 3.6 (with a really compelling demo — try it on the MacBook Pro and Fx […]

    March 12th, 2010 at 11:50

  7. Clement Deschesnes

    comment configurer facebook affin de pouvoir gérer le java-script et le flash qui
    m’empêche de jouer a toutes les applications

    March 13th, 2010 at 16:08

  8. James Duncombe

    Love it guys, nice one! :)

    November 24th, 2010 at 07:56

  9. adipex

    it sounds like a really great feature , anyone knows how can one without a location device can manually input his coordinates? maybe there’s a plugin for that ?

    December 28th, 2010 at 02:51

  10. Martin Kliehm

    I got a new laptop (Dell Latitude E6510) that has a ST Micro Accelerometer built in. Alas the demo pages stay static. Does anybody know if it’s possible to access that accelerometer’s data using the orientation API?

    February 11th, 2011 at 11:18

  11. […] some very interesting activity at lately. As Christopher Blizzard said in the according blog post “One new feature that we’re including as part of Firefox 3.6 is support for web […]

    May 28th, 2011 at 13:45

Comments are closed for this article.