Skip to content

Commit

Permalink
add Firefox for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
tagomoris committed Dec 22, 2015
1 parent 89aa632 commit b66c245
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/is/tagomor/woothee/browser/SafariChrome.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

public class SafariChrome extends AgentCategory {
private static Pattern edgeVerRegex = Pattern.compile("Edge/([.0-9]+)");
private static Pattern firefoxiOSPattern = Pattern.compile("FxiOS/([.0-9]+)");
private static Pattern chromeVerRegex = Pattern.compile("(?:Chrome|CrMo|CriOS)/([.0-9]+)");
private static Pattern operaVerRegex = Pattern.compile("OPR/([.0-9]+)");
private static Pattern safariVerRegex = Pattern.compile("Version/([.0-9]+)");
Expand All @@ -32,6 +33,17 @@ public static boolean challenge(final String ua, final Map<String,String> result
}
}

int fpos = ua.indexOf("FxiOS");
if (fpos > -1) {
Matcher ffox = firefoxiOSPattern.matcher(ua);
if (ffox.find(fpos)) {
version = ffox.group(1);
updateMap(result, DataSet.get("Firefox"));
updateVersion(result, version);
return true;
}
}

int cpos = ua.indexOf("Chrome");
if (cpos < 0)
cpos = ua.indexOf("CrMo");
Expand Down

0 comments on commit b66c245

Please sign in to comment.