hacks.mozilla.org

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.

48 Responses to “new device API for Firefox 3.6: orientation”


  1. 1 Lloyd Hilaiel

    Neat!

    Hey, if you figure out that backwards orientation issue, please drop me a line? We’ve got the same problem here:

    http://browserplus.yahoo.com/demos/marbles/

    much love,
    lloyd

  2. 2 bernhard

    A compass API would be nice.

  3. 3 Craig Baker

    I’m generally a positive guy. Seriously all I want out of Firefox is less crashes and more stability, not more features.

    I’d love to see this feature running on a desktop!

  4. 4 Staś Małolepszy

    @Lloyd: Bug tracks this, and AFAICT, the second patch fixes the behavior for at least some of the new MBPs.

  5. 5 Staś Małolepszy

    Sorry, the link didn’t get posted above. The bug in question is https://bugzilla.mozilla.org/show_bug.cgi?id=521848

  6. 6 koniczynek

    Will it also detect if user’s head is tilted along with the display? Because if not if I will be laying on the side with my notebook tilted I won’t be able to read anything. Maybe you should include webcam support to detect face position?

  7. 7 Antoine

    Please don’t hurt the web (and me), use open standards (like HTML(), OGG Theora, etc.) !

  8. 8 Reasons

    First: is it really need it?.

    Second: Mozilla should be fixing others things(bugs) rather than making this type of “feature”.

    3.5 is not a stable one, so it’s better to make it stable first.

  9. 9 Christopher Blizzard

    For those of you concerned about stability, we’re working full steam on that issue for 3.6. We know that 3.5 wasn’t as stable as it should have been. We haven’t talked about it much but it’s our most important project around 3.6.

    Features like this are included as well but we’ve backed away from a lot of things to work on stability instead. We’ll have a post about that nearer to the end of the beta cycle when we have a little bit more data, so stay tuned!

  10. 10 Alston

    It would be awesome if this was also coded to use the accelerometer features in some of Toshiba’s laptops, which use a different API from IBM/Lenovo and Apple.

  11. 11 Syd Lawrence

    I have been playing around with the accelerometer in firefox 3.6b, its wicked, really easy to use. check out my youtube video: http://www.youtube.com/watch?v=M5GMWaGiV1g or try out the webpage itself http://playground.marmaladeontoast.co.uk/ff3.6

    Might work on a little game for it, if I get any time.

  12. 12 Volvox

    Looks funny, but i can’t see any use for this technology in webbrowser. Who will make website using this technollogy if only very small % of peoples have computers with ‘machine orientation information’

  13. 13 Andrey

    Well, as it was written in the comment above, it might be useful for mobile devices.

    And yes, _a lot_ of mobile phones have accelerometer.

  14. 14 Christopher Blizzard

    @Audrey – Yep! This will be in Fennec 1.0 as well since it’s based on the same code as 3.6.

  15. 15 Ryan

    How will you go about adding support for more accelerometers? I have a HP Mini 2133 which has accelerometer in it and I would love to play around with the orientation API.

  16. 16 Frank

    Looks vaguely amusing… but I’m just saying, it better be possible to turn this function off or I will not upgrade my browser. The way I use my laptop this would be much more irritating than useful.

  1. 1 firefox « The best of the Tech News
  2. 2 Firefox 3.6 can detect computer orientation | TechShadez
  3. 3 Firefox 3.6 to feature computer orientation detection | BlogoFlux - Information Technology Blog
  4. 4 Nuevo Firefox 3.6 con Reconocedor de Movimiento
  5. 5 Firefox 3.6 to use device orientation « Position Absolute
  6. 6 Firefox 3.6 obróci strony internetowe do góry nogami – vBeta.pl – blog o internecie, baza wiedzy o nowych programach, Web 2.0
  7. 7 Omitek » Nova funcionalidade do Firefox 3.6 será capaz de reconhecer a orientação do computador
  8. 8 Firefox 3.6 Will Speak Fluent Accelerometer [Browsers] | HyipLife.com
  9. 9 Orientation detection in Firefox 3.6 | Browser Watch
  10. 10 Firefox 3.6 Will Speak Fluent Accelerometer | Gizmodo Australia
  11. 11 Techknology's Blog » Upcoming Firefox will be Able to Use Orientation Data
  12. 12 Firefox 3.6 detectará la inclinación de ordenadores portátiles y dispositivos móviles (Vídeo demostración)
  13. 13 Remains of the Day: 10-Finger Multi-Touch Concept Video Edition [For What It's Worth] · TechBlogger
  14. 14 Upcoming Firefox 3.6 can move with your Machine!!! | Devils Duke . com
  15. 15 Fun with my Lenovo T400 and its accelerometer | Øblog
  16. 16 Orientation–New Device API for Firefox 3. | GetBrowser
  17. 17 Browsery.cz » Firefox 3.6 s nativní podporou akcelerometru
  18. 18 Firefox 3.6 includerà la funzione dell’accelerometro - Totumweb
  19. 19 Happy Dude » Blog Archive » Accelerometers to be supported in Firefox 3.6
  20. 20 Firefox 3.6: Guarda come dondolo con l’accelerometro « Crismon's Blog
  21. 21 ☆ Spi0n.fr ☆ » Secouer l’écran avec Firefox
  22. 22 Nueva API de Firefox permite obtener orientación 3D : Blogografia
  23. 23 Nueva API de Firefox permite obtener orientación 3D « RSS2Blogs
  24. 24 kingtalk blog / news about user interface and interaction design brought to you by envis precisely
  25. 25 » Firefox 3.6 new device API: Orientation
  26. 26 RSS For Gadgets » Firefox 3.6 will support accelerometers, make the internet seasick (video)
  27. 27 Video: Firefox 3.6 soportará acelerómetros
  28. 28 OhMyGeek! – Firefox 3.6 soportando acelerómetro (VIDEO)
  29. 29 Apples Bewegungssensor schaukelt den Firefox « Der Blog des Integrationswunders
  30. 30 What’s new in Mozilla Firefox 3.6 Beta 1 « Vertical Tangent
  31. 31 5 years of Firefox at hacks.mozilla.org
  32. 32 谋智社区 » Blog Archives » 火狐五周岁──记录互联网变化的五年

Leave a Reply