Skip to content

Commit

Permalink
Add check for kindle fire, list as enyo.platform.android = 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Mar 21, 2012
1 parent 819c157 commit d3c5e7e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions source/dom/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ enyo.platform = {};
var platforms = [
// Android 2 - 4
{platform: "android", regex: /Android (\d+)/},
// Kindle Fire
// Force version to 2, (desktop mode does not list android version)
{platform: "android", regex: /Silk\//, forceVersion: 2},
// IE 8 - 10
{platform: "ie", regex: /MSIE (\d+)/},
// iOS 3 - 5
Expand All @@ -36,10 +39,15 @@ enyo.platform = {};
// webOS 1 - 3
{platform: "webos", regex: /(?:web|hpw)OS\/(\d+)/}
];
for (var i = 0, p, m; p = platforms[i]; i++) {
for (var i = 0, p, m, v; p = platforms[i]; i++) {
m = p.regex.exec(ua);
if (m) {
ep[p.platform] = Number(m[1]);
if (p.forceVersion) {
v = p.forceVersion;
} else {
v = Number(m[1]);
}
ep[p.platform] = v;
break;
}
}
Expand Down

0 comments on commit d3c5e7e

Please sign in to comment.