Skip to content

Commit

Permalink
Update to WebView2 NuGet 1.0.1210.39
Browse files Browse the repository at this point in the history
Added workaround memory leak with custom context menu items
  • Loading branch information
salvadordf committed May 9, 2022
1 parent b125c1a commit 417c0d7
Show file tree
Hide file tree
Showing 24 changed files with 648 additions and 148 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ WebView4Delphi is an open source project created by Salvador Díaz Fau to embed

WebView4Delphi only supports Windows. If you need to embed a web browser in Linux, Windows or MacOS consider using [CEF4Delphi](https://github.com/salvadordf/CEF4Delphi) instead.

WebView4Delphi uses the [Microsoft Edge WebView2 Runtime](https://docs.microsoft.com/en-us/microsoft-edge/webview2/) and [Microsoft.Web.WebView2 NuGet package version 1.0.1185.39](https://www.nuget.org/packages/Microsoft.Web.WebView2) to embed a web browser.
WebView4Delphi uses the [Microsoft Edge WebView2 Runtime](https://docs.microsoft.com/en-us/microsoft-edge/webview2/) and [Microsoft.Web.WebView2 NuGet package version 1.0.1210.39](https://www.nuget.org/packages/Microsoft.Web.WebView2) to embed a web browser.

WebView4Delphi was developed and tested on Delphi 11.1, Delphi XE3 and Lazarus 2.2.0/FPC 3.2.2.

Expand Down
Binary file modified bin32/WebView2Loader.dll
Binary file not shown.
Binary file modified bin64/WebView2Loader.dll
Binary file not shown.
1 change: 1 addition & 0 deletions demos/Delphi_VCL/KioskBrowser/KioskBrowser.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ uses
{$R *.res}

begin
ReportMemoryLeaksOnShutdown := true;
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TMainForm, MainForm);
Expand Down
16 changes: 8 additions & 8 deletions demos/Delphi_VCL/KioskBrowser/KioskBrowser.dproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{1424089C-DBAE-4E95-AC2D-1A511736D664}</ProjectGuid>
<ProjectVersion>19.3</ProjectVersion>
<ProjectVersion>19.4</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>KioskBrowser.dpr</MainSource>
<Base>True</Base>
Expand Down Expand Up @@ -965,17 +965,17 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>
Expand Down
1 change: 0 additions & 1 deletion demos/Delphi_VCL/KioskBrowser/uKioskBrowser.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ object MainForm: TMainForm
WindowState = wsMaximized
OnCreate = FormCreate
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 15
object WVWindowParent1: TWVWindowParent
Left = 0
Expand Down
14 changes: 7 additions & 7 deletions demos/Delphi_VCL/MiniBrowser/MiniBrowser.dproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{727B56F4-AE61-4F6D-B73E-6F9DF40B4EB7}</ProjectGuid>
<ProjectVersion>19.3</ProjectVersion>
<ProjectVersion>19.4</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>MiniBrowser.dpr</MainSource>
<Base>True</Base>
Expand Down Expand Up @@ -972,17 +972,17 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>
Expand Down
1 change: 0 additions & 1 deletion demos/Delphi_VCL/MiniBrowser/uMiniBrowser.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ object MiniBrowserFrm: TMiniBrowserFrm
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 15
object NavControlPnl: TPanel
Left = 0
Expand Down
5 changes: 2 additions & 3 deletions demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ TMiniBrowserFrm = class(TForm)
procedure WVBrowser1RetrieveTextCompleted(Sender: TObject; aResult: Boolean; const aText: wvstring);
procedure WVBrowser1RetrieveMHTMLCompleted(Sender: TObject; aResult: Boolean; const aMHTML: wvstring);
procedure WVBrowser1BasicAuthenticationRequested(Sender: TObject; const aWebView: ICoreWebView2; const aArgs: ICoreWebView2BasicAuthenticationRequestedEventArgs);
procedure WVBrowser1StatusBarTextChanged(Sender: TObject;
const aWebView: ICoreWebView2);
procedure WVBrowser1StatusBarTextChanged(Sender: TObject; const aWebView: ICoreWebView2);

protected
FDownloadOperation : TCoreWebView2DownloadOperation;
Expand Down Expand Up @@ -299,7 +298,7 @@ procedure TMiniBrowserFrm.FormCreate(Sender: TObject);
FBlockImages := False;
FDownloadIDGen := 0;
FDownloadOperation := nil;
WVBrowser1.DefaultURL := URLCbx.Text;
WVBrowser1.DefaultURL := URLCbx.Text;
end;

procedure TMiniBrowserFrm.FormDestroy(Sender: TObject);
Expand Down
4 changes: 3 additions & 1 deletion packages/WebView4DelphiVCLRTL.dpk
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ contains
uWVCoreWebView2BasicAuthenticationResponse in '..\source\uWVCoreWebView2BasicAuthenticationResponse.pas',
uWVCoreWebView2ContextMenuItemCollection in '..\source\uWVCoreWebView2ContextMenuItemCollection.pas',
uWVCoreWebView2ContextMenuItem in '..\source\uWVCoreWebView2ContextMenuItem.pas',
uWVCoreWebView2ContextMenuTarget in '..\source\uWVCoreWebView2ContextMenuTarget.pas';
uWVCoreWebView2ContextMenuTarget in '..\source\uWVCoreWebView2ContextMenuTarget.pas',
uWVCoreWebView2Profile in '..\source\uWVCoreWebView2Profile.pas',
uWVCoreWebView2ControllerOptions in '..\source\uWVCoreWebView2ControllerOptions.pas';

end.
2 changes: 2 additions & 0 deletions packages/WebView4DelphiVCLRTL.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@
<DCCReference Include="..\source\uWVCoreWebView2ContextMenuItemCollection.pas"/>
<DCCReference Include="..\source\uWVCoreWebView2ContextMenuItem.pas"/>
<DCCReference Include="..\source\uWVCoreWebView2ContextMenuTarget.pas"/>
<DCCReference Include="..\source\uWVCoreWebView2Profile.pas"/>
<DCCReference Include="..\source\uWVCoreWebView2ControllerOptions.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
Expand Down
2 changes: 1 addition & 1 deletion packages/webview4delphi.lpk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
</CompilerOptions>
<Version Major="1" Release="1185" Build="39"/>
<Version Major="1" Release="1210" Build="39"/>
<Files Count="47">
<Item1>
<Filename Value="..\source\uWVBrowser.pas"/>
Expand Down
Loading

0 comments on commit 417c0d7

Please sign in to comment.