Rey Bango

Web developer, honey badger

Interview on IE10

Last year I was graciously asked to be a guest on Jen Simmons The Web Ahead show. Very cool experience and I forgot to add it here. Listen in as I talk about IE10 and web development:

The Web Ahead: Internet Explorer 10 with Rey Bango

Back at Microsoft…

What a whirlwind day it’s been. As I mentioned earlier, Friday was my last day at Microsoft so I could chase the dream of programming in Clipper and MS-DOS. I was just about to push the “Buy it Now!” button on an eBay auction for Clipper 3.5″ disks when I got the call from my former manager Jeff Sandquist promising an endless supply of Reeses Peanut Butter Cups and 30 26.5 ounce bottles of Nutella if I came back to Microsoft. He also said he would force Nishant to report to Clint going forward. It was an offer I couldn’t refuse so starting this afternoon, I’m back at my original role at Microsoft.

It was an exciting day indeed and I’ll look back on Clipper fondly but I know where I’m needed…at Microsoft and pushing for the open web!

On Leaving Microsoft…

PLEASE READ: Since a lot of people are still reading this post & thinking I actually left Microsoft, I’m adding this note to clarify that this was an April Fool’s joke. Please check the post date. :)

Friday was my last day at Microsoft. It was a bitter-sweet moment for me having been there for 3 years and feeling I’ve done my best to contribute to the web initiatives at this wonderful company. After chatting with my manager Jeff Sandquist, though, I realized that I wasn’t moving in the direction that I wanted and needed a change. It had nothing to do with the company and especially not my peers. I’ve been so fortunate to work with such an amazing, passionate and intelligent group of people, by far the best I’ve ever worked with…ever. And the things I’ve experienced, the work I’ve done and the places I’ve been have all made my time at MS completely worthwhile. It was one of the best decisions of my life to work at the greatest software company in the world. But I really needed to chase my passion and Microsoft wasn’t filling that need for me.

So starting today, I’m going to do just that. It could be that I just turned 45 but I don’t want to look back and live a life of regret for not chasing that dream and working in the technology which is my passion…Clipper.

I’ve realized that this “web” thing is getting stale and people are losing interest in it. It’s all about the desktop again and I want to make sure I’m on top of this new wave. I got my start programming Clipper and remember how powerful it was for building apps and I know it’s gonna be the comeback technology of the next 5 years. Features like t-browse, .dbf files, and the dBase syntax make it so incredibly powerful and an obvious choice for the next wave of immersive and scalable experiences. And I’m stoked because it looks like I can still snag a copy of the Funky lib for Clipper! Even Class(y) is free now! Open source FTW!

Thankfully, Amazon shows 8 used copies of Programming in Clipper 5 and I scored a copy of the Clipper 3.5″ disks on eBay so I should be good to go as soon as I buy a 3.5″ floppy for my desktop. Also, it’s badass that I won’t need to worry about complex OSes like Windows, OSX or Linux anymore. I can finally pop in my MS-DOS 4.01 disks and get back to the REAL terminal, not that fake stuff in those overpriced PCs everyone’s been buying lately! The great thing is that with PCs being as powerful as they are, I no longer have to worry about configuring himem.sys or emm386.exe to get as close to 640k as possible. Booyah!

I’m still going to keep some systems using Windows 8 and OSX around since I plan on using Clipper to build both Win8 and iOS apps. I may also write a Clipper lib to interface with Google Glass. MS-DOS in eyewear; huzzah! I’m sure I can link to them via an RS-232 cable or something.

I just want to close out in thanking all of my buds like @rainypixels, @allenjs, @jeffsand and @ClintRutkas for being supportive of my decision and for @shanselman for bringing me into the fold. You guys have been awesome.

My new company name will be called “I’m Seriously Not Crazy Enough to do This, LLC.”.

Wish me luck!

Submitting an Internet Explorer Bug to Microsoft

Today, I got this tweet by Patrick Kettner asking how to submit an IE bug report:

I’ve been asked this a number of times and this was a great opportunity to post the steps on how to do it.

I’m not going to sugar coat it because I personally think the process is WAY too complicated and I’ve complained to the IE team about this. Thankfully, they agree and are looking at how to streamline the process.

First time Submitting a Bug

If this is the first time submitting a bug to Microsoft, you’ll need to register on the Microsoft Connect site.

Go to Microsoft’s Connect site. You’ll need to sign in to use the site. It requires a Microsoft Live account. If you already have a Live account, then login and follow the steps below. If you don’t, you’ll first need to create one (you’ll be presented with that option). I’m not going to show you how to register for a Live account because it’s very straightforward. Yes, I hate the fact that you need to do this too but thankfully it’s a one-time deal.

