![]() |
mail us
|
mail this page products | company | support | downloads | isp services | contact us |
OK we admit it - the above is a cheap one line trick using apache SSIs.
We produced this page not because we think changing browser User Agent strings is a good idea - in fact we thing it is an incredibly bad idea unless you absolutely need to do it. But we got mail recently saying someone was having a problem viewing our pages. Turns out it was a badly configured - not deliberate - UA string. So we got to thinking how could we help fix the problem - and we had no idea! We use server-side browser sniffing to serve browser specific page content - mostly 'cos we want to progressively phase out - or a least minimise - development for non-W3C conformant browsers while pushing ahead with conformant browsers. If you visit this site with a sensible browser (read non-MSIE or pretending to be MSIE), you will see a different site - well at least as far as navigation is concerned. 'Nuff said. So here for Opera, Moz and the clones ,unless identified specifically that includes Firefox, K-Meleon (great stuff), Galeon, Epiphany etc., etc. and, of course, MSIE is some info about changing UA strings.
Version 9 seems to have brought with it a number of changes - see notes below.
The easiest of all since Opera 7+ provides a feature to do just that:
Use Tools->Quick Preference and select the browser you want to emulate from the radio button list at the foot of the menu. Or if you like lots of clicking use Tools->Preferences->network then select from the drop down menu under 'Browser Identification'.
Opera 9 Removed browser change from Quick Preferences menu - instead use Tools->Quick Preferences->Edit Site Preferences->Select Network Tab->Use Browser Identification combo box.
Notes:
Opera 7 & 8 default to MSIE identification - which means on our site you will not get our great css menus unless you change to a Moz string - and they have worked perfectly since Opera 7.54. Opera 9 defaults to Opera identification.
Even if you select MSIE (and we assume Mozilla) you get a Opera x.yy string at the end - which some sites object to - not us we just ignore it, well actually we ignore most things. You can remove even this vestigial (wow!) string in Opera 8 but not Opera 7. Opera call this cloaked mode. Cloaked mode can only be configured by using the ua.ini file discussed below and it can even be set on a site-by-site basis.
From Opera 8 there is a nifty file called ua.ini (in the same directory as your Opera profile - typically %SystemRoot%\accountname\Application Data\Opera\Opera\profile\ua.ini) in which you can specify any string, including a cloaked string, for either Mozilla or MSIE on a site by site basis (Opera info on this topic - under miscellaneous). Note: if you set a value in the ua.ini file it trumps the menu setting to change identifier. Clicking the menu setting until your fingers bleed which have no effect - the value from the ua.ini will always be used depending on what values you set. The default values in this file are clearly set based on reported site problems. Annotated ua.ini file.
Finally with Opera 8 there is also a snazzy feature to allow you to play with Javascript variables so you can pretend to be a real MSIE browser to client side browser detection routines (Opera info on this topic).
Any additional values displayed in the MSIE UA string are defined in the registry. Use Start->Run enter regedit then navigate to the following key:
HKEY_LOCAL_MACHINE\software\Microsoft\Windows\CurrentVersion\
Internet Settings\User Agent
Adding new strings here will cause the name of the field - not the data content to be appended to the UA string. The basic string is left intact.
To change the basic string add (if not present) the following key:
HKEY_LOCAL_MACHINE\software\Microsoft\Windows\CurrentVersion\
Internet Settings\5.0\User Agent
(default) "Mozilla/4.0"
Compatible "compatible"
Version "MSIE 6.0"
Platform "Windows NT 4.0"
The default value will replace the Mozilla/4.0 string that MSIE uses. You can add Compatible, Version and Platform strings as shown above and described in this MSDN article. The article also explains how to add Post Platform and Pre Platform values.
Warning: Messing around with the registry can seriously damage your system and your mental health. Do not do do it unless you know exactly what you are doing.
You can get a user agent switcher extension or do it the hard way as shown below.
Enter about:config in the address line and it will display a full list of the variables used. In the filter line type useragent - and if you are lucky there will be a string identified with general.useragent.override - to modify just double click the entry and make your required changes.
However in a standard Firefox install this variable is not present so you will have to add it to the Prefs.js file in your profile directory.
user_pref{"general.useragent.override","Some string"};
Notes:
Problems, comments, suggestions, corrections (including broken links) or something to add? Please take the time from a busy life to 'mail us' (at top of screen), the webmaster (below) or info-support at zytrax. You will have a warm inner glow for the rest of the day.
tech home
audio stuff
web stuff
dom stuff
css stuff
language stuff
regex stuff
rfc stuff
protocol stuff
cable stuff
lan wiring
rs232 wiring
howto stuff
survival stuff
wireless stuff
ascii codes
data rate stuff
telephony stuff
mechanical stuff
pc stuff
electronic stuff
tech links
open guides
RSS Feed
If you are happy it's OK - but your browser is giving a less than optimal experience on our site. You could, at no charge, upgrade to a W3C STANDARDS COMPLIANT browser such as Mozilla
W3C HTML 4.01
HTML5 (WHATWG)
HTML4 vs HTML5
HTML5 Reference
W3C Page Validator
W3C DOCTYPE
W3C DOM
W3C DOM Events
Gecko DOM
MSIE DOM
usability.gov
W3C -WAI
Web Style Guide
Michael L Bernard
WebAim.org
Peter-Paul Koch
A List Apart
Eric Meyer on CSS
glish.com
DOCTYPE definitions
Our DOM Pages
DOM User Guide
DOM Explorer
DOM Navigation
CSS Techniques
CSS Short Cuts
CSS overview
Oh Really!
webmasterbase.com
Brainjar Menubar
Our Lite JS Menus
Our CSS Menus
Tigra Menus
|
Copyright © 1994 - 2010 ZyTrax, Inc. All rights reserved. Legal and Privacy |
site by zytrax![]() |
web-master at zytrax Page modified: November 03 2007. |