Under the Bridge

MobileSafari on 4.2

So there was a new iOS version out today, no doubt you noticed; but did you notice all the nifty new stuff in Safari? Nope, us neither, and it’s not documented yet apparently … but some people are hardcore enough to dig around themselves:

Safari on iPhone & iPad 4.2: Accelerometer, WebSockets & better HTML5 support

Apple didn’t update yet Safari documentation to reflect these new APIs. This information is based on JavaScript research and testing over Safari itself I’ve been doing. The list of new features I’ve detected are:

  • Accelerometer support through the DeviceOrientation API
  • WebSockets API from HTML5
  • Updated HTML5 Form Support
  • Partial XHR-2 Support
  • Print Support
  • New JavaScript data types
  • New DOM events
  • Enhanced SVG and Canvas support

All that’s pretty neat yep, and from the comments here’s another one:

@font-face has worked for a long time on iOS given some specific caveats. However, the new news on web fonts in 4.2 is that iOS now prefers the TTF version of a font over the SVG version (formerly SVG was the only format supported.)

The other nice thing about web fonts on 4.2 is that they now work in offline webapps. This was a big deal for me and I only discovered it by luck. Still; this will be a pretty handy feature for a lot of folks I think.

Presumably all these new goodies will apply to your embedded UIWebViews as well.


The site PADILICIOUS, mentioned in this year’s WWDC videos, has a wide range of iPad/MobileSafari focused good stuff!