Articles by Dan

You are currently browsing Dan’s articles.

Stephen Fry on the iPad

“One melancholy thought occurs as my fingers glide and flow over the surface of this astonishing object: Douglas Adams is not alive to see the closest thing to his Hitchhiker’s Guide [to the Galaxy] that humankind has yet devised.”
– Stephen Fry

Read more

Web site browser agents (2010 edition)

Okay, it has now been a year since I published web browser statistics for my various sites, so this seems like a good time to take stock of how things have changed over the past year.

Take Internet Explorer 6 users (please!), for instance. Surely their numbers have fallen?

Here are my overall numbers for March 2009 to March 2010:

  • 64% MSIE
  • 20% Firefox
  • 10% Safari
  • 6% Others (3% Chrome, 2% Opera)

So for the past year, MSIE usage actually increased, Firefox and Safari fell; Others held their own.

The Internet Explorer breakdown:

  • 38% MSIE 6.0
  • 36% MSIE 7.0
  • 26% MSIE 8.0

MSIE 8 has now been released for just over 12 months; and yet, it is only the third most popular version of Internet Explorer. Internet Explorer is the only browser with an upside-down adoption rate. Last year, MSIE 7 was the most popular version; this year, perversely, it is MSIE 6. MSIE 6 went up six points compared to last year.

Sigh.

Firefox:

  • 42% Firefox 3.5
  • 42% Firefox 3.0
  • 8% Firefox 2.0
  • 7% Firefox 3.6

Firefox 3.6 has only been out for about two months, so it’s on track for a 42% share of the Firefox segment. Firefox 2.0 had the most share last year, at 48%. Quite a contrast with MSIE.

Safari:

  • 57% Safari 4.0
  • 15% Safari 4.0 (mobile – iPhone/iPod Touch)
  • 10% Safari 3.2
  • 6% Safari 3.1
  • 5% Safari 3.1 (mobile)
  • 7% Safari 3.0, 4.1, and 2.x

iPhone/iPod share has increased slightly, from 15 to 20%. A year ago, 3.2 was new, and version 3.1 had the largest share.

I thought about blogging about this several months ago, but never got around to it. And don’t skip reading the comments.

Bypassing the Safari/WebKit caching bug

Anyone who has used Safari (or any other WebKit-based browser) to debug javascript has encountered the annoying “Resource interpreted as other but transferred with MIME type application/x-javascript” bug. When this happens, the source of the javascript file appears blank in the debugger, and various other things may go wrong (sometimes code isn’t executed, for example).

screen shot

This problem is caused by a WebKit bug, triggered when files are taken from the browser’s cache rather than from your server. The simple workaround is to force WebKit not to cache your javascript files while you’re debugging them. This is easy if you server supports PHP (it almost certainly does). Create a php file to serve your javascript, and have your test page include that instead of your javascript:

Before:
<script src="testing.js" type="text/javascript"></script>

After:
<script src="debug.php/testing.js" type="text/javascript"></script>

Where debug.php has:


<?php
header('Content-Type: application/x-javascript');
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
readfile(dirname(__FILE__).'/testing.js');
?>

Or, more generally:


<?php
header('Content-Type: application/x-javascript');
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
$file = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '/testing.js';
readfile(dirname(__FILE__).$file);
?>

If you use the general version, you may wish to include some security checks on the input (PATH_INFO) to protect against potential exploits. That is left as an exercise for the reader.

Of course, before you deploy, remember to change the script include back to the original form!

Photoluna 1.1

Photoluna 1.1 was released a few weeks ago, and is now available on the iTunes App Store. If you purchased version 1.0, you’ll be happy to know that this upgrade is free, and many of you have already updated to the new version.

Regrettably, I’ve been a bit behind the curve updating the Photoluna web site; most of the screen shots are from version 1.0. I was off on a two-week stint of jury duty just as 1.1 hit the store, followed by a bad cold that led straight into the holidays! The page should be updated soon.

« Older entries