Testing for FireFox, Chrome User Agents, using the IE9 Developer Toolbar

IE9 Toolbar’s Browser Mode allows us to test for different versions of IE.  This feature has been there right from IE8 Developer Toolbar.   But, I always thought that the testing was just limited to the different versions of IE i.e. IE7, IE8 and IE9.  One of the advantages of having a technical boss is that, he points to the right set of information when needed.  @harishV pointed out that you can test even for other browsers such as Chrome, Firefox, Safari from within the IE9 Developer Toolbar.

For the purpose the demonstration, I am using  a simple Web Application with a Button and a Label that displays the User Agent when clicked.

Once you add the Button and Label, the button click event has the following code (simple stuff, but just putting it for transparency Smile)

protected void Button1_Click(object sender, EventArgs e)
        {
            Label1.Text = Request.UserAgent;
        }

And when we run the page and click on the button, by default IE9 would resort to IE9 Browser Mode and IE9 Document Mode

image

 

One of the nice things you would notice about the IE9 user agent string, is that, its simplified and doesn’t have the lengthy .NET Framework, CLR versions mentioned, as it was earlier.  Its simplified, much simplified!

When we change the browser mode to IE8, you will notice, couple of things

1. The page automatically reloads (not refresh)

2. The User Agent is as follows:-

image

Now, the main intent of this post, how can you test for other browsers

Open the F12, Developer Toolbar and from Tools – Change User Agent String

image

 

 

Lets say we select “Google Chrome”

image

and when we select “Opera”

image

 

Isn’t it cool, testing for Chrome/Opera/Firefox from within IE Toolbar? 

Cheers !!!

Print | posted on Wednesday, July 6, 2011 2:49 PM

Comments on this post

# re: Testing for FireFox, Chrome User Agents, using the IE9 Developer Toolbar

Requesting Gravatar...
Wow this is cool! :) I will try this one and test if I could try and use it l8r.
Left by TV Series on Jul 20, 2011 7:23 PM

# re: Testing for FireFox, Chrome User Agents, using the IE9 Developer Toolbar

Requesting Gravatar...
Thanks for highlighting nice feature of ie9
Left by Vaibhav Parmar on Nov 03, 2011 11:55 AM

# re: Testing for FireFox, Chrome User Agents, using the IE9 Developer Toolbar

Requesting Gravatar...
Definitely a geek's blog. That is not an insult, rather an appreciation of the contributions of these group of people to the development of technology and society as a whole.
Left by Mario Romano on Dec 29, 2011 7:37 AM

# re: Testing for FireFox, Chrome User Agents, using the IE9 Developer Toolbar

Requesting Gravatar...
Lorem ipsum elit sit amit lorem ipsum elit sit amit
Left by Lorem Ipsum on May 22, 2014 12:16 PM

Your comment:

 (will show your gravatar)