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.


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
A compass API would be nice.
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!
@Lloyd: Bug tracks this, and AFAICT, the second patch fixes the behavior for at least some of the new MBPs.
Sorry, the link didn’t get posted above. The bug in question is https://bugzilla.mozilla.org/show_bug.cgi?id=521848
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?
Please don’t hurt the web (and me), use open standards (like HTML(), OGG Theora, etc.) !
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.
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!
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.
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.
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’
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.
@Audrey – Yep! This will be in Fennec 1.0 as well since it’s based on the same code as 3.6.
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.
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.