I saw this article yesterday and I wanted to test it in XPages – no issues – but it only works in the latest version of FIREFOX 13 – it is just amazing what your browser is going to be able to do in the (near) future.
http://www.smartjava.org/content/html5-access-battery-status-through-javascript
Demonstration in an XPage (Firefox 13 only)
http://demo.xomino.com/xomino/xPlay.nsf/xBattery.xsp
With the power plugged in

With the power plugged out

Not my work
I fully admit this is a complete rip-off and none of this code is my own – I just stuck it into an XPage to see if it would work
Mark, those are the BEST kind of posts tho – as they open the mind for most developers who wouldn’t consider that XPages could do this. Once you realize that XPages are a markup delivery technology, your limitations become that of the target client!
Chris – I agree – part of my purpose of this and all my blog posts is just to make people aware of the possibilities. Even if you are not able to use the capability now, you will at least have it parked in the back of your mind for later.
That said – I don’t like a straight rip off either – but in this case though there really isn’t anything to change or enhance – does exactly what it says on the tin 🙂