Add IE 10 and 11 and also microsoft edge as supported browsers

Currently we only referenced IE9 or lower and didn't offically support
IE10+ or even Microsoft Edge.

This patch offically adds support for these browsers.

Change-Id: Ide048658f46fa17edcbe8fe02c33cfc4866a428e
This commit is contained in:
Paladox none 2016-09-19 06:29:46 +00:00 committed by David Pursehouse
parent d4db051cec
commit 6bc066ebb6
3 changed files with 12 additions and 3 deletions

View File

@ -30,7 +30,7 @@ import javax.servlet.http.HttpServletRequest;
* Ported from JavaScript in {@code com.google.gwt.user.UserAgent.gwt.xml}.
*/
public class UserAgentRule {
private static final Pattern msie = compile(".*msie ([0-9]+)\\.([0-9]+).*");
private static final Pattern msie = compile(".*msie ([0-11]+)\\.([0-11]+).*");
private static final Pattern gecko = compile(".*rv:([0-9]+)\\.([0-9]+).*");
public String getName() {
@ -58,6 +58,9 @@ public class UserAgentRule {
Matcher m = msie.matcher(ua);
if (m.matches() && m.groupCount() == 2) {
int v = makeVersion(m);
if (v >= 11000) {
return "ie11";
}
if (v >= 10000) {
return "ie10";
}
@ -70,6 +73,8 @@ public class UserAgentRule {
}
return null;
} else if (ua.contains("edge")) {
return "edge";
} else if (ua.contains("gecko")) {
Matcher m = gecko.matcher(ua);
if (m.matches() && m.groupCount() == 2) {

View File

@ -18,12 +18,14 @@ BROWSERS = [
'firefox',
'gecko1_8',
'safari',
'msie', 'ie8', 'ie9',
'msie', 'ie8', 'ie9', 'ie10', 'ie11',
'edge',
]
ALIASES = {
'chrome': 'safari',
'firefox': 'gecko1_8',
'msie': 'ie9',
'msie': 'ie11',
'edge': 'edge',
}
MODULE = 'com.google.gerrit.GerritGwtUI'
CPU_COUNT = cpu_count()

View File

@ -34,6 +34,8 @@
<when-property-is name="user.agent" value="ie8"/>
<when-property-is name="user.agent" value="ie9"/>
<when-property-is name="user.agent" value="ie10"/>
<when-property-is name="user.agent" value="ie11"/>
<when-property-is name="user.agent" value="edge"/>
</any>
</replace-with>
</module>