Sniffing basics – a FAQ of sorts

Q: Why does a web site check what browser I use?

A: Because all browsers are different. Often a website will send different code to different browsers.

Q: How can a website tell?

A: It can check either by JavaScript or by the information the browser sends when it asks for a page.

Q: Why does Opera and others try to hide their real identities?

A: To avoid receiving crippled versions of the pages.

There is hardly any browser out there that really reports its identity. IE spoofs Netscape because Netscape was the first browser to implement certain HTML features in the early days of the web, and webmasters started blocking other browsers.

When Opera identifies itself as IE, it is in fact spoofing IE spoofing Netscape using the code name "Mozilla", so there is version and name-information of three different browsers included…

Q: Why can a website detect I'm using Opera even if it is identifying as something else?

A: Opera never completely hides its identity when spoofing another browser. This is a feature, not a bug. There are two main reasons for this:

1) If Opera completely hid its identity, it would not appear in any server logs or statistics over browser usage. No webmasters would ever bother testing their sites with it, assuming that nobody used it.

2) Detecting Opera allows webmasters to serve Opera – adapted pages. For instance, webmasters who are aware of Opera's standards-compliance can send a standards-compliant page even if Opera identifies as MSIE and would normally get IE-specific code.

Sadly, sometimes webmasters use this to detect and block Opera specifically.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s