litesoft
Diff Revisions
49
vs
471
for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/nonpublic/NP_UserAgent_IE.java
|
@@ -10,16 +10,20 @@ |
10 |
10 |
|
super( BrowserFamily.IE, determineReal() ); |
11 |
11 |
|
} |
12 |
12 |
|
|
|
13 |
+ |
// ; MSIE 6.0; |
|
14 |
+ |
// 01234567890 |
13 |
15 |
|
private static String determineReal() |
14 |
16 |
|
{ |
15 |
17 |
|
String zUserAgent = getBrowserUserAgent(); |
16 |
|
- |
if ( zUserAgent.indexOf( "; MSIE 6.0;" ) != -1 ) |
|
18 |
+ |
int atStart = zUserAgent.indexOf("; MSIE ") + 7; |
|
19 |
+ |
int atEnd = zUserAgent.indexOf(".0;", atStart); |
|
20 |
+ |
if ( (atStart > 6) && (atEnd != -1) && (atEnd <= (atStart + 2))) |
17 |
21 |
|
{ |
18 |
|
- |
return "IE6"; |
19 |
|
- |
} |
20 |
|
- |
if ( zUserAgent.indexOf( "; MSIE 7.0;" ) != -1 ) |
21 |
|
- |
{ |
22 |
|
- |
return "IE7"; |
|
22 |
+ |
try { |
|
23 |
+ |
return "IE" + Integer.parseInt(zUserAgent.substring(atStart,atEnd)); |
|
24 |
+ |
} catch (NumberFormatException e) { |
|
25 |
+ |
// Really? Then Assume the default |
|
26 |
+ |
} |
23 |
27 |
|
} |
24 |
28 |
|
return "IE8"; |
25 |
29 |
|
} |