Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Black berry #19

Merged
merged 2 commits into from

2 participants

@joatis

I added Blackberry to the list of possible return values of browser_string() and added 2 new user_agents to the useragents.json file. There are 2 commits because I'd forgotten to update the documentation the first time.

John Oatis

joatis added some commits
@joatis joatis Added "BlackBerry" to browser_string()
Added "BlackBerry" to the list of possible browser strings. Also added
new BlackBerry 6.0 UA string that contains WebKit/Safari tokens to
useragents.json
fbbed1e
@joatis joatis Updated browser_string() documentation.
Added BlackBerry to the list of possible return values of
sub browser_string.
db8fa74
@oalders oalders merged commit 848e5b6 into from
@oalders
Owner

First off, thanks for this. :) I just ran the tests and I'm getting a warning "Subroutine HTTP::BrowserDetect::blackberry redefined " when run "dzil test". Could you have a look at that and see if you can clear up the warning?

@joatis

Will do. Sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 25, 2011
  1. @joatis

    Added "BlackBerry" to browser_string()

    joatis authored
    Added "BlackBerry" to the list of possible browser strings. Also added
    new BlackBerry 6.0 UA string that contains WebKit/Safari tokens to
    useragents.json
  2. @joatis

    Updated browser_string() documentation.

    joatis authored
    Added BlackBerry to the list of possible return values of
    sub browser_string.
This page is out of date. Refresh to see the latest.
Showing with 38 additions and 2 deletions.
  1. +4 −2 lib/HTTP/BrowserDetect.pm
  2. +34 −0 t/useragents.json
View
6 lib/HTTP/BrowserDetect.pm
@@ -58,7 +58,7 @@ push @ALL_TESTS, qw(
aol6 neoplanet neoplanet2
avantgo emacs mozilla
r1 elinks netfront
- mobile_safari
+ mobile_safari blackberry
);
# Engines
@@ -761,6 +761,7 @@ sub browser_string {
$browser_string = 'NetFront' if $self->netfront;
$browser_string = 'Mobile Safari' if $self->mobile_safari;
$browser_string = 'ELinks' if $self->elinks;
+ $browser_string = 'BlackBerry' if $self->blackberry;
}
return $browser_string;
}
@@ -1452,7 +1453,8 @@ Firebird).
Returns undef on failure. Otherwise returns one of the following:
Netscape, Firefox, Safari, Chrome, MSIE, WebTV, AOL Browser, Opera, Mosaic,
-Lynx, Links, ELinks, RealPlayer, IceWeasel, curl, puf, NetFront, Mobile Safari
+Lynx, Links, ELinks, RealPlayer, IceWeasel, curl, puf, NetFront, Mobile Safari,
+BlackBerry
=head2 gecko_version()
View
34 t/useragents.json
@@ -2812,6 +2812,40 @@
"public_minor" : "0",
"public_version" : "8.0",
"version" : "8.0"
+ },
+ "Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; fr) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.246 Mobile Safari/534.1+" : {
+ "browser_string" : "BlackBerry",
+ "match" : [
+ "safari",
+ "mobile",
+ "mobile_safari",
+ "blackberry",
+ "device"
+ ],
+ "no_match" : [
+ "robot"
+ ],
+ "public_version" : "6.0",
+ "device_name" : "BlackBerry",
+ "language" : "FR",
+ "engine_string" : "KHTML"
+ },
+ "BlackBerry8520/4.6.1.272 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/118" : {
+ "browser_string" : "BlackBerry",
+ "match" : [
+ "mobile",
+ "blackberry",
+ "device"
+ ],
+ "minor" : ".6",
+ "no_match" : [
+ "robot"
+ ],
+ "public_major" : "4",
+ "public_minor" : ".6",
+ "public_version" : "4.6",
+ "version" : "4.6",
+ "device_name" : "BlackBerry"
}
}
Something went wrong with that request. Please try again.