1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-02 21:57:37 +02:00

Fixed wrong DevTools method result handling in MiniBrowser demo

This commit is contained in:
Salvador Diaz Fau 2021-01-07 11:12:20 +01:00
parent cfe43f040f
commit e19ecae2b5
2 changed files with 44 additions and 32 deletions

View File

@ -1137,14 +1137,21 @@ begin
TempResult := 0; TempResult := 0;
if success then if success then
begin
TempResult := 1;
FDevToolsMsgValue := '';
if (result <> nil) then
begin begin
TempDict := result.GetDictionary; TempDict := result.GetDictionary;
if (TempDict <> nil) and (TempDict.GetSize > 0) then
begin
TempValue := TempDict.GetValue('data'); TempValue := TempDict.GetValue('data');
if (TempValue <> nil) and (TempValue.GetType = VTYPE_STRING) then if (TempValue <> nil) and (TempValue.GetType = VTYPE_STRING) then
begin
FDevToolsMsgValue := TempValue.GetString; FDevToolsMsgValue := TempValue.GetString;
if (length(FDevToolsMsgValue) > 0) then TempResult := 1; end;
end; end;
end end
else else
@ -1181,6 +1188,8 @@ var
TempLen : integer; TempLen : integer;
begin begin
if (aMessage.WParam <> 0) then if (aMessage.WParam <> 0) then
begin
if (length(FDevToolsMsgValue) > 0) then
begin begin
TempData := TNetEncoding.Base64.DecodeStringToBytes(FDevToolsMsgValue); TempData := TNetEncoding.Base64.DecodeStringToBytes(FDevToolsMsgValue);
TempLen := length(TempData); TempLen := length(TempData);
@ -1216,6 +1225,9 @@ begin
else else
showmessage('There was an error decoding the data'); showmessage('There was an error decoding the data');
end end
else
showmessage('DevTools method executed successfully!');
end
else else
if (length(FDevToolsMsgValue) > 0) then if (length(FDevToolsMsgValue) > 0) then
showmessage(FDevToolsMsgValue) showmessage(FDevToolsMsgValue)

View File

@ -2,7 +2,7 @@
"UpdateLazPackages" : [ "UpdateLazPackages" : [
{ {
"ForceNotify" : true, "ForceNotify" : true,
"InternalVersion" : 225, "InternalVersion" : 226,
"Name" : "cef4delphi_lazarus.lpk", "Name" : "cef4delphi_lazarus.lpk",
"Version" : "87.1.12.0" "Version" : "87.1.12.0"
} }