Skip to content

Commit

Permalink
Workaround for issue #66
Browse files Browse the repository at this point in the history
  • Loading branch information
salvadordf committed Aug 21, 2024
1 parent fcdb780 commit a369af7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions demos/Delphi_VCL/WindowlessBrowser/uWindowlessBrowser.pas
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
unit uWindowlessBrowser;

{$I ..\..\..\source\webview2.inc}

interface

uses
Expand Down Expand Up @@ -356,6 +358,7 @@ procedure TMainForm.WVBrowser1InitializationError(Sender: TObject;
procedure TMainForm.WVBrowser1WebMessageReceived(Sender: TObject;
const aWebView: ICoreWebView2;
const aArgs: ICoreWebView2WebMessageReceivedEventArgs);
{$IFDEF DELPHI26_UP}
var
TempArgs : TCoreWebView2WebMessageReceivedEventArgs;
TempMsg : string;
Expand All @@ -364,7 +367,11 @@ procedure TMainForm.WVBrowser1WebMessageReceived(Sender: TObject;
TempPoint : TPoint;
TempSize : TSize;
TempScale : single;
{$ELSE}
// TO-DO: Use an alternative way to parse the JSON message in Delphi 10.2.3 Tokio or older
{$ENDIF}
begin
{$IFDEF DELPHI26_UP}
TempArgs := TCoreWebView2WebMessageReceivedEventArgs.Create(aArgs);
TempMsg := TempArgs.WebMessageAsJson;

Expand Down Expand Up @@ -397,6 +404,9 @@ procedure TMainForm.WVBrowser1WebMessageReceived(Sender: TObject;

TempArgs.Free;
TempObject.Free;
{$ELSE}
// TO-DO: Use an alternative way to parse the JSON message in Delphi 10.2.3 Tokio or older
{$ENDIF}
end;

procedure TMainForm.Timer1Timer(Sender: TObject);
Expand Down
2 changes: 1 addition & 1 deletion update_WebView4Delphi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 160,
"InternalVersion" : 161,
"Name" : "webview4delphi.lpk",
"Version" : "1.0.2651.64"
}
Expand Down

0 comments on commit a369af7

Please sign in to comment.