User agent: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
mNo edit summary
(changed "user agent" to "user agent string" where appropriate)
Line 1: Line 1:
: ''This article applies to both Firefox and Mozilla Suite.''
: ''This article applies to both Firefox and Mozilla Suite.''


The user agent is a string uniquely identifying a given browser. It can be accessed by Javascript and numerous other means. It is used by websites to determine which browser you use for various reasons. For example, some webmasters will read this information solely for the purpose of keeping statistics on browser usage. Others will delibarately reject certain browsers based on the text in your user agent.  Still others will redirect certain browsers to different version of a page.  
==User agent string==
The user agent string is a piece of text which identifies the name and version of a given browser. It can be accessed by Javascript and numerous other means. It is used by websites to determine which browser you use. Some webmasters do this solely for the purpose of keeping statistics on browser usage. Others will delibarately reject certain browsers based on the user agent string, or redirect them to different version of a page.  


If a web site is rejecting access solely based on user agent, you may be able to access a page anyway by installing the [https://addons.mozilla.org/extensions/moreinfo.php?id=59 User Agent Switcher]. To see your own user agent, copy <code>javascript:alert(navigator.userAgent)</code> into your Location Bar and press Enter.
To see your own user agent string, copy <code>javascript:alert(navigator.userAgent)</code> into your Location Bar and press Enter. Alternatively, Firefox users can go to "Help -> About Mozilla Firefox" where the user agent string is displayed at the bottom of the dialog.


You can read more about user agent strings at [http://en.wikipedia.org/wiki/User_agent Wikipedia].
If a web site is rejecting access solely based on the user agent string, you may wish to install the [https://addons.mozilla.org/extensions/moreinfo.php?id=59 User Agent Switcher] extension, which allows you to change your user agent string in order to mimic that of other browsers such as Microsoft Internet Explorer. Note that this may [[Java#.22Java_Plug-in_for_Netscape_Navigator_should_not_be_used_in_Microsoft_Internet_Explorer.22 | cause problems with the Java plugin]].
 
==External links==
*user agent strings at [http://en.wikipedia.org/wiki/User_agent Wikipedia].


{{stub}}
{{stub}}
[[Category:General concepts]]
[[Category:General concepts]]

Revision as of 11:09, 2 January 2006

This article applies to both Firefox and Mozilla Suite.

User agent string

The user agent string is a piece of text which identifies the name and version of a given browser. It can be accessed by Javascript and numerous other means. It is used by websites to determine which browser you use. Some webmasters do this solely for the purpose of keeping statistics on browser usage. Others will delibarately reject certain browsers based on the user agent string, or redirect them to different version of a page.

To see your own user agent string, copy javascript:alert(navigator.userAgent) into your Location Bar and press Enter. Alternatively, Firefox users can go to "Help -> About Mozilla Firefox" where the user agent string is displayed at the bottom of the dialog.

If a web site is rejecting access solely based on the user agent string, you may wish to install the User Agent Switcher extension, which allows you to change your user agent string in order to mimic that of other browsers such as Microsoft Internet Explorer. Note that this may cause problems with the Java plugin.

External links