line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Duadua::Parser::Browser::AppleSafari; |
2
|
6
|
|
|
6
|
|
40
|
use strict; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
169
|
|
3
|
6
|
|
|
6
|
|
32
|
use warnings; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
132
|
|
4
|
6
|
|
|
6
|
|
28
|
use Duadua::Util; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
1928
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub try { |
7
|
302
|
|
|
302
|
1
|
613
|
my ($class, $d) = @_; |
8
|
|
|
|
|
|
|
|
9
|
302
|
100
|
|
|
|
629
|
return if index($d->ua, 'http') > -1; |
10
|
176
|
100
|
|
|
|
390
|
return if index($d->ua, 'Browser/') > -1; |
11
|
156
|
100
|
|
|
|
340
|
return if index($d->ua, 'HatenaBookmark/Android') > -1; |
12
|
|
|
|
|
|
|
|
13
|
155
|
100
|
66
|
|
|
323
|
if ( index($d->ua, 'Mozilla/5.0 (Mac') > -1 && index($d->ua, 'Safari/') > -1 ) { |
14
|
2
|
|
|
|
|
9
|
my $h = { |
15
|
|
|
|
|
|
|
name => 'Apple Safari', |
16
|
|
|
|
|
|
|
is_ios => 1, |
17
|
|
|
|
|
|
|
}; |
18
|
|
|
|
|
|
|
|
19
|
2
|
100
|
|
|
|
6
|
if ($d->opt_version) { |
20
|
1
|
|
|
|
|
4
|
my ($version) = ($d->ua =~ m!Safari/([\d.]+)!); |
21
|
1
|
50
|
|
|
|
6
|
$h->{version} = $version if $version; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
2
|
|
|
|
|
9
|
return $h; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
153
|
100
|
100
|
|
|
347
|
if ( index($d->ua, 'Mozilla/5.0') > -1 |
28
|
|
|
|
|
|
|
&& Duadua::Util->ordering_match($d, [' AppleWebKit/', ' Version/', ' Safari/']) ) { |
29
|
6
|
|
|
|
|
20
|
my $h = { |
30
|
|
|
|
|
|
|
name => 'Apple Safari', |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
|
33
|
6
|
100
|
|
|
|
15
|
if ($d->opt_version) { |
34
|
3
|
|
|
|
|
8
|
my ($version) = ($d->ua =~ m!Safari/([\d.]+)!); |
35
|
3
|
50
|
|
|
|
15
|
$h->{version} = $version if $version; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
6
|
|
|
|
|
17
|
return Duadua::Util->set_os($d, $h); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |