Skip to content

Commit

Permalink
Added Nabi Tablets support, prioritized some tablet regexes.
Browse files Browse the repository at this point in the history
  • Loading branch information
serbanghita committed Feb 7, 2013
1 parent c2e70d4 commit 57c557e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Mobile_Detect.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ class Mobile_Detect {
);
// List of tablet devices.
protected $tabletDevices = array(
'BlackBerryTablet' => 'PlayBook|RIM Tablet',
'iPad' => 'iPad|iPad.*Mobile', // @todo: check for mobile friendly emails topic.
'NexusTablet' => '^.*Android.*Nexus(((?:(?!Mobile))|(?:(\s(7|10).+))).)*$',
'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1010|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P6810|GT-P7501',
// @reference: http://www.labnol.org/software/kindle-user-agent-string/20378/
'Kindle' => 'Kindle|Silk.*Accelerated',
'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1010|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P6810|GT-P7501',
'AsusTablet' => 'Transformer|TF101',
'BlackBerryTablet' => 'PlayBook|RIM Tablet',
'HTCtablet' => 'HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200',
'MotorolaTablet' => 'xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617',
'AsusTablet' => 'Transformer|TF101',
'NookTablet' => 'Android.*Nook|NookColor|nook browser|BNTV250A|LogicPD Zoom2',
// @ref: http://www.acer.ro/ac/ro/RO/content/drivers
// @ref: http://www.packardbell.co.uk/pb/en/GB/content/download (Packard Bell is part of Acer)
Expand Down Expand Up @@ -118,6 +118,8 @@ class Mobile_Detect {
'HuaweiTablet' => 'MediaPad|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim',
// Nec or Medias Tab
'NecTablet' => '\bN-06D|\bN-08D',
// @ref: https://www.nabitablet.com/
'NabiTablet' => 'Android.*\bNabi',
// @note: Avoid detecting 'PLAYSTATION 3' as mobile.
'PlaystationTablet' => 'Playstation.*(Portable|Vita)',
'GenericTablet' => 'Android.*\b97D\b|Tablet(?!.*PC)|ViewPad7|MID7015|BNTV250A|LogicPD Zoom2|\bA7EB\b|CatNova8|A1_07|CT704|CT1002|\bM721\b|hp-tablet',
Expand Down
6 changes: 6 additions & 0 deletions manual_tests/mobilePerVendor_useragents.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10' => array('isMobile' => true, 'isTablet' => true),
'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0_1 like Mac OS X; da-dk) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/21.0.1180.82 Mobile/10A523 Safari/7534.48.3' => array('isMobile' => true, 'isTablet' => false),
'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A523 Safari/8536.25' => array('isMobile' => true, 'isTablet' => false),
'Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X; ru-ru) AppleWebKit/536.26 (KHTML, like Gecko) CriOS/23.0.1271.100 Mobile/10B142 Safari/8536.25' => array('isMobile' => true, 'isTablet' => false),
),

'ASUS' => array(
Expand Down Expand Up @@ -271,6 +272,11 @@
'Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; Xoom Build/IMM76L) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30' => array('isMobile' => true, 'isTablet' => true),
),

// @ref: https://www.nabitablet.com/
'Nabi' => array(
'Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; NABI-A Build/MASTER) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1' => array('isMobile' => true, 'isTablet' => true),
),

'NEC' => array(
// @ref: http://www.n-keitai.com/n-08d/?from=mediasnet
// @ref: http://devlog.dcm-gate.com/2012/03/medias-tab-n-06duseragnet.html
Expand Down

0 comments on commit 57c557e

Please sign in to comment.