Subject: | Detection of Internet Explorer 11 |
Internet Explorer 11 is not recognized because of new useragent format.
IE 11 has not msie part in UA-
Please see:
http://blogs.msdn.com/b/ieinternals/archive/2013/09/21/internet-explorer-11-user-agent-string-ua-string-sniffing-compatibility-with-gecko-webkit.aspx
My patch may be a workaround.
Please test and fix it in new version.
Subject: | DetectUserAgent.pm.diff |
--- DetectUserAgent.pm Sun Nov 24 15:21:17 2013
+++ DetectUserAgent.pm.patched Sun Nov 24 15:35:30 2013
@@ -47,9 +47,11 @@
my $block = $self->_parse_block($ua);
if( $block->{applewebkit} ){
$self->_check_webkit( $ua, $block );
}elsif( $block->{'_comment'}
- && index($block->{'_comment'}, 'msie' ) != -1 ){
+ && ( index($block->{'_comment'}, 'msie' ) != -1
+ or index($block->{'_comment'}, 'Trident' ) != -1) )
+ {
$self->_check_ie($ua, $block);
}elsif( $block->{gecko} ){
$self->_check_gecko( $ua, $block );
}else{
@@ -299,8 +301,14 @@
$self->{name} = 'Internet Explorer';
$self->{version} = $1;
$self->{vendor} = 'Microsoft';
}
+ # new IE 11 has new UA; may be like: Mozilla/5.0 (Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko
+ elsif( $block->{_comment} =~ /Trident\/[\d.]+;\s+(?:.+)?rv:([\d.]+)/){
+ $self->{name} = 'Internet Explorer';
+ $self->{version} = $1;
+ $self->{vendor} = 'Microsoft';
+ }
}
sub _check_gecko {
my ( $self, $ua, $block ) = @_;