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