Mobile Safari

The iPhone and the iPod Touch both run a device-specific version of Safari that has a few peculiarities, ranging from rendering and media capabilities (i.e., no Flash) to JavaScript and DOM quirks.

Here’s what I know about it:

Full Screen Apps

Adding the following meta tag to a web page will let you create home screen bookmarks that launch without the Safari chrome:

<meta name="apple-mobile-web-app-capable" content="yes" />

User-agent

The first official iPhone User-Agent was:

Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3

The first iPod Touch User-Agent was:

Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML,like Gecko) Version/3.0 Mobile/3A100a Safari/419.3

However, things have changed with consecutive firmware updates, so here is a sampling of what I found in my server logs, together with dates (IP addresses removed, since besides a bunch of hits from Apple corporate itself, there were others a lot more… revealing. Whoever happens to be reading this site deserves to know I respect their privacy):

[28/Feb/2007:23:14:06 +0000] "Mozilla/5.0 (iPhone; U; ARM OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Safari/419.3 Version/3.0 Mobile/241"
[15/Mar/2007:06:17:14 +0000] "Mozilla/5.0 (iPhone; U; XXXXX OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Safari/419.3 Version/3.0 Mobile/241"
[22/Mar/2007:06:39:15 +0000] "Mozilla/5.0 (iPhone; U; XXXXX like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Safari/419.3 Version/3.0 Mobile/241"
[28/Apr/2007:07:50:00 +0100] "Mozilla/5.0 (iPhone; U; PPC like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A001a Safari/419.3"
[15/May/2007:01:00:58 +0100] "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A523a Safari/419.3"
[28/May/2007:00:00:35 +0100] "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A537a Safari/418.4"
[12/Jun/2007:04:13:45 +0100] "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3"
[21/Jun/2007:16:42:06 +0100] "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A538a Safari/419.3"
[01/Aug/2007:18:23:01 +0100] "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C25 Safari/419.3"
[22/Aug/2007:03:58:51 +0100] "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3"
[07/Sep/2007:00:20:48 +0100] "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko)" - spoof?
[08/Sep/2007:13:54:10 +0100] "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A538b Safari/419.3" - spoof?
[09/Sep/2007:02:32:03 +0100] "Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML,like Gecko) Version/3.0 Mobile/3A100a Safari/419.3"
[30/Sep/2007:08:05:03 +0100] "Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A110a Safari/419.3"
[30/Sep/2007:14:02:36 +0100] "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A109a Safari/419.3"

The above involved piping my logs through the following incantation of cut to obtain the correct fields:

cut -d\  -f 4,5,12-

There is no X-WAP-Profile header or any typical characteristic of mobile browsers. Mobile Safari is, for all intents and purposes, a complete (i.e., desktop-like) browser.

The interesting bit is that there were originally rumors of X-headers being sent, but I have no hard evidence in my server logs (naturally, since nothing logs extra headers unless you look for them specifically).

Resources:

Category Date Link Notes
Articles Aug 07 Put Your Content in My Pocket, Part 2 A List Apart on adapting sites for the device.
Web Development for iPhone Apple’s documentation
Make the most of the iPhone SDK Notes on WebKit and CSS that may be of particular interest to iPhone developers
Apps Oct 07 Conspiracy a brilliant canvas-based graphing calculator.
Templates Oct 08 iWebKit Another template oriented at designing sites with static content. Loads of CSS variations and icons, even though not all of them comply with the standard dimensions.
Oct 07 iPhone CSS skin a CSS template for writing your own apps
Generic Jun 07 Tim Bray’s visitation
Abe Fettig’s initial set of notes