Some Web sites are designed to work correctly only with certain browsers, and some sites will not even let you access them unless you are using one of their approved browsers. All browsers provide information about their identity that can be queried by Web sites and computer programs, but it is not normally visible.
This Web page checks that you are using a Safari browser, makes the information about its identity visible, attempts to determine whether it is spoofing, and attempts to display its version number.
If your browser could not be identified, or if it was identified incorrectly, then please send me a message so that I can try to improve the identification.
Some Web browsers can be configured to supply identification that belongs to other browsers, a process known as spoofing. This can allow browsers to access Web sites that attempt to restrict access to specified browsers. Perfect spoofing would be impossible to detect.
Safari always identifies its vendor as Apple, and this always allows it to be detected when it pretends to be Internet Explorer or other browsers, but not when it pretends to be other versions of Safari.
To set up spoofing, the Develop menu needs to be made visible:
Then choose a User Agent:
if (navigator.vendor.toLowerCase().indexOf("apple") == -1)
document.write("<p><strong>You do not appear to be using a Safari Web browser.<\/strong><\/p>");
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:220.127.116.11) Gecko/20080201 Firefox/18.104.22.168
The third step is to convert the data to lower case and search it for one or more strings of characters whose presence and/or absence (alone or in combination) can be used to detect spoofing and to identify a browser. For example, the following definition specifies the presence of “firefox/2”.
else if (navigator.userAgent.toLowerCase().indexOf("firefox/2") != -1)
document.write("<p><strong>Your Web browser claims to be Firefox version 2, but appears to be Safari providing a false identity.<\/strong><\/p>");
The fourth step is to check for a string that indicates the browser version, for example:
else if (navigator.userAgent.toLowerCase().indexOf("version/3.1") != -1)
document.write("<p><strong>Your version of Safari appears to be 3.1<\/strong><\/p>");
This type of identification is not completely accurate, especially when browsers pretend to be other browsers, but it works most of the time.
Send comments or questions to Alan Wood
Created 20th December 2001 — Updated 22nd October 2016
Copyright © 2001–2016 Alan Wood