137
# to the URL.
137
# to the URL.
139
# Server push is a Netscape 3+ hack incompatible with MSIE, Lynx, and others.
139
# Server push is a Netscape 3+ hack incompatible with MSIE, Lynx, and others.
140
# Even Communicator 4.51 has bugs with it, especially during page reload.
140
# Safari 2.0.2 (Webkit 416.11) and above support it.
141
# http://www.browsercaps.org used as source of compatible browsers.
142
# Safari (WebKit) does not support it, despite a UA that says otherwise (bug 188712)
143
# MSIE 5+ supports it on Mac (but not on Windows) (bug 190370)
141
# MSIE 5+ supports it on Mac (but not on Windows) (bug 190370)
143
my $webkitversion = "";
144
if ($ENV{'HTTP_USER_AGENT'} =~ /WebKit\/(\d+)/) {
145
my $serverpush =
148
my $serverpush =
146
$format->{'extension'} eq "html"
149
$format->{'extension'} eq "html"
147
&& exists $ENV{'HTTP_USER_AGENT'}
150
&& exists $ENV{'HTTP_USER_AGENT'}
148
&& $ENV{'HTTP_USER_AGENT'} =~ /Mozilla.[3-9]/
151
&& $ENV{'HTTP_USER_AGENT'} =~ /Mozilla.[3-9]/
149
&& (($ENV{'HTTP_USER_AGENT'} !~ /[Cc]ompatible/) || ($ENV{'HTTP_USER_AGENT'} =~ /MSIE 5.*Mac_PowerPC/))
152
&& (($ENV{'HTTP_USER_AGENT'} !~ /[Cc]ompatible/) || ($ENV{'HTTP_USER_AGENT'} =~ /MSIE 5.*Mac_PowerPC/))
150
&& $ENV{'HTTP_USER_AGENT'} !~ /WebKit/
153
&& (!$webkitversion || $webkitversion >= 416)
151
&& !$agent
154
&& !$agent
152
&& !defined($cgi->param('serverpush'))
155
&& !defined($cgi->param('serverpush'))
153
|| $cgi->param('serverpush');
156
|| $cgi->param('serverpush');