1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-07-12 22:30:17 +02:00

ResponseFilterBrowser now downloads the resource 1 time after the user clicks the GO button

This commit is contained in:
Salvador Díaz Fau
2018-05-25 14:40:49 +02:00
parent 8000e45198
commit ee61ac3c7b
2 changed files with 14 additions and 14 deletions

View File

@ -298,19 +298,19 @@ var
TempHeader : string;
TempLen : integer;
begin
if (response <> nil) and IsMyResource(request) then
begin
Result := FFilter;
TempHeader := trim(response.GetHeader('Content-Length'));
if not(FRscCompleted) and (response <> nil) and IsMyResource(request) then
begin
Result := FFilter;
TempHeader := trim(response.GetHeader('Content-Length'));
if TryStrToInt(TempHeader, TempLen) and (TempLen > 0) then
FRscSize := TempLen
else
FRscSize := -1;
if TryStrToInt(TempHeader, TempLen) and (TempLen > 0) then
FRscSize := TempLen
else
FRscSize := -1;
UpdateRscEncoding(response.MimeType, response.GetHeader('Content-Type'));
end
else
UpdateRscEncoding(response.MimeType, response.GetHeader('Content-Type'));
end
else
Result := nil;
end;
@ -398,7 +398,6 @@ begin
FStream.Clear;
FRscSize := -1;
FRscCompleted := False;
end
else
Memo1.Lines.Clear;
@ -409,6 +408,7 @@ end;
procedure TResponseFilterBrowserFrm.GoBtnClick(Sender: TObject);
begin
FRscCompleted := False;
Chromium1.LoadURL(AddressEdt.Text);
end;