Once you’ve created it, follow the steps below.


When you’re back at the Connect homepage, do a search for “IE10 Public Feedback”:


This will pull up the entry where you can join the IE10 Feedback group and submit bugs. You’ll see a “Join” link to allow you to do this:


If this is your first time using Connect, you’ll be prompted with a registration page and profile setup pages. This is a one-time deal and you shouldn’t be presented with these pages next time around:




Once you’re through that you should come to the IE10 Public Feedback page. This is where you’ll start submitting feedback by clicking on the “Feedback” link:


When the feedback page comes up, scroll down and you’ll see a big “Submit Feedback” button. Use that to submit your bug.


Returning to Submit a Bug

If you’re coming back, I’m assuming you already have a Microsoft Live ID so sign in:


and when you’re brought back to the Connect homepage, click on the dropdown in the upper right corner to go directly to the Internet Explorer Feedback Program page. No need to search for it when that shortcut is there:


Submitting Good Feedback

Any software maker will tell you the same thing; provide detailed steps and a test case if possible to make isolating your issue as easy as possible. If you simply type, “My site doesn’t render in IE9″, you’re making things more difficult. Take the time to really isolate the problem and provide detailed, concise information so that the IE team can properly determine if it’s a bug and even if there’s a workaround.

I recommend using tools like JSBin or JSFiddle to provide live test cases for the IE team to look at.

Improving the Process

I know this can be a cumbersome experience and we’ve received a lot of feedback about how frustrating it is to submit a bug. The IE team is working on improving this so bear with us while this gets worked on.

Special thank to Patrick for the motivation to put this post up.

The Reality of the OSX App Store

My first foray into OSX was way back in 2008 with a MacBook Pro. I learned about the apps that were important to web development and when I got a new MacBook recently, I of course referenced the list of apps I had previously used. One of those is Transmit by It’s arguably one of the best FTP programs out there. The new OSX App Store made it easy to find, purchase and install it, so I did just that.

