web development

You are currently browsing the archive for the web development category.

Web site browser agents (2011 edition)

It is time once again to take stock of web browser statistics for my various sites, and see how they have changed since last time, back in March of 2010.

Here are the overall shares for March 2010 to June 2011:

  • 45% MSIE
  • 24% Firefox
  • 13% Chrome (WebKit)
  • 13% Safari (WebKit)
  • 5% Others (1% Opera)

So for the past year, MSIE usage fell significantly (from 64%!), Firefox and Safari rose slightly, and Chrome rose significantly (out of the “Other” category). Since both Safari and Chrome use WebKit, WebKit has now passed Firefox's Gecko engine to become the second most widely used browser engine.

The Internet Explorer breakdown:

  • 50% MSIE 8.0
  • 31% MSIE 7.0
  • 18% MSIE 6.0
  • 2% MSIE 9.0

Firefox:

  • 68% Firefox 3.6
  • 18% Firefox 3.5
  • 6% Firefox 4.0
  • 5% Firefox 3.0
  • 2% Firefox 2.0
  • 2% Firefox 5.0

Firefox 2.0 and 3.0 have now all but disappeared. Both 4.0 and 5.0 are simply too new to have garnered much share. It remains to be seen if 4.0 ever garners much share, or if users got directly to 5.0 (or 6.0, or…).

Safari:

  • 40% Safari 5.0
  • 18% Safari 4.0
  • 17% Safari 4.0 Mobile
  • 12% Safari 5.0 Mobile
  • 5% Safari 4.1
  • 4% Safari 5.1
  • 5% Safari 3.0–3.2

The total mobile share has jumped from 20% last year to 29% this year. Safari 5.0 did not appear on last year's chart at all.

I did not include a by-version breakdown of Chrome share this year; maybe next year. Because Chrome self-updates in the background, I would expect that the latest couple of versions to dominate.

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.

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!

Dan Benjamin over at Hivelogic evaluates ten different monospaced fonts for programming/terminal use in Hivelogic – Top 10 Programming Fonts. Inconsolata and Consola are both great fonts. I used Monaco for years and years; recently I’ve been using Consolas in BBEdit.

Saying good-bye to Internet Explorer 6

Effective today, I have ended support for Internet Explorer 6 over at my software site, http://banasmoo.com. That browser is now about eight years old, and woefully out-of-date. IE 8, released in March 2009, while not perfect, is considerably better than both IE 6 and IE 7. I would urge all IE 6 users to upgrade to IE 8, or consider switching to another browser altogether — such as Safari or Firefox.

My other sites will continue to support IE 6 for a little longer, however I expect to end support on all of my sites by January 1, 2010.

« Older entries