The dark art of browser compatibility

You’ve been up all night furiously writing CSS and you’re itching to put your new design live. Hang on. You’ve checked this in Internet Explorer, right?

Get your facts right

Using Google Analytics, you can get an idea of the cross section of browsers being used to visit your site. You may be surprised to see that although the number of visitors using one of the older (and more troublesome) browsers is quite low, there is still the odd nut job surfing your site on Netscape Navigator.

Analytics -> Audience -> Technology -> Browser & OS

Analytics -> Audience -> Technology -> Browser & OS

Even if the percentage is low, don’t use this as an excuse to do nothing.

Lost revenue

A sale is a sale, and dismissing visitors on older browsers is just laziness. If you’re really serious about this whole eCommerce thing, fix your shit.

If you’re unknowingly (or even worse, knowingly) missing sales because your checkout doesn’t work in Opera 10, this is money down the drain. If you’re paying for visitors who simply can not convert on your site, you’d be better spending your money on Findus shares or a book of HMV vouchers.

So the lesson here is make time for a few hours testing, fixing and testing again. There will be financial rewards to gain in the long run.

Internet Explorer

The mention of the name alone is enough to send any seasoned web developer in to a blind rage. But like programming languages, there is the tendency to needlessly “slag off” what other people use when it comes to browsers, or feel your tool of choice is somehow superior. “I use Chrome”. Nice one.

I’m not saying Internet Explorer is perfect, but like it or lump it, people use it. Don’t let the “You’re an idiot for using IE” attitude prevent maximising sales.

If you employ an agency or developer to take care of this stuff, don’t let them fob you off with excuses like “low browser market share”.

Getting Internet Explorer to play nice

In previous versions of Internet Explorer, you could use “conditional CSS”. Microsoft, having decided to give the finger to most conventional web standards allowed for version specific CSS to be applied to smooth over the fact their browser was pretty flaky.

By using these conditional statements in your page, you can add version specific CSS for Internet Explorer users to iron out any nastiness.

Internet Explorer 10

But hang on, what’s that you say!? Windows 8? Internet Explorer 10? Hurrah! At last, no more conditional CSS required!

Oh wait, it’s still broke.

So now we’ve established Internet Explorer 10 is also doing weird stuff, we can employ some server side magic to detect the browser, or my preferred method, use some Javascript Kung Fu instead.

Using a Javascript framework (such as jQuery) you can quickly check for the browser type (and version) and update the HTML when the  page when loads.

Testing browser/OS combinations

This can be a bit of a headache. If you have Windows 7 or later, you can setup up older versions of Internet Explorer on a virtual machine.

However you’re still left with Mac OS X, Lion, Mountain Lion, and the several different flavours of Linux desktop distributions to test on.

Don’t forget mobile browsers either. Think about the shopping list required if you were to buy every combination of hardware / mobile OS, it’s going to get pricey.

At Copify, we use a web based product called Browserstack. It allows you to test many combinations of OS (both desktop and mobile) with all the available browsers.

Desktop OS / Browser combinations

Desktop OS / Browser combinations

Multiple combinations of OS/Hardware

Multiple combinations of Mobile OS/Hardware

 

There are literally dozens of combinations to test with. Go grab a coffee, and give their free trial a go.

Testing with Safari on iPad2

HTC running Android

Whether you’re setting up multiple machines or using a tool like Browserstack, don’t underestimate the value of testing. You never know how many sales you might have let slip.

Post to Twitter

We ♥ IE6

We’re constantly deploying new features to Copify.

Some are small updates that users are unlikely to notice. Others, where changes to the user interface are involved, require a bit more care and attention to make sure things are hunky-dory when it comes to cross-browser compatibility.

Let’s face it – the Internet is a mess. There are so many different browsers and devices, ensuring that your web-app works on all of them can be a bit of a minefield.

Thankfully, most modern browsers play nice, and all render HTML & CSS pretty much the same way.

Oh wait, no. They don’t. Do they, Bill?

Many agencies and web developers have fought hard for a long time to “convert” as many people as possible away from Internet Explorer, and with recent stats on browser usage it looks like it’s not all been in vain.

However, we still have a significant number of visitors using older versions of Internet Explorer (mainly IE6 and IE7) causing us headaches. One of the biggest headaches is testing.

If you’re on a Mac, or running Windows 7, you can’t just download IE6 and see how your site looks. You’re going to need XP.

In this post I’m going to show you how we use a virtual machine to test these older pesky browsers.

All you need is Windows 7 and a few gig disk space going spare.

Ready? You were born ready!

Windows Virtual PC

Head over to Microsoft’s website and download Windows Virtual PC. You don’t need “XP mode” so you can skip this if you like, just make sure that you select the correct version of Virtual PC for your machine and operating system.

Make sure you get the correct version 32bit V 64bit

Once the download has finished, have a bash at installing. You’ll figure it out.

Windows Virtual PC VHD

Next, you need to download the Windows Virtual disk image to run.

I need to test IE6 and IE7 on Windows XP so I download the package called “Windows_XP_IE6.exe”.

Take the mouse in your hand and click the thing that says “Download”

The disk image comes with Windows XP and IE6, and also the installation files for IE7.

However, once you’ve installed IE7 you can’t run IE6 again. So make a copy of the first image, rename it and use this for IE7.

Make a copy if you need to use both IE6 and IE7 regularly

Fire up Windows Virtual PC

First off, select which image you want to run.

Right click on the Windows XP VMC and enter “Settings“. From here you can choose which image to use. Change the setting for “Hard Disk 1″ and browse for your disk image.

Choose which disk image to run

Login issue

As with many Microsoft products, there is some kind of annoying, inexplicable problem with its use. In this case, it’s the fact you are presented with an impenetrable login form.

To get round this, choose “Disable Integration Features”. No idea what this does, but it gets you to login screen that works!

Disable this to get to the normal login

You can now login with the username “IE User” and the password “Password1“.

Password is case sensitive! Bless.

IE6

You’ve now traveled back in time and are about to experience the wonders of 1990′s web browsing. I suggest playing some classic Nineties pop tunes  while you test to get the the full effect.

OK let’s Brogram this Mother until all the horribleness is gone. Done? Great!

Probably losing £££s because of this, but it’s too funny to care

We’ve made our fixes to ensure IE6 users get the best browsing experience, and we’re now ready to do the same for IE7.

IE7

If you never wish to use IE6 ever again in your life (highly likely) then just run the IE7 install.

Unfortunately for me I may have to revisit good ol’ IE6, so I just reconfigure Virtual Machine to use the image copy I made earlier. I’ve renamed them so I know which is which.

Choose the IE7 image this time

Again, work your magic and fix all the nasty codez with some CSS hacks.

If like us, you’re using Git (What? You’re not using Git? Why not?) this is a good time to commit your changes and wave and scream at your boss, hinting you’ve made your website look great for pensioners and public sector workers across the country.

Commit your changes. Feels good.

Having problems following this guide? Tweet now or forever hold your forever hold your peace.

Post to Twitter