All was good until last night when I had noticed no updates in awhile to many of the apps that I had purchased via the App Store. I checked the version of Transmit and noticed it was v4.2. So I went over to Panic’s site to compare and noticed the latest version is v4.3.2. WTF? I emailed Panic and it turns out that they’ve submitted it to Apple for review but it hasn’t been approved yet. They also told me that I can’t transfer an App Store license to a direct download license. Ugh. :(

It made me realize that I had chosen comfort & ease-of-access over functionality and timeliness. I don’t blame Panic in any way for this. It’s my fault and I’ve learned a lesson. Going forward, I’ll be hard pressed to purchase apps from the OSX App Store. Maybe consumer needs are different & may not require keeping things updated but as a developer, I prefer to have bug fixes & features available to me as they come out.

For now, I’m stuck with Transmit v4.2. Still a great app; just not as great a v.4.3.2.

Update: Panic emailed me back and told me that Apple FINALLY approved the newest version after two weeks. Man I feel for application developers like Panic who have to deal with this.

Making Internet Explorer Testing Easier with new IE VMs

When Microsoft first launched modern.IE and revamped the way that IE VMs were offered, I wrote up a post that talked about how to install them. Since then, the site has changed so it’s time to update this post to reflect not only the new UI of the site but the new method of downloading individual VMs.

If you haven’t heard about modern.IE, then definitely read up on it here:

Introducing modern.IE – Testing sites for Internet Explorer made easier

The New Way to get IE VMs

Up until now, if you wanted to test different versions of IE natively you had to download VPC images that would allow you to run virtual machines for the different versions of IE. It wasn’t a great solution because:

  • They were designed to be run in Microsoft’s Virtual PC software making it hard for non-Windows developers to use them.
  • They were broken apart into multiple, large download files

There were ways to use them on other OSes but it required some work or unofficial scripts to convert them. Either way, the IE VPCs weren’t very easy or convenient to use.

We wanted to make this easier so as part of the modern.IE project, we created a new set of VMs that targeted your OS and your VM-specific software.

When you hit the page “Test across browsers” page, scroll down until you see this:


This is the section that helps you to choose the right OS and platform. Now, you’ll be able to choose your OS:


then choose the VM software:


and download the VM with the version(s) of IE you’d like to install:


You’ll need to download ALL of the files listed for the specific version of IE you’d like work with. Depending on which OS you’re using, you may see a combo of *.exe/*.rar files (Windows) or *.sfx/*.rar files (OSX/Linux). The *.exe & *.sfx are self-extractors which will look for all of the files and combine them into the single VM you’ll need.

The great thing about this process is that:

  • You can use the VM software of your choice
  • You only have to download the files once per VM. They can be reused to recreate the VM after 90 days.

Currently, we’re offering VMs that will run on:

  • Windows
  • OSX
  • Linux

The VM software choices are specific to the OS you choose:

  • Windows – Hyper-V, Virtual PC, VirtualBox & VMWare Player for Windows
  • OSX- VirtualBox, VMWare Fusion and Parallels
  • Linux – VirtualBox

One thing to note is that it’s best to use an updated version of the VM software, especially for the Win8 VMs. Otherwise, you may encounter issues with the VM software not being able to run the virtualized OS properly.

The IE versions being offered are:

  • IE6 on Windows XP
  • IE7 on Vista
  • IE8 on Windows XP
  • IE8 on Windows 7
  • IE9 on Windows 7
  • IE10 on Windows 7
  • IE10 on Windows 8
  • IE11 Developer Preview on Windows 7
  • IE11 Developer Preview on Windows 8.1

For all intents you can now test against a full copy of any version of Internet Explorer.

Extracting the Virtual Machine


Notice that for IE9 on Win7 for VirtualBox on Windows, I’ve downloaded 5 files.


I need to run “IE9.Win7.For.WindowsVirtualBox.part1.exe” to kick off the extraction. This will prompt me for a destination folder to extract to:


Note that once the extraction is completed, the dialog box just disappears and you won’t get a prompt that it’s done. Hop over to your directory and you should find the newly extracted VM file waiting for you:



OSX users have it even easier because you can use cURL to pull down all the files in one swoop. Just look for the “Grab them all with cURL” link and click on it. It’ll give you a popup like this:


Open up terminal, “cd” to the directory where you want to download the files and paste the link displayed to kick off the download. Easy peasy.

To extract the virtual machine, you’ll need to go into terminal and set execute permission on the .sfx file like this “chmod +x filename.sfx”. You can then kick off the extraction by running the file: “./filename.sfx”.


You can find fully detailed installation instructions for the downloaded VMs in this PDF.

Installing the VMs

The VMs may come with some minimum resource settings already preconfigured. Here’s what I recommend to ensure you get a decent performing VM:

  • Give your VM a minimum of 1GB of RAM
  • Give it the most amount of video memory possible

Remember that you’re VM is an OS and it needs resources. Unless you’re loading multiple VMs at the same time, a gig of RAM shouldn’t have a major adverse issue on a decent system. Also note that while IE9 & IE10 support GPU-enhanced rendering, don’t expect the same performance in your VM as you would get from a native system.

The VMs you download are in compressed format. Once you’ve got them on your computer, you should run the extraction executable I referenced above to extract them for use. This will create the virtual machine file that you’ll import into your VM software. Again, you can find fully detailed installation instructions for the downloaded VMs in this PDF.

VirtualBox on Windows

Installing on VirtualBox is usually as easy as double-clicking the .ova file that you extracted.


When you do this, you should get a VirtualBox dialog like this:


Click on the “Import” button and VirtualBox will do the rest. It’s really that simple.

VMWare Fusion

The VM software I use on OSX is VMWare Fusion so here are the steps I went through to setup the Win8/IE10 VM.

Click on the “Add” drop down to create a new VM:


Choose “Continue without disc”:


This should present you with a screen to “Use an existing virtual disk” which is exactly what you want to do:


I chose the “Select to create a copy of it” so that my original download isn’t affected and it makes a copy in the default VMWare VM directory. When you select the image, it will display a prompt asking if you want to convert it to an updated format:


Don’t convert it. I tried to and it seemed to corrupt the VM.

Select the proper version of Windows. These are 32 bit versions of the OS so the standard OS selections are fine (i.e.: not 64-bit). At the “Finish” screen, click “Customize Settings” to give the VM a better name like “Win8 – IE10″ and from there, VMWare will beging the process of copying the disc to the default VM directory and present you with the new VM:


Before you start the new VM, change the RAM settings so your VM won’t have any trouble starting up. Again, I recommend a minimum of 1GB of RAM:


Your VM should now be ready to use.

REALLY IMPORTANT: If you’re using a Win8.x-based VM, be sure to set your screen resolution in the VM to a minimum of 1366×768 if you want to be able to use Internet Explorer. Internet Explorer desktop can launch in smaller resolutions but IE10 for Win8 and IE11 Developer Preview for Win8.1 are a Windows apps and needs the higher resolution. You’ll also want this for testing snap mode.

VirtualBox on OSX

Chris Wharton has written up a quick guide on how to get the Virtualbox VMs running on OSX. Just follow the steps I outlined for extracting your VM and then follow Chris’ steps for installing in VirtualBox.

Time Limits on the VMs

All of the VMs have a time limit 90 days of total time from the moment you first use the VM. Basically it’s 30 days usage with two 30-day rearms. To rearm, go into a command prompt with Administrator privileges and type in “slmgr –rearm

At the end of the 90 days, you’ll be able to use the VM for an hour before it shuts down. At this point, you’ll need to decide if that’s okay or if you’d like to recreate the VM and use it for another 90 days. Remember, you can reuse the same files you originally downloaded to recreate the VM so don’t delete them (unless you just love downloading big files).

Functional Limitations

I’ve been told that these images aren’t crippled and in my testing, I was able to apply updates and do installs with no issues. I would HIGHLY RECOMMEND that you run Windows updates when you use these VMs to get the latest updates and patches. Also, install an anti-virus software. Microsoft Security Essentials is free and will do the trick. If you’re running a Windows 8.x VM, it comes with anti-virus already.

The Results of my Essential Tools, Libs and Frameworks for Front-End Development Survey

Two days ago, I put up a simple survey that asked what essential tools, libs and frameworks you were using for front-end development. I closed out the survey last night a little before 9pm EST and after getting 1000+ responses. I now want to share the results.

Why Am I Doing This?

As I’ve mentioned, this was an incredibly unscientific survey and not meant to determine which tool is best. Just which tools seem to be in heavy use.

I’m doing this to help web developers (myself included) stay on top of commonly used tools. Since change constantly but at least this gives a snapshot of what’s frequently used.

A couple of people buzzed me (some complaining and eluding bias), because I hadn’t listed “x” tool or lib in the survey. The survey wasn’t meant to be all-inclusive and if you look at the “Other” section below, you’ll see how adding everyone’s favorite tool would’ve been impossible. That’s what the “Other” option was for. Ultimately, instead of looking at what wasn’t there, you should read this for what was selected to determine if you need to get up-to-speed on specific tools.

The Process

After closing the survey, I removed all blank records and then went entry by entry to factor in the “Other” submissions and list out tools not originally added on the survey. I did my best to list every technology mentioned although it’s quite possible I may have missed something. If I did, it was purely accidental.

I ended up with 1031 total responses that I felt were good submissions. The results shown below for the main list was based off of what Google Docs provided. I didn’t do those calculations but I have to assume they’re correct.

Important to note is that the following options were added after 218 people had already replied so those values could’ve been much higher if added at the beginning. This is evident in Git & Coffeescript’s high numbers despite being added late.

  • LESS
  • Git
  • ExtJS
  • Ember.js
  • prefix-free
  • JSBin
  • JSFiddle
  • dabblet
  • Kendo UI
  • Wijmo
  • Coffeescript
  • YUI

Results from the Main List

Results from the “Other” Submissions

The ones listed below were submitted via the “Other” option and not on the main list.

A note about Enyo

EnyoJS is a framework released by HP which looks to have come out of the great work done by Palm. I haven’t used it and don’t have an opinion whether it’s actually awesome or not. I’ve held off on including it in these stats, though, because there was a high number of out-of-place submissions for it and they seemed clustered together around the same time. Additionally, MANY were single Enyo submissions with no other option chosen. Just seemed too odd to me but I’ll put out the data and if someone else wants to publish, go for it.

The Raw Data

Here’s the raw data from the survey. Please feel free to use it as you like and I hope it helps you out.

Raw Data from the Survey (.csv)

Essential Tools, Libs and Frameworks for Front-End Development. What are you Using?

UPDATE: The poll is now closed. You can see the results in this blog post.

I want to compile a list of the most common tools, frameworks & libs web developers are using today. Things seem to change daily with new, cool, and helpful projects announced all the time. It’d be great to nail some of these down as a reference.


HTML5 Boilerplate

Rebecca Murphey took a stab at this a couple of months ago.

So, what are you using that makes your front-end dev insanely easier?

Hey Paydirt: Your Site Works Just Fine in IE

One of the things that I’m passionate about in my role at Microsoft is helping developers ensure that their sites provide an awesome experience in every browser. Yeah, yeah I know it seems odd that a Microsoft evangelist would say this but it’s the honest truth and anyone who’s worked with me before knows that I take great pride in this effort.

We’re Not Supporting IE!

Today, I came across this article on HackerNews which caught me totally by surprise:

We don’t support Internet Explorer, and we’re calling that a feature

When I checked out the site entry, it directed me to a startup called Paydirt which has a very slick looking time-tracking & invoicing app. In their blog post, they rattled off a couple of reasons why they’re not supporting Internet Explorer and they were pretty upfront about it:

“That’s why we made a key decision at Paydirt: we don’t support IE – at all – and we don’t pretend to. You can’t even sign up for Paydirt using IE.”

They also mentioned that sensible browsers support cool features:

“Sensible browsers can do amazing things (canvas, SVG animations, CSS3, web-sockets, blazingly fast JS), and limiting usage to these lets Paydirt take full advantage of these new technologies.”

So of course, I had to dig in to figure out what magical features they were using that IE9, and especially IE10, didn’t handle.

Um…it works in IE

Sure enough, when I tried to sign up, I was blocked. So I used the IE F12 tools to fake the Chrome user agent string and, bam, I was able to sign up with no issues. The signup was painless and I waded through the app with Chrome & IE side-by-side. As I went through, I didn’t notice any differences in the functionality. Buttons worked as expected, data was being saved and even panels with fading functionality worked as expected. I was stumped because I couldn’t see what was preventing a user from using Internet Explorer on this site.

Chrome, IE10, IE9/Win8, IE9/Win7 Screenshots of Paydirt

Why is there code in here for IE support?

Next, I dug into the code and again, didn’t see anything that I could pinpoint as an issue. In fact, the Paydirt team had done a nice job of laying out their site using standards-based code. This is precisely what you want to see; developers using standards. As I dug through more files, I came across their main CSS stylesheet called paydirt-e08a29afb369fe41806659f40ff86301.css. When I looked in it, two things immediately popped out:

  • They were using many CSS3 features supported since IE9, like transforms & border-radius, but just not adding the –ms vendor prefix entry
  • They had the “-ms” prefix for CSS3 gradients which was added in IE10
  • They added support for -khtml-box-shadow but not -ms-box-shadow???

This threw me off because in their blog post, their concern was the IE didn’t offer amazing feature support yet many of the features they implemented are readily available in IE9. In addition, they had actually done some initial work on supporting CSS3 features that are vailable in IE10 (e.g.: transitions & CSS3 gradients).

At this point, I’m completely stumped because:

  • Their site works great in both IE9 & IE10
  • They’ve included support for some IE features in their CSS
  • They want sensible browsers that do amazing things and everything they’re doing is supported by IE9 & IE10. All they have to do is add the “-ms” vendor prefix just like they did for Webkit and Firefox. (They didn’t support Opera either unfortunately).

It works in IE so why not just Open it Up

So we’re left to wonder if IE issues are the real reason they didn’t support the browser. And trust me, I totally get the pain developers went through. I’ve only been with Microsoft for 2 years and was a web developer WAY before I joined them (even part of the jQuery project team). But IE9, and especially IE10, have come an incredibly long way since the IE6-8 days and I’m having a hard time rationalizing Paydirt’s decision here – particularly since it’s exactly this type of behavior (writing for or against specific browsers) that sets the Web back again.

Mind you, if their only reason was that their traffic didn’t justify the support for IE6-8, I could understand it. But one of the things that Microsoft has been advocating for is the concept of “same markup” and Paydirt is a great example of this. Despite them not wanting to support IE, because they used standards-based markup, the site just works in IE9 & IE10. And that totally contradicts Paydirt’s arguments about saving time and lack of feature support. Their site JUST WORKS!

Now, it’s not to say that if you really dig deep you may not find some issue. That happens actually in every browser and is not unique to IE. But seriously Paydirt, do you really want to use these arguments when your site actually does render great in Internet Explorer? Have you checked it out? Perhaps being a Mac-based company, testing may be the issue. If it is, then let’s discuss the options.

Claiming, though, that not supporting IE saves you time when your site is working just fine in IE9/10 is a tough sell. Let’s talk. I’m happy to help.

Update: Closing comments on the post. Plenty of lively feedback which regardless of your stance, I truly appreciate.

iOS to IE10 Metro: Building Cross-Browser Plugin-Free Experiences

I’ve had the good fortune of working with my friend Jonathan Sampson recently on figuring out how to help developers build plugin-free experiences. With IE10 Metro going plugin-free, it’s incredibly important to document steps to help developers provide their users with great experiences without the need for proprietary 3rd party add-ons.

If you’ve built a plug-in-free browsing experience for the iPad, a few changes will make it ready for the new IE10 plug-in-free experience on Windows 8. As more browsers adopt the plug-in-free approach, now is a good time to start thinking about it. I’ll show you how to do this in a few steps below by writing code that works well in all modern browsers.

Today we’re going to work with a MSNBC plug-in-free experience for rich media. It breaks down to two things: styles and scripts.

To modify the files of MSNBC, I will be using a proxy application known as Fiddler. You can download this tool from This tool allows me to modify remote files as though they were on my local machine. If you have direct access to your own site, you can ignore Fiddler, and work directly with your files. Fiddler provides a great way for testing changes without the risk of breaking your live site.

Step 1: Declare Standards mode and valid markup for modern browsers

In order to use the HTML5 elements we’ll be utilizing below, you’ll first need to ensure that you are operating in standards mode. One way to ensure this is to include the HTML5 doctype at the top of your document:

<!DOCTYPE html>

Step 2: Update your CSS vendor prefixes

The CSS language is constantly in a state of change as new features are suggested, updated, and standardized. In order to allow developers to learn how to use these new features, browser vendors typically offer experimental implementations via prefixed properties.

A key part of using vendor prefixes responsibly is to ensure that prefixes from each vendor are included in your site to allow for the broadest level of feature support. In many cases, especially when building an iPad-centric site, you may have focused solely on -webkit properties, omitting the prefixes which target other browsers such as -o, -ms, and -moz. The end result of this is that you greatly limit the target devices that can render your plugin-free site to as well as provide a degraded experience for users of other modern browsers, many of which could serve up equally engaging functionality.

For instance, we find the following on MSNBC:

background: -webkit-gradient(
  left top,
  left bottom,
  color-stop(1, rgba(192,192,192,.6)),
  color-stop(0.5, rgba(0,0,0,.6))

With the growing trend towards an HTML5 plugin-free experience, it’s important to expand these rules to provide the vendor prefixes of other major browsers as well.

background: -webkit-linear-gradient( 
  top, rgba( 0, 0, 0, 0.0 ) 0%, rgba( 0, 0, 0, 0.6 ) 50% );
background: -moz-linear-gradient( 
  top, rgba( 0, 0, 0, 0.0 ) 0%, rgba( 0, 0, 0, 0.6 ) 50% );
background: -ms-linear-gradient( 
  top, rgba( 0, 0, 0, 0.0 ) 0%, rgba( 0, 0, 0, 0.6 ) 50% );
background: -o-linear-gradient( 
  top, rgba( 0, 0, 0, 0.0 ) 0%, rgba( 0, 0, 0, 0.6 ) 50% );
background: linear-gradient(
  top, rgba( 0, 0, 0, 0.0 ) 0%, rgba( 0, 0, 0, 0.6 ) 50% );

While more verbose but the benefits to broad browser feature support certainly outweigh the extra typing involved. In addition, there are a number of great tools that can break down this workload, such as SASS and Compass, -prefix-free, or even CSS Snippets in the upcoming Visual Studio 2011.

Also, if you’re working predominantly in JavaScript and would like to save time determining which features are supported by your client’s browser, review the instructions in A Best Practice for Programming with Vendor Prefixes on the IEBlog.

Step 3: Get rid of browser sniffing methods

There are two methods used to determine what the user’s browser and device are capable of. One method, which unfortunately is somewhat popular, is browser sniffing. This method consists of examining the navigator object for certain patterns or values.

if ( navigator.userAgent.indexOf("iPad") > -1 ) {
  // Load HTML5 Experience
} else {
  // Load Flash Experience

The above code looks at the user agent string for the value “iPad”, and if found delivers a plug-in-free HTML5 experience. Otherwise, it’s assumed you are on a device that has Flash installed. This will result in a broken experience for non-iPad users who are browsing with plug-ins disabled, even though their browser is capable of handling HTML5 features.

Here is an attempt to find the version of Internet Explorer.

if ( tests.IE ) {
  j = /msie.(\d\.\d+)/i;
  k = navigator.userAgent.match(j)[1];

The user agent string is tested for a pattern that attempts to target the version number. This pattern looks for a single digit, followed by a period, followed by any number of additional digits. While this test will find values like “MSIE 8.0” and “MSIE 9.0”, it will not identify the latest version of Internet Explorer, which identifies itself as “MSIE 10.0”, since only one digit is expected before the period.

These are just a couple examples of why browser sniffing is not a best practice. The user agent string is not immutable – it is a read-write value that is easily changed by plugins, or even the user. Most modern browsers include the ability to easily change this value from their development tools, which some users take advantage of to get around poorly-developed websites.

If we disable plugins, or visit MSNBC from a device/browser that doesn’t have Flash, we would expect it to attempt a plug-in-free experience. Unfortunately, this is not the case. Rather than seeing an HTML5 experience, we’re instead asked to download Flash. This is because the site puts the user in one of two categories: an iPad user, or a Flash-enabled user.

Feature Detection

Rather than trying to guess what a browser is capable of by sniffing its user agent string (which will fail you eventually), it is much wiser to actually test features directly in the browser. If you wanted to test the browser’s ability to deliver video and audio via HTML5, you could actually attempt to create these elements via JavaScript, and see if the browser understands them. This practice is called feature detection.

if ( !!document.createElement(“video”).canPlayType  ) {
  // Load HTML5 Video
} else {
  // Load Flash Video

In the above example, we start by testing whether the canPlayType method exists on our newly-created video tag. We’re using double-negation to cast the response to a boolean. If the browser understands what a video element is, the canPlayType method will be present. If the video element is unknown to the browser, the canPlayType method will not exist. If this test passes, we load our HTML5 video. If the test does not pass, we attempt to load Flash. Deeper feature detection could take place here, since Flash may not be on the machine, or may be disabled.

Feature detection is the preferred method of determining what a browser is capable of, since there is no guesswork involved. If the browser passes properly-constructed tests, it absolutely supports the features you would like to use.

Many great tools exist to provide feature tests for you. Once such tool, which provides over 40 tests, is Modernizr. This tool creates a global object called “Modernizr” which contains the results of your tests. With Modernizr, testing for HTML5 video support is extremely easy:

if ( ) {
  // Load HTML5 Video

MSNBC engages in browser sniffing to see if the device accessing the page is an iPad or not. Our first step is to remove the browser sniffing code, and replace it with feature detection code.

Before we can modify browser sniffing code, we first need to locate it. While in Internet Explorer, pressing F12 will pull up our Developer Tools. Within the tools, open the Script tab and do a search for “userAgent”. This search will seek out any instance of this property name in all of the site’s script files. We’re interested in the result from line 41 of

Now that we know what we want to edit, we can open up Fiddler and load up our traffic. Once Fiddler is opened, perform a hard-refresh (Ctrl+F5 in IE) on the MSNBC page. This results in all of the page sessions being listed in Fiddler.

Looking carefully, you’ll notice our resource is the third from the top. Next I will setup an AutoResponder for this session file so that anytime it is requested, my own custom file is substituted in the place of the server response:

  1. Right-click this session and select “Decode Selected Sessions” from the context menu.
  2. Select the AutoResponder tab on the right.
  3. Click the “Enable automatic responses” checkbox in the AutoResponder tab.
  4. Drag the selected session from the left panel into the AutoResponder tab.

At this point, you should have an entry within your AutoResponder tab with the following rules:

  • If URI matches: EXACT:
  • Then respond with: *200-SESSION_3

Right-click the entry in the AutoResponder and select Edit Response. In the popup that follows, switch to the SyntaxView tab where we will find the source for this file. As expected, line 41 contains our browser sniffing code:

  // Flash Experience

Rather than test the contents of the userAgent, we’re going to instead look for support for the HTML5 video tag. Switch the above condition to the following:

if ( !document.createElement("video").canPlayType ) {
  // Flash Experience

This test checks to see if we cannot use the video element. If canPlayType comes back as undefined, it will be cast to true and the first code block will be entered, setting up the Flash experience.

Step 4: Update touch and pointer events

Safari supports both a touch event model and a mouse event model. Internet Explorer 10 groups touch, mouse, and stylus events into a single abstract item known as a pointer. In fact, Internet Explorer 10 is the first browser to work for all input types, across all devices. This abstraction cuts down drastically on the amount of effort involved to determine which event model you ought to bind to and how to detect user-interaction. This pointer is then handled through MSPointer events. If necessary, you can determine the type of pointer by accessing the pointerType property.

Due to the fact Internet Explorer doesn’t support Apple’s proprietary event model, which includes touch events like touchstart, touchmove, and touchend, MSNBC’s event listeners will need to be amended to listen for MSPointer events like MSPointerDown, MSPointerUP, and MSPointerMove.

Due to the difference in event model implementations, use a feature detection tool like Modernizr or code like this to target all major event models:

if (window.navigator.msPointerEnabled) {
  myCanvas.addEventListener("MSPointerMove", paint, false);
} else {
  myCanvas.addEventListener("mousemove", paint, false);
  myCanvas.addEventListener(“touchmove”, paint, false);

MSNBC only supports touch events, which we will need to change so that visitors who happen to be using a mouse can still interact with the page:

Our events are tied up in

document.addEventListener("touchstart", touchHandler, false);
document.addEventListener("touchmove", touchHandler, false);
document.addEventListener("touchend", touchHandler, false);

We’re going to update this to include the MSPointer events as well:

if (window.navigator.msPointerEnabled) {
  document.addEventListener("MSPointerDown", touchHandler, false);
  document.addEventListener("MSPointerMove", touchHandler, false);
  document.addEventListener("MSPointerUp", touchHandler, false);
} else {
  document.addEventListener("touchstart", touchHandler, false);
  document.addEventListener("touchmove", touchHandler, false);
  document.addEventListener("touchend", touchHandler, false);
  document.addEventListener("mousedown", touchHandler, false);
  document.addEventListener("mousemove", touchHandler, false);
  document.addEventListener("mouseup", touchHandler, false);

First we’re checking for the presence of pointers. Since the MSPointer covers the mouse, fingers, and pens, we don’t need anything else besides them. We fall back, if necessary, to provide both touch and mouse events.

Next we need to create cases for these event types in Currently, MSNBC starts with the following:

if ( event.type == "touchstart" ) {
  /* Start drag logic */
} else 
if ( event.type == "touchmove" ) {
  /* Drag logic */
} else 
if ( event.type == "touchend" ) {
  /* Complete drag logic */

We’ll modify this to listen for all of the registered event types:

if ( event.type.match( /(down|start)$/i ) ) {
  /* Start drag logic */
} else 
if ( event.type.match( /move$/i ) ) {
  /* Drag logic */
} else 
if ( event.type.match( /(up|end)$/i ) ) {
  /* Complete drag logic */

The above uses the match method and a series of regular expressions to determine which event was raised. If the event raised ends with a case-insensitive “down” or “start”, we begin our drag code. If the event ends with a case-insensitive “move”, we perform the actual drag logic itself. And lastly, if the event ends with a case-insensitive “up” or “end”, we end our dragging event. Note: other events may be caught here as well, like onresizeend and keyup. Be sure to consider this in your project.

The above is an implementation of Ted Johnson’s solution in Handling Multi-touch and Mouse Input in All Browsers.

The drag logic itself initially relies upon the event.targetTouches TouchList. This member does not exist in Internet Explorer. The drag logic attempts to gather the pageX and pageY properties from the first item in the TouchList, however in Internet Explorer these values are found directly on the event object.

var curX = event.targetTouches[0].pageX;

Using the logical OR operator, I instruct curX to hold the value of event.pageX as long as event.pageX is present on the event object. If this property is not found, look within the targetTouches list:

var curX = event.pageX || event.targetTouches[0].pageX;

If event.pageX is not found, we fall back to assigning the value of targetTouches[0].pageX to our variable.

Another important item to keep in mind is that this site initially responds to touchmove. When this event is raised while touching the playlist, the code attempts to reposition the playlist based upon your touch movement. There is no hovering when it comes to touch – you’re either touching, or you’re not.

Now that we have mouse events tied into this logic, we have introduced the possibility for hovering. So while touchmove is free to reposition our playlist when it is over the playlist, we don’t want to do the same for mousemove. In fact, we only want the mousemove event to reposition the playlist when the mouse button is pressed.

For further reading, and examples on how to target all browsers, see Handling Multi-touch and Mouse Input in All Browsers.

Testing both experiences

Recall our feature detection from earlier, how we first check to see if HTML5 video support is in the user’s browser. If it is, we give them HTML5. If it is not, we give them Flash. One easy way to test our work is to use a browser, or document mode, that doesn’t support HTML5 features. This is very easy to test with Internet Explorer:

  1. Press F12 to reveal the Developer Tools
  2. Change your Document Mode to Internet Explorer 7 Standards
  3. Refresh the page

If our feature detection condition was written properly, you should now be watching a Flash-based presentation. Switching your Document Mode back into Internet Explorer 9 Standards (or “Standards” if you’re using IE10), will return you to the HTML5 experience.

Get it Done!

Hopefully this post helps to define the types of changes that will allow your iOS site to work properly in IE10 Metro and other plugin-free environments. By including best practices such as feature detection and responsibly using vendor prefixes for great new features, you should be able to provide your users a great experience, regardless of which browser or device they’re using. To assist with testing in other plug-in-free environments, download Internet Explorer 10 (currently available only in the Windows 8 CP) and begin testing today!

Update: In the rush to get this post up, I realized that I forgot to thank and give credit to Jonathan Sampson for helping investigate and write about the great techniques mentioned above. He was a huge help in generating many of these great techniques. Thanks JS!


Learn JavaScript!

What to Read to Get Up to Speed in JavaScript.

The best books & blogs for learning JavaScript development. Broken down by experience levels!

My BIG LIST of JavaScript, CSS & HTML Development Tools, Libraries, Projects, and Books.

Constantly updated with the latest and greatest tools. Check it out!


Rey Bango is Stephen Fry proof thanks to caching by WP Super Cache