Note: My Web pages are best viewed with style sheets enabled. |
Unrated |
When you tried to view a Web page …
This operation is not currently available.something incomprehensible such as
Please contact your System Administrator and try again later.
We are sorry for this interruption in your service.
XML Parsing Error: mismatched tag. Expected: </input>.or some other unexpected text?
Location: http://store.spruebrothers.com/recent-arrivals-c373.aspx
Line Number 60, Column 3:</form>
--^
All of these — and other anomalies — are symptoms of browser sniffing. Sniffing is a method by which a Web server determines what browser you are using. Problems with developing Web sites with sniffing are detailed under Sniffing in my "Professional" Web Developers. A well-designed Web page that complies with internationally recognized specifications published by the non-profit World Wide Web Consortium (W3C) and that addresses the recommendations of the Viewable With Any Browser Campaign should not require sniffing.
Unfortunately, too many Web developers create poorly designed pages that fail to comply with the specifications. Instead, Web developers often attempt to enhance Web pages by taking advantage of non-standard capabilities of various browsers. To accomplish this, a developer must create multiple versions of each Web page and then sniff for your browser in order to send you the correct version of the page. Frequently, the implementation of sniffing is incomplete — omitting some browsers — or otherwise incorrect. For example, if you are using a browser that the Web developer did not anticipate, the result can be unreadable garbage.
*** Begin Right Sidebar ***
On this page, some terms appear in bold where they are first used. The meaning of those terms should be clear from that first use.The first use of other terms are links to pages where they are either defined or discussed in sufficient detail to make their meanings clear. Where those links at to my Internet Glossary, the page will appear either in a new window or a separate tab.
Some of this page's content is quite technical. If you don't understand it, contact me for help.
*** End Right Sidebar ***
Dealing with Incorrect Browser Sniffing
Conclusively detecting whether a Web server is sniffing might be difficult.
The most important thing to remember when you encounter incorrect sniffing is that your browser is not broken. Instead, the problem lies within the Web page. Thus, you must communicate the problem back to the Web site's developer and owner.
CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
If no such bug report exists, file one at bugzilla.mozilla.com. Bug reports about invalid sniffing should be marked as blocking bug #334967, the general bug report that tracks sniffing bugs.
If you don't have a bugzilla.mozilla.com account, report the problem in the appropriate news.mozilla.org newsgroup and request someone else to file the bug report on your behalf. Indicate what your UA string is and that you did indeed report the problem to the broken Web site.
The following is oriented towards Gecko-based browsers. However, some other browsers might have features that could make this information somewhat useful.
Gecko-based browsers can spoof other browsers by sending fake UA strings. Unless a Web site requires specialized applications peculiar to only one browser (e.g., ActiveX used by IE), spoofing is usually successful in defeating incorrect sniffing. This capability is especially important for Gecko-based, non-Firefox browsers. Many sniffing Web sites that work correctly for Firefox fail to work for other Gecko-based browsers because those sites wrongly sniff for Firefox instead of Gecko.
Users can install a browser extension that can temporarily change your UA string for spoofing. Two such extensions are PrefBar and UserAgentSwitcher. Both of these are easy to use. Changing and inserting new UA strings in these extensions is not difficult. Both also have the feature that, if you forget to do so, they restore your true UA string when you terminate and then relaunch your browser. Sources of UA strings to add to the spoofing capabilities of PrefBar and UserAgentSwitcher include:
Note: In general, users should NOT spoof by changing their UA string via setting a browser's preference variables. This can result in a permanent spoof, which will hide the true identity of your browser. In the end, Web developers will then claim your browser never visits their Web sites and thus they don't have to accommodate your browser when sniffing.
However, some Web developers — especially those at financial services companies — absolutely refuse to accept the idea that Gecko is indeed Gecko. For my own online banking, I created a special profile where I did indeed set a preference variable for permanent spoofing of Firefox, which the banking Web sites recognize. I use that profile only for online banking. In that profile, I entered the following in file user.js:
user_pref("general.useragent.extra.spoof", "NOT Firefox/3.6.3");I choose to make all preference variable changes in the user.js file so that I can annotate them (the second line, beginning with two slashes). This results in a UA string that is
// spoof Firefox
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 SeaMonkey/2.0.4 NOT Firefox/3.6.3at the time this was written. Note carefully what this UA string says: "This is really SeaMonkey and not Firefox." This successfully spoofs Firefox because sniffing almost always looks for merely a fragment of a string (Firefox in this case) and does not parse and evaluate the entire UA string (thus ignoring the NOT). This permanent spoof does not hide the true identity of my browser (SeaMonkey). In a few cases, I successfully argued with a Web developer that sniffing for Firefox was wrong by having him look at his server log, which showed that I actually used SeaMonkey. (Note well: Preference variables set via user.js do not become effective until your browser is terminated and relaunched.)
Some Web sites, however, do some parsing when sniffing. For example, Micro$oft's Get Silverlight looks for Firefox to be the first non-numeric string after Gecko. In this case, it is necessary to spoof with something like
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.9) Gecko/20100317 Firefox/3.6.3 (NOT - it's really SeaMonkey! Stop browser sniffing) SeaMonkey/2.0.4
In some sniffing cases, it becomes necessary to omit any mention of a non-Firefox browser. Both PrefBar and UserAgentSwitcher have the capability of maintaining lists of spoofs — including user-created UA strings that do not mention the actual browser — so that the user can choose whichever spoof is appropriate for a given sniffing situation.
Updated 15 June 2010
![]() "Internet" Table of Contents |
![]() David Ross home |
![]() |