haha, I did the same thing just now... I've attached it if anyone's
interested.
[guest - Thu Oct 23 11:19:14 2003]:
Show quoted text>
> This module seems to be inactive for quite a long time now. I've done my
> own modifications in order to support Win2k, WinXP, and newer browsers,
> like Firebird or Safari.
>
> I'm mailing the author to see if he's willing to make changes to this
> module to reflect the current status of this stuff.
>
>
--- BrowserDetect.pm Wed Jan 31 09:44:27 2001
+++ /usr/home/user/BrowserDetect.pm Mon Jun 21 09:10:58 2004
@@ -11,13 +11,13 @@
$VERSION = '0.97';
# Operating Systems
-push @ALL_TESTS,(qw(win16 win3x win31 win95 win98 winnt windows win32 win2k winme mac mac68k macppc os2 unix sun sun4 sun5 suni86 irix irix5 irix6 hpux hpux9 hpux10 aix aix1 aix2 aix3 aix4 linux sco unixware mpras reliant dec sinix freebsd bsd vms x11 amiga));
+push @ALL_TESTS,(qw(win16 win3x win31 win95 win98 winnt windows win32 win2k winxp winme mac macosx mac68k macppc os2 unix sun sun4 sun5 suni86 irix irix5 irix6 hpux hpux9 hpux10 aix aix1 aix2 aix3 aix4 linux sco unixware mpras reliant dec sinix freebsd bsd vms x11 amiga));
# Devices
push @ALL_TESTS,(qw(palm audrey iopener wap));
# Browsers
-push @ALL_TESTS,(qw(mosaic netscape nav2 nav3 nav4 nav4up nav45 nav45up nav6 nav6up navgold ie ie3 ie4 ie4up ie5 ie5up ie55 ie55up opera opera3 opera4 opera5 lynx aol aol3 aol4 aol5 aol6 neoplanet neoplanet2 avantgo emacs gecko));
+push @ALL_TESTS,(qw(mosaic netscape nav2 nav3 nav4 nav4up nav45 nav45up nav6 nav6up navgold firefox safari ie ie3 ie4 ie4up ie5 ie5up ie55 ie55up opera opera3 opera4 opera5 lynx aol aol3 aol4 aol5 aol6 neoplanet neoplanet2 avantgo emacs gecko));
# Robots
push @ALL_TESTS,(qw(wget getright robot yahoo altavista lycos infoseek lwp webcrawler linkexchange slurp webtv staroffice lotusnotes konqueror icab google java));
@@ -123,6 +123,8 @@
$tests->{NAV6} = ($tests->{NETSCAPE} && $major == 5); # go figure
$tests->{NAV6UP} = ($tests->{NETSCAPE} && $major >= 5);
$tests->{GECKO} = (index($ua,"gecko") != -1);
+ $tests->{FIREFOX} = (index($ua,"firefox") != -1);
+ $tests->{SAFARI} = (index($ua,"safari") != -1);
# Internet Explorer browsers
@@ -239,7 +241,9 @@
index($ua,"windows nt") != -1 ||
index($ua,"nt4") != -1 ||
index($ua,"nt3") != -1);
- $tests->{WIN2K} = (index($ua,"nt 5") != -1 || index($ua,"nt5") != -1);
+ $tests->{WIN2K} = (index($ua,"nt 5.0") != -1 || index($ua,"nt5") != -1);
+ $tests->{WINXP} = (index($ua,"nt 5.1") != -1 );
+
$tests->{WINME} = (index($ua,"win 9x 4.90") != -1); # whatever
$tests->{WIN32} = (($tests->{WIN95} || $tests->{WIN98} || $tests->{WINME} || $tests->{WINNT} ||
$tests->{WIN2K}) || index($ua,"win32") != -1);
@@ -249,6 +253,7 @@
# Mac operating systems
$tests->{MAC} = (index($ua,"macintosh") != -1 || index($ua,"mac_") != -1);
+ $tests->{MACOSX} = (index($ua,"macintosh") != -1 || index($ua,"mac os x") != -1);
$tests->{MAC68K} = (($tests->{MAC}) && (index($ua,"68k") != -1 || index($ua,"68000") != -1));
$tests->{MACPPC} = (($tests->{MAC}) && (index($ua,"ppc") != -1 || index($ua,"powerpc") != -1));
@@ -309,7 +314,9 @@
my $user_agent = $self->user_agent;
if (defined $user_agent) {
$browser_string = 'Netscape' if $self->netscape;
- $browser_string = 'MSIE' if $self->ie;
+ $browser_string = 'Firefox' if $self->firefox;
+ $browser_string = 'Safari' if $self->safari;
+ $browser_string = 'IE' if $self->ie;
$browser_string = 'WebTV' if $self->webtv;
$browser_string = 'AOL Browser' if $self->aol;
$browser_string = 'Opera' if $self->opera;
@@ -327,7 +334,10 @@
$os_string = 'Win95' if $self->win95;
$os_string = 'Win98' if $self->win98;
$os_string = 'WinNT' if $self->winnt;
+ $os_string = 'Win2k' if $self->win2k;
+ $os_string = 'WinXP' if $self->winxp;
$os_string = 'Mac' if $self->mac;
+ $os_string = 'Mac OS X' if $self->macosx;
$os_string = 'Win3x' if $self->win3x;
$os_string = 'OS2' if $self->os2;
$os_string = 'Unix' if $self->unix && !$self->linux;