.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "HTTP::BrowserDetect 3pm"
.TH HTTP::BrowserDetect 3pm "2023-11-01" "perl v5.36.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
HTTP::BrowserDetect \- Determine Web browser, version, and platform from an HTTP user agent string
.SH "VERSION"
.IX Header "VERSION"
version 3.40
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& use HTTP::BrowserDetect ();
\&
\& my $user_agent_string
\& = \*(AqMozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36\*(Aq;
\& my $ua = HTTP::BrowserDetect\->new($user_agent_string);
\&
\& # Print general information
\& print \*(AqBrowser: \*(Aq . $ua\->browser_string . "\en" if $ua\->browser_string;
\& print \*(AqVersion: \*(Aq . $ua\->browser_version . $ua\->browser_beta . "\en" if $ua\->browser_version;
\& print \*(AqOS: \*(Aq . $ua\->os_string . "\en" if $ua\->os_string;
\&
\& # Detect operating system
\& if ( $ua\->windows ) {
\& if ( $ua\->winnt ) {
\& # do something
\& }
\& if ( $ua\->win95 ) {
\& # do something
\& }
\& }
\& print "Mac\en" if $ua\->macosx;
\&
\& # Detect browser vendor and version
\& print "Safari\en" if $ua\->safari;
\& print "MSIE\en" if $ua\->ie;
\& print "Mobile\en" if $ua\->mobile;
\& if ( $ua\->browser_major(4) ) {
\& if ( $ua\->browser_minor > .5 ) {
\& # ...;
\& }
\& }
\& if ( $ua\->browser_version > 4.5 ) {
\& # ...;
\& }
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The HTTP::BrowserDetect object does a number of tests on an \s-1HTTP\s0 user agent
string. The results of these tests are available via methods of the object.
.PP
For an online demonstration of this module's parsing, you can check out
.PP
This module was originally based upon the JavaScript browser detection
code available at
.
.SH "CONSTRUCTOR AND STARTUP"
.IX Header "CONSTRUCTOR AND STARTUP"
.SS "\fBnew()\fP"
.IX Subsection "new()"
.Vb 1
\& HTTP::BrowserDetect\->new( $user_agent_string )
.Ve
.PP
The constructor may be called with a user agent string specified. Otherwise, it
will use the value specified by \f(CW$ENV\fR{'\s-1HTTP_USER_AGENT\s0'}, which is set by the
web server when calling a \s-1CGI\s0 script.
.SH "SUBROUTINES/METHODS"
.IX Header "SUBROUTINES/METHODS"
.SH "Browser Information"
.IX Header "Browser Information"
.SS "\fBbrowser()\fP"
.IX Subsection "browser()"
Returns the browser, as one of the following values:
.PP
chrome, firefox, ie, opera, safari, adm, applecoremedia, blackberry,
brave, browsex, dalvik, elinks, links, lynx, emacs, epiphany, galeon,
konqueror, icab, lotusnotes, mosaic, mozilla, netfront, netscape,
n3ds, dsi, obigo, polaris, pubsub, realplayer, seamonkey, silk,
staroffice, ucbrowser, webtv, samsung
.PP
If the browser could not be identified (either because unrecognized
or because it is a robot), returns \f(CW\*(C`undef\*(C'\fR.
.SS "\fBbrowser_string()\fP"
.IX Subsection "browser_string()"
Returns a human formatted version of the browser name. These names are
subject to change and are meant for display purposes. This may include
information additional to what's in \fBbrowser()\fR (e.g. distinguishing
Firefox from Iceweasel).
.PP
If the user agent could not be identified, or if it was identified as
a robot instead, returns \f(CW\*(C`undef\*(C'\fR.
.SH "Browser Version"
.IX Header "Browser Version"
Please note that that the \fBversion()\fR, \fBmajor()\fR and \fBminor()\fR methods have been
deprecated as of release 1.78 of this module. They should be replaced
with \fBbrowser_version()\fR, \fBbrowser_major()\fR, \fBbrowser_minor()\fR, and \fBbrowser_beta()\fR.
.PP
The reasoning behind this is that \fBversion()\fR method will, in the case of Safari,
return the Safari/XXX numbers even when Version/XXX numbers are present in the
UserAgent string (i.e. it will return incorrect versions for Safari in
some cases).
.SS "\fBbrowser_version()\fP"
.IX Subsection "browser_version()"
Returns the browser version (major and minor) as a string. For
example, for Chrome 36.0.1985.67, this returns \*(L"36.0\*(R".
.SS "\fBbrowser_major()\fP"
.IX Subsection "browser_major()"
Returns the major part of the version as a string. For example, for
Chrome 36.0.1985.67, this returns \*(L"36\*(R".
.PP
Returns undef if no version information can be detected.
.SS "\fBbrowser_minor()\fP"
.IX Subsection "browser_minor()"
Returns the minor part of the version as a string. This includes the
decimal point; for example, for Chrome 36.0.1985.67, this returns
\&\*(L".0\*(R".
.PP
Returns undef if no version information can be detected.
.SS "\fBbrowser_beta()\fP"
.IX Subsection "browser_beta()"
Returns any part of the version after the major and minor version, as
a string. For example, for Chrome 36.0.1985.67, this returns
\&\*(L".1985.67\*(R". The beta part of the string can contain any type of
alphanumeric characters.
.PP
Returns undef if no version information can be detected. Returns an
empty string if version information is detected but it contains only
a major and minor version with nothing following.
.SH "Operating System"
.IX Header "Operating System"
.SS "\fBos()\fP"
.IX Subsection "os()"
Returns one of the following strings, or \f(CW\*(C`undef\*(C'\fR:
.PP
.Vb 2
\& windows, winphone, mac, macosx, linux, android, ios, os2, unix, vms,
\& chromeos, firefoxos, ps3, psp, rimtabletos, blackberry, amiga, brew
.Ve
.SS "\fBos_string()\fP"
.IX Subsection "os_string()"
Returns a human formatted version of the \s-1OS\s0 name. These names are
subject to change and are really meant for display purposes. This may
include information additional to what's in \fBos()\fR (e.g. distinguishing
various editions of Windows from one another) (although for a way to
do that that's more suitable for use in program logic, see below under
\&\*(L"\s-1OS\s0 related properties\*(R").
.PP
Returns \f(CW\*(C`undef\*(C'\fR if no \s-1OS\s0 information could be detected.
.SS "\fBos_version()\fP, \fBos_major()\fP, \fBos_minor()\fP, \fBos_beta()\fP"
.IX Subsection "os_version(), os_major(), os_minor(), os_beta()"
Returns version information for the \s-1OS,\s0 if any could be detected. The
format is the same as for the \fBbrowser_version()\fR functions.
.SH "Mobile Devices"
.IX Header "Mobile Devices"
.SS "\fBmobile()\fP"
.IX Subsection "mobile()"
Returns true if the browser appears to belong to a mobile phone or
similar device (i.e. one small enough that the mobile version of a
page is probably preferable over the desktop version).
.PP
In previous versions, tablet devices sometimes had \fBmobile()\fR return
true. They are now mutually exclusive.
.SS "\fBtablet()\fP"
.IX Subsection "tablet()"
Returns true if the browser appears to belong to a tablet device.
.SS "\fBdevice()\fP"
.IX Subsection "device()"
Returns the type of mobile / tablet hardware, if it can be detected.
.PP
Currently returns one of: android, audrey, avantgo, blackberry, dsi, iopener, ipad,
iphone, ipod, kindle, n3ds, palm, ps3, psp, wap, webos, winphone.
.PP
Returns \f(CW\*(C`undef\*(C'\fR if this is not a tablet/mobile device or no hardware
information can be detected.
.SS "\fBdevice_string()\fP"
.IX Subsection "device_string()"
Returns a human formatted version of the hardware device name. These names are
subject to change and are really meant for display purposes. You should use
the \fBdevice()\fR method in your logic. This may include additional
information (such as the model of phone if it is detectable).
.PP
Returns \f(CW\*(C`undef\*(C'\fR if this is not a portable device or if no device name
can be detected.
.SH "Robots"
.IX Header "Robots"
.SS "\fBrobot()\fP"
.IX Subsection "robot()"
If the user agent appears to be a robot, spider, crawler, or other
automated Web client, this returns one of the following values:
.PP
lwp, slurp, yahoo, bingbot, msnmobile, msn, msoffice, ahrefs,
altavista, apache, askjeeves, baidu, curl, facebook, getright,
googleadsbot, googleadsense, googlebotimage, googlebotnews,
googlebotvideo, googlefavicon, googlemobile, google, golib, indy,
infoseek, ipsagent, linkchecker, linkexchange, lycos, malware,
mj12bot, nutch, phplib, puf, rubylib, scooter, specialarchiver,
wget, yandexbot, yandeximages, java, headlesschrome, unknown
.PP
Returns \*(L"unknown\*(R" when the user agent is believed to be a robot but
is not identified as one of the above specific robots.
.PP
Returns \f(CW\*(C`undef\*(C'\fR if the user agent is not a robot or cannot be
identified.
.PP
Note that if a robot crafts a user agent designed to impersonate a
particular browser, we generally set properties appropriate to both
the actual robot, and the browser it is impersonating. For example,
googlebot-mobile pretends to be mobile safari so that it will get
mobile versions of pages. In this case, \fBbrowser()\fR will return
\&'safari', the properties will generally be set as if for Mobile
Safari, the 'robot' property will be set, and \fBrobot()\fR will return
\&'googlemobile'.
.PP
\fI\f(BIlib()\fI\fR
.IX Subsection "lib()"
.PP
Returns true if the user agent appears to be an \s-1HTTP\s0 library or tool
(e.g. \s-1LWP,\s0 curl, wget, java). Generally libraries are also classified
as robots, although it is impossible to tell whether they are being
operated by an automated system or a human.
.PP
\fI\f(BIrobot_string()\fI\fR
.IX Subsection "robot_string()"
.PP
Returns a human formatted version of the robot name. These names are
subject to change and are meant for display purposes. This may include
additional information (e.g. robots which return \*(L"unknown\*(R" from
\&\fBrobot()\fR generally can be identified in a human-readable fashion by
reading \fBrobot_string()\fR ).
.PP
\fI\f(BIrobot_id()\fI\fR
.IX Subsection "robot_id()"
.PP
This method is currently in beta.
.PP
Returns an id consisting of lower case letters, numbers and dashes. This id
will remain constant, so you can use it for matching against a particular
robot. The ids were introduced in version 3.14. There may still be a few
corrections to ids in subsequent releases. Once this method becomes stable the
ids will also be frozen.
.PP
\fI\f(BIall_robot_ids()\fI\fR
.IX Subsection "all_robot_ids()"
.PP
This method returns an \f(CW\*(C`ArrayRef\*(C'\fR of all possible \f(CW\*(C`robot_id\*(C'\fR values.
.SS "\fBrobot_version()\fP, \fBrobot_major()\fP, \fBrobot_minor()\fP, \fBrobot_beta()\fP"
.IX Subsection "robot_version(), robot_major(), robot_minor(), robot_beta()"
Returns version information for the robot, if any could be
detected. The format is the same as for the \fBbrowser_version()\fR
functions.
.PP
Note that if a robot crafts a user agent designed to impersonate a
particular browser, we generally return results appropriate to both
the actual robot, and the browser it is impersonating. For example,
googlebot-mobile pretends to be mobile safari so that it will get
mobile versions of pages. In this case, \fBrobot_version()\fR will return
the version of googlebot-mobile, and \fBbrowser_version()\fR will return the
version of Safari that googlebot-mobile is impersonating.
.SH "Browser Properties"
.IX Header "Browser Properties"
Operating systems, devices, browser names, rendering engines, and
true-or-false methods (e.g. \*(L"mobile\*(R" and \*(L"lib\*(R") are all browser
properties. For example, calling \fBbrowser_properties()\fR for Mobile
Safari running on an Android will return this list:
.PP
('android', 'device', 'mobile', 'mobile_safari', 'safari', 'webkit')
.SS "\fBbrowser_properties()\fP"
.IX Subsection "browser_properties()"
Returns all properties for this user agent, as a list. Note that
because a large number of cases must be considered, this will take
significantly more time than simply querying the particular methods
you care about.
.PP
A mostly complete list of properties follows (i.e. each of these
methods is both a method you can call, and also a property that may
be in the list returned by \fBbrowser_properties()\fR ). In addition to this
list, \fBrobot()\fR, \fBlib()\fR, \fBdevice()\fR, \fBmobile()\fR, and \fBtablet()\fR are all
browser properties.
.SS "\s-1OS\s0 related properties"
.IX Subsection "OS related properties"
The following methods are available, each returning a true or false value.
Some methods also test for the operating system version. The indentations
below show the hierarchy of tests (for example, win2k is considered a type of
winnt, which is a type of win32)
.PP
\fI\f(BIwindows()\fI\fR
.IX Subsection "windows()"
.PP
.Vb 12
\& win16 win3x win31
\& win32
\& winme win95 win98
\& winnt
\& win2k winxp win2k3 winvista win7
\& win8
\& win8_0 win8_1
\& win10
\& win10_0
\& wince
\& winphone
\& winphone7 winphone7_5 winphone8 winphone10
.Ve
.PP
\fI\f(BIdotnet()\fI\fR
.IX Subsection "dotnet()"
.PP
\fI\f(BIx11()\fI\fR
.IX Subsection "x11()"
.PP
\fI\f(BIwebview()\fI\fR
.IX Subsection "webview()"
.PP
\fI\f(BIchromeos()\fI\fR
.IX Subsection "chromeos()"
.PP
\fI\f(BIfirefoxos()\fI\fR
.IX Subsection "firefoxos()"
.PP
\fI\f(BImac()\fI\fR
.IX Subsection "mac()"
.PP
mac68k macppc macosx ios
.PP
\fI\f(BIos2()\fI\fR
.IX Subsection "os2()"
.PP
\fI\f(BIbb10()\fI\fR
.IX Subsection "bb10()"
.PP
\fI\f(BIrimtabletos()\fI\fR
.IX Subsection "rimtabletos()"
.PP
\fI\f(BIunix()\fI\fR
.IX Subsection "unix()"
.PP
.Vb 3
\& sun sun4 sun5 suni86 irix irix5 irix6 hpux hpux9 hpux10
\& aix aix1 aix2 aix3 aix4 linux sco unixware mpras reliant
\& dec sinix freebsd bsd
.Ve
.PP
\fI\f(BIvms()\fI\fR
.IX Subsection "vms()"
.PP
\fI\f(BIamiga()\fI\fR
.IX Subsection "amiga()"
.PP
\fI\f(BIps3gameos()\fI\fR
.IX Subsection "ps3gameos()"
.PP
\fI\f(BIpspgameos()\fI\fR
.IX Subsection "pspgameos()"
.PP
It may not be possible to detect Win98 in Netscape 4.x and earlier. On Opera
3.0, the userAgent string includes \*(L"Windows 95/NT4\*(R" on all Win32, so you can't
distinguish between Win95 and WinNT.
.SS "Browser related properties"
.IX Subsection "Browser related properties"
The following methods are available, each returning a true or false value.
Some methods also test for the browser version, saving you from checking the
version separately.
.PP
\fIadm\fR
.IX Subsection "adm"
.PP
\fIaol aol3 aol4 aol5 aol6\fR
.IX Subsection "aol aol3 aol4 aol5 aol6"
.PP
\fIapplecoremedia\fR
.IX Subsection "applecoremedia"
.PP
\fIavantgo\fR
.IX Subsection "avantgo"
.PP
\fIbrowsex\fR
.IX Subsection "browsex"
.PP
\fIchrome\fR
.IX Subsection "chrome"
.PP
\fIdalvik\fR
.IX Subsection "dalvik"
.PP
\fIemacs\fR
.IX Subsection "emacs"
.PP
\fIepiphany\fR
.IX Subsection "epiphany"
.PP
\fIfirefox\fR
.IX Subsection "firefox"
.PP
\fIgaleon\fR
.IX Subsection "galeon"
.PP
\fIicab\fR
.IX Subsection "icab"
.PP
\fIie ie3 ie4 ie4up ie5 ie5up ie55 ie55up ie6 ie7 ie8 ie9 ie10 ie11\fR
.IX Subsection "ie ie3 ie4 ie4up ie5 ie5up ie55 ie55up ie6 ie7 ie8 ie9 ie10 ie11"
.PP
\fIie_compat_mode\fR
.IX Subsection "ie_compat_mode"
.PP
The ie_compat_mode is used to determine if the \s-1IE\s0 user agent is for
the compatibility mode view, in which case the real version of \s-1IE\s0 is
higher than that detected. The true version of \s-1IE\s0 can be inferred from
the version of Trident in the engine_version method.
.PP
\fIkonqueror\fR
.IX Subsection "konqueror"
.PP
\fIlotusnotes\fR
.IX Subsection "lotusnotes"
.PP
\fIlynx links elinks\fR
.IX Subsection "lynx links elinks"
.PP
\fImobile_safari\fR
.IX Subsection "mobile_safari"
.PP
\fImosaic\fR
.IX Subsection "mosaic"
.PP
\fImozilla\fR
.IX Subsection "mozilla"
.PP
\fIneoplanet neoplanet2\fR
.IX Subsection "neoplanet neoplanet2"
.PP
\fInetfront\fR
.IX Subsection "netfront"
.PP
\fInetscape nav2 nav3 nav4 nav4up nav45 nav45up navgold nav6 nav6up\fR
.IX Subsection "netscape nav2 nav3 nav4 nav4up nav45 nav45up navgold nav6 nav6up"
.PP
\fIobigo\fR
.IX Subsection "obigo"
.PP
\fIopera opera3 opera4 opera5 opera6 opera7\fR
.IX Subsection "opera opera3 opera4 opera5 opera6 opera7"
.PP
\fIpolaris\fR
.IX Subsection "polaris"
.PP
\fIpubsub\fR
.IX Subsection "pubsub"
.PP
\fIrealplayer\fR
.IX Subsection "realplayer"
.PP
The realplayer method above tests for the presence of either the RealPlayer
plug-in \*(L"(r1 \*(R" or the browser \*(L"RealPlayer\*(R".
.PP
\fIrealplayer_browser\fR
.IX Subsection "realplayer_browser"
.PP
The realplayer_browser method tests for the presence of the RealPlayer
browser (but returns 0 for the plugin).
.PP
\fIsafari\fR
.IX Subsection "safari"
.PP
\fIsamsung\fR
.IX Subsection "samsung"
.PP
\fIseamonkey\fR
.IX Subsection "seamonkey"
.PP
\fIsilk\fR
.IX Subsection "silk"
.PP
\fIstaroffice\fR
.IX Subsection "staroffice"
.PP
\fIucbrowser\fR
.IX Subsection "ucbrowser"
.PP
\fIwebtv\fR
.IX Subsection "webtv"
.PP
Netscape 6, even though it's called six, in the User-Agent string has version
number 5. The nav6 and nav6up methods correctly handle this quirk. The Firefox
test correctly detects the older-named versions of the browser (Phoenix,
Firebird).
.SS "Device related properties"
.IX Subsection "Device related properties"
The following methods are available, each returning a true or false value.
.PP
\fIandroid\fR
.IX Subsection "android"
.PP
\fIaudrey\fR
.IX Subsection "audrey"
.PP
\fIavantgo\fR
.IX Subsection "avantgo"
.PP
\fIblackberry\fR
.IX Subsection "blackberry"
.PP
\fIdsi\fR
.IX Subsection "dsi"
.PP
\fIiopener\fR
.IX Subsection "iopener"
.PP
\fIiphone\fR
.IX Subsection "iphone"
.PP
\fIipod\fR
.IX Subsection "ipod"
.PP
\fIipad\fR
.IX Subsection "ipad"
.PP
\fIkindle\fR
.IX Subsection "kindle"
.PP
\fIkindlefire\fR
.IX Subsection "kindlefire"
.PP
\fIn3ds\fR
.IX Subsection "n3ds"
.PP
\fIpalm\fR
.IX Subsection "palm"
.PP
\fIwebos\fR
.IX Subsection "webos"
.PP
\fIwap\fR
.IX Subsection "wap"
.PP
Note that 'wap' indicates that the device is capable of \s-1WAP,\s0 not
necessarily that the device is limited to \s-1WAP\s0 only. Most modern \s-1WAP\s0
devices are also capable of rendering standard \s-1HTML.\s0
.PP
\fIpsp\fR
.IX Subsection "psp"
.PP
\fIps3\fR
.IX Subsection "ps3"
.SS "Robot properties"
.IX Subsection "Robot properties"
These methods are now deprecated and will be removed in a future release.
Please use the \f(CW\*(C`robot()\*(C'\fR and \f(CW\*(C`robot_id()\*(C'\fR methods to identify the bots. Use
\&\f(CW\*(C`robot_id()\*(C'\fR if you need to match on a string, since the value that is
returned by \f(CW\*(C`robot\*(C'\fR could possibly change in a future release.
.PP
The following additional methods are available, each returning a true or false
value. This is by no means a complete list of robots that exist on the Web.
.PP
\fIahrefs\fR
.IX Subsection "ahrefs"
.PP
\fIaltavista\fR
.IX Subsection "altavista"
.PP
\fIapache\fR
.IX Subsection "apache"
.PP
\fIaskjeeves\fR
.IX Subsection "askjeeves"
.PP
\fIbaidu\fR
.IX Subsection "baidu"
.PP
\fIbingbot\fR
.IX Subsection "bingbot"
.PP
\fIcurl\fR
.IX Subsection "curl"
.PP
\fIfacebook\fR
.IX Subsection "facebook"
.PP
\fIgetright\fR
.IX Subsection "getright"
.PP
\fIgolib\fR
.IX Subsection "golib"
.PP
\fIgoogle\fR
.IX Subsection "google"
.PP
\fIgoogleadsbot\fR
.IX Subsection "googleadsbot"
.PP
\fIgoogleadsense\fR
.IX Subsection "googleadsense"
.PP
\fIgooglemobile\fR
.IX Subsection "googlemobile"
.PP
\fIindy\fR
.IX Subsection "indy"
.PP
\fIinfoseek\fR
.IX Subsection "infoseek"
.PP
\fIipsagent\fR
.IX Subsection "ipsagent"
.PP
\fIjava\fR
.IX Subsection "java"
.PP
\fIlinkexchange\fR
.IX Subsection "linkexchange"
.PP
\fIlwp\fR
.IX Subsection "lwp"
.PP
\fIlycos\fR
.IX Subsection "lycos"
.PP
\fImalware\fR
.IX Subsection "malware"
.PP
\fImj12bot\fR
.IX Subsection "mj12bot"
.PP
\fImsn\fR
.IX Subsection "msn"
.PP
\fImsoffice\fR
.IX Subsection "msoffice"
.PP
\fIpuf\fR
.IX Subsection "puf"
.PP
\fIrubylib\fR
.IX Subsection "rubylib"
.PP
\fIslurp\fR
.IX Subsection "slurp"
.PP
\fIwget\fR
.IX Subsection "wget"
.PP
\fIyahoo\fR
.IX Subsection "yahoo"
.PP
\fIyandex\fR
.IX Subsection "yandex"
.PP
\fIyandeximages\fR
.IX Subsection "yandeximages"
.PP
\fIheadlesschrome\fR
.IX Subsection "headlesschrome"
.SS "Engine properties"
.IX Subsection "Engine properties"
The following properties indicate if a particular rendering engine is
being used.
.PP
\fIwebkit\fR
.IX Subsection "webkit"
.PP
\fIgecko\fR
.IX Subsection "gecko"
.PP
\fItrident\fR
.IX Subsection "trident"
.PP
\fIpresto\fR
.IX Subsection "presto"
.PP
\fIkhtml\fR
.IX Subsection "khtml"
.SH "Other methods"
.IX Header "Other methods"
.SS "\fBuser_agent()\fP"
.IX Subsection "user_agent()"
Returns the value of the user agent string.
.PP
Calling this method with a parameter to set the user agent has now
been removed; please use HTTP::BrowserDetect\->\fBnew()\fR to pass the user
agent string.
.SS "\fBu2f()\fP"
.IX Subsection "u2f()"
Returns true if this browser and version are known to support Universal Second
Factor (U2F). This method will need future updates as more browsers fully
support this standard.
.SS "\fBcountry()\fP"
.IX Subsection "country()"
Returns the country string as it may be found in the user agent string. This
will be in the form of an upper case 2 character code. ie: \s-1US, DE,\s0 etc
.SS "\fBlanguage()\fP"
.IX Subsection "language()"
Returns the language string as it is found in the user agent string. This will
be in the form of an upper case 2 character code. ie: \s-1EN, DE,\s0 etc
.SS "\fBengine()\fP"
.IX Subsection "engine()"
Returns the rendering engine, one of the following:
.PP
gecko, webkit, khtml, trident, ie, presto, netfront
.PP
Note that this returns \*(L"webkit\*(R" for webkit based browsers (including
Chrome/Blink). This is a change from previous versions of this
library, which returned \*(L"\s-1KHTML\*(R"\s0 for webkit.
.PP
Returns \f(CW\*(C`undef\*(C'\fR if none of the above rendering engines can be
detected.
.SS "\fBengine_string()\fP"
.IX Subsection "engine_string()"
Returns a human formatted version of the rendering engine.
.PP
Note that this returns \*(L"WebKit\*(R" for webkit based browsers (including
Chrome/Blink). This is a change from previous versions of this
library, which returned \*(L"\s-1KHTML\*(R"\s0 for webkit.
.PP
Returns \f(CW\*(C`undef\*(C'\fR if none of the known rendering engines can be
detected.
.SS "\fBengine_version()\fP, \fBengine_major()\fP, \fBengine_minor()\fP, \fBengine_beta()\fP"
.IX Subsection "engine_version(), engine_major(), engine_minor(), engine_beta()"
Returns version information for the rendering engine, if any could be
detected. The format is the same as for the \fBbrowser_version()\fR
functions.
.SH "Deprecated methods"
.IX Header "Deprecated methods"
.SS "\fBdevice_name()\fP"
.IX Subsection "device_name()"
Deprecated alternate name for \fBdevice_string()\fR
.SS "\fBversion()\fP"
.IX Subsection "version()"
This is probably not what you want. Please use either \fBbrowser_version()\fR or
\&\fBengine_version()\fR instead.
.PP
Returns the version (major and minor) as a string.
.PP
This function returns wrong values for some Safari versions, for
compatibility with earlier code. \fBbrowser_version()\fR returns correct
version numbers for Safari.
.SS "\fBmajor()\fP"
.IX Subsection "major()"
This is probably not what you want. Please use either \fBbrowser_major()\fR
or \fBengine_major()\fR instead.
.PP
Returns the integer portion of the browser version as a string.
.PP
This function returns wrong values for some Safari versions, for
compatibility with earlier code. \fBbrowser_version()\fR returns correct
version numbers for Safari.
.SS "\fBminor()\fP"
.IX Subsection "minor()"
This is probably not what you want. Please use either \fBbrowser_minor()\fR
or \fBengine_minor()\fR instead.
.PP
Returns the decimal portion of the browser version as a string.
.PP
This function returns wrong values for some Safari versions, for
compatibility with earlier code. \fBbrowser_version()\fR returns correct
version numbers for Safari.
.SS "\fBbeta()\fP"
.IX Subsection "beta()"
This is probably not what you want. Please use \fBbrowser_beta()\fR instead.
.PP
Returns the beta version, consisting of any characters after the major
and minor version number, as a string.
.PP
This function returns wrong values for some Safari versions, for
compatibility with earlier code. \fBbrowser_version()\fR returns correct
version numbers for Safari.
.SS "\fBpublic_version()\fP, \fBpublic_major()\fP, \fBpublic_minor()\fP, \fBpublic_beta()\fP"
.IX Subsection "public_version(), public_major(), public_minor(), public_beta()"
Deprecated. Please use \fBbrowser_version()\fR and related functions
instead.
.SS "\fBgecko_version()\fP"
.IX Subsection "gecko_version()"
If a Gecko rendering engine is used (as in Mozilla or Firefox), returns the
engine version. If no Gecko browser is being used, or the version
number can't be detected, returns undef.
.PP
This is an old function, preserved for compatibility; please use
\&\fBengine_version()\fR in new code.
.SH "CREDITS"
.IX Header "CREDITS"
Lee Semel, lee@semel.net (Original Author)
.PP
Peter Walsham (co-maintainer)
.PP
Olaf Alders, \f(CW\*(C`olaf at wundercounter.com\*(C'\fR (co-maintainer)
.SH "ACKNOWLEDGEMENTS"
.IX Header "ACKNOWLEDGEMENTS"
Thanks to the following for their contributions:
.PP
cho45
.PP
Leonardo Herrera
.PP
Denis F. Latypoff
.PP
merlynkline
.PP
Simon Waters
.PP
Toni Cebrin
.PP
Florian Merges
.PP
david.hilton.p
.PP
Steve Purkis
.PP
Andrew McGregor
.PP
Robin Smidsrod
.PP
Richard Noble
.PP
Josh Ritter
.PP
Mike Clarke
.PP
Marc Sebastian Pelzer
.PP
Alexey Surikov
.PP
Maros Kollar
.PP
Jay Rifkin
.PP
Luke Saunders
.PP
Jacob Rask
.PP
Heiko Weber
.PP
Jon Jensen
.PP
Jesse Thompson
.PP
Graham Barr
.PP
Enrico Sorcinelli
.PP
Olivier Bilodeau
.PP
Yoshiki Kurihara
.PP
Paul Findlay
.PP
Uwe Voelker
.PP
Douglas Christopher Wilson
.PP
John Oatis
.PP
Atsushi Kato
.PP
Ronald J. Kimball
.PP
Bill Rhodes
.PP
Thom Blake
.PP
Aran Deltac
.PP
yeahoffline
.PP
David Ihnen
.PP
Hao Wu
.PP
Perlover
.PP
Daniel Stadie
.PP
ben hengst
.PP
Andrew Moise
.PP
Atsushi Kato
.PP
Marco Fontani
.PP
Nicolas Doye
.SH "TO DO"
.IX Header "TO DO"
\&\s-1POD\s0 coverage is not 100%.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\*(L"Browser \s-1ID\s0 (User-Agent) Strings\*(R",
.PP
HTML::ParseBrowser.
.SH "SUPPORT"
.IX Header "SUPPORT"
You can find documentation for this module with the perldoc command.
.PP
.Vb 1
\& perldoc HTTP::BrowserDetect
.Ve
.PP
You can also look for information at:
.IP "\(bu" 4
GitHub Source Repository
.Sp
.IP "\(bu" 4
Reporting Issues
.Sp
.IP "\(bu" 4
Search \s-1CPAN\s0
.Sp
.SH "CONTRIBUTING"
.IX Header "CONTRIBUTING"
Patches are certainly welcome, with many thanks for the excellent contributions
which have already been received. The preferred method of patching would be to
fork the GitHub repo and then send a pull request.
.PP
Please include a test case as this will speed up the time to release your
changes. Just edit t/useragents.json so that the test coverage includes any
changes you have made. Please open a GitHub issue if you have any questions.
.SH "AUTHORS"
.IX Header "AUTHORS"
.IP "\(bu" 4
Lee Semel
.IP "\(bu" 4
Peter Walsham
.IP "\(bu" 4
Olaf Alders (current maintainer)
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
This software is copyright (c) 1999 by Lee Semel.
.PP
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.