Browsers are getting smarter and more aware of their surroundings.
A promise represents the eventual result of an async operation. These are like events or callbacks but are resolved asynchronously, they lead to more readable code than callback hell. Can also handle multiple results without needing a global state var to manage them. There are some versions of this in libraries but they are coming natively - already in FF, Safari and Chrome.
Ambient light events
Gives access to the device's ambient light sensor via an event when it changes. Event is
event.value is the lux value of the new ambient light. Currently working in FF 22 including on Android.
navigator.vibrate(milliseconds) - simple. milliseconds argument can be int or array of ints.
Web speech API
Text to speech. Create a new
SpeechSynthesisUtterance('string') - can specify different attributes and then call
Speech recognition - this needs an internet connection.
getUserMedia + WebRTC can be used to share the screen.
Allow us to persistently cache resources and handle requests to these resources, even when the network isn't available. This allows us to build better offline apps. There is a shared worker that lives across page loads and an HTTP cache. Not available anywhere right now - just a specification. Firefox are looking into implementing this.
- Mini API
- Battery Status API
- Web Crypto API
- URL object
We need to use these things and feed back to browser vendors to help them make them better.