From 2b6fe85c693235302b97567a5de3eecedba94050 Mon Sep 17 00:00:00 2001 From: salvadordf Date: Fri, 11 Mar 2022 18:13:04 +0100 Subject: [PATCH] Update to WebView2 NuGet 1.0.1150.38 Renamed the "aWebView" parameter to "aFrame" in TWVBrowserBase.OnFrameNavigationStarting, TWVBrowserBase.OnFrameNavigationCompleted, TWVBrowserBase.OnFrameContentLoading, TWVBrowserBase.OnFrameDOMContentLoaded and TWVBrowserBase.OnFrameWebMessageReceived --- README.md | 2 +- bin32/WebView2Loader.dll | Bin 111536 -> 110504 bytes bin64/WebView2Loader.dll | Bin 142248 -> 141224 bytes demos/Delphi_VCL/MiniBrowser/MiniBrowser.dpr | 3 +- .../Delphi_VCL/MiniBrowser/MiniBrowser.dproj | 8 +- .../MiniBrowser/uBasicUserAuthForm.dfm | 110 +++ .../MiniBrowser/uBasicUserAuthForm.pas | 97 +++ demos/Delphi_VCL/MiniBrowser/uMiniBrowser.dfm | 2 + demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas | 24 +- demos/Lazarus/MiniBrowser/MiniBrowser.lps | 135 ++-- .../MiniBrowser/uBasicUserAuthForm.lfm | 99 +++ .../MiniBrowser/uBasicUserAuthForm.lrs | 30 + .../MiniBrowser/uBasicUserAuthForm.pas | 99 +++ demos/Lazarus/MiniBrowser/uMiniBrowser.lfm | 2 + demos/Lazarus/MiniBrowser/uMiniBrowser.pas | 31 +- packages/WebView4DelphiFMXRTL.dpk | 2 - packages/WebView4DelphiFMXRTL.dproj | 81 +- packages/WebView4DelphiFMXRTL.res | Bin 712 -> 712 bytes packages/WebView4DelphiVCLRTL.dpk | 4 +- packages/WebView4DelphiVCLRTL.dproj | 751 ++++++++++-------- packages/WebView4Delphi_designtime.dpk | 2 +- packages/WebView4Delphi_designtime.dproj | 42 +- packages/webview4delphi.lpk | 8 +- packages/webview4delphi.pas | 2 +- source/uWVBrowser.pas | 1 + source/uWVBrowserBase.pas | 41 +- source/uWVCoreWebView2.pas | 32 +- source/uWVCoreWebView2Args.pas | 124 ++- ...oreWebView2BasicAuthenticationResponse.pas | 107 +++ source/uWVCoreWebView2Delegates.pas | 36 + source/uWVEvents.pas | 11 +- source/uWVFMXBrowser.pas | 1 + source/uWVInterfaces.pas | 3 + source/uWVMiscFunctions.pas | 9 + source/uWVTypeLibrary.pas | 63 +- update_WebView4Delphi.json | 4 +- 36 files changed, 1552 insertions(+), 414 deletions(-) create mode 100644 demos/Delphi_VCL/MiniBrowser/uBasicUserAuthForm.dfm create mode 100644 demos/Delphi_VCL/MiniBrowser/uBasicUserAuthForm.pas create mode 100644 demos/Lazarus/MiniBrowser/uBasicUserAuthForm.lfm create mode 100644 demos/Lazarus/MiniBrowser/uBasicUserAuthForm.lrs create mode 100644 demos/Lazarus/MiniBrowser/uBasicUserAuthForm.pas create mode 100644 source/uWVCoreWebView2BasicAuthenticationResponse.pas diff --git a/README.md b/README.md index 33fed7c..fff88ce 100644 --- a/README.md +++ b/README.md @@ -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.1108.44](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.1150.38](https://www.nuget.org/packages/Microsoft.Web.WebView2) to embed a web browser. WebView4Delphi was developed and tested on Delphi 11.0, Delphi XE3 and Lazarus 2.2.0/FPC 3.2.2. diff --git a/bin32/WebView2Loader.dll b/bin32/WebView2Loader.dll index 3ebc2c359b426a73d225110f355c3aa941d46e56..f697d8f50297dd1e944d443a4573e97ae4b990b4 100644 GIT binary patch del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zv@K8xN*MN*?vl4OvQ%DOueY(FUH!hH8bNs1u3T{-pPJ7JVg{GpQm0!>8Iog5-VC$s z82>DgF(g|sLMv`ZQ5`=<-SDN!A3sH9d5%JgYsq8nVG-Ri0!=K9cJUXFvlaX#u>)G%>03TgEe*gdg diff --git a/demos/Delphi_VCL/MiniBrowser/MiniBrowser.dpr b/demos/Delphi_VCL/MiniBrowser/MiniBrowser.dpr index 42dbe3c..c06a6f0 100644 --- a/demos/Delphi_VCL/MiniBrowser/MiniBrowser.dpr +++ b/demos/Delphi_VCL/MiniBrowser/MiniBrowser.dpr @@ -3,7 +3,8 @@ program MiniBrowser; uses Vcl.Forms, uMiniBrowser in 'uMiniBrowser.pas' {MiniBrowserFrm}, - uTextViewerForm in 'uTextViewerForm.pas' {TextViewerFrm}; + uTextViewerForm in 'uTextViewerForm.pas' {TextViewerFrm}, + uBasicUserAuthForm in 'uBasicUserAuthForm.pas' {TBasicUserAuthForm}; {$R *.res} diff --git a/demos/Delphi_VCL/MiniBrowser/MiniBrowser.dproj b/demos/Delphi_VCL/MiniBrowser/MiniBrowser.dproj index c7d69b8..0e84606 100644 --- a/demos/Delphi_VCL/MiniBrowser/MiniBrowser.dproj +++ b/demos/Delphi_VCL/MiniBrowser/MiniBrowser.dproj @@ -141,6 +141,10 @@

TextViewerFrm
dfm + +
TBasicUserAuthForm
+ dfm +
Base @@ -163,7 +167,7 @@ - + MiniBrowser.exe true @@ -972,8 +976,8 @@ - + diff --git a/demos/Delphi_VCL/MiniBrowser/uBasicUserAuthForm.dfm b/demos/Delphi_VCL/MiniBrowser/uBasicUserAuthForm.dfm new file mode 100644 index 0000000..34748d1 --- /dev/null +++ b/demos/Delphi_VCL/MiniBrowser/uBasicUserAuthForm.dfm @@ -0,0 +1,110 @@ +object TBasicUserAuthForm: TTBasicUserAuthForm + Left = 0 + Top = 0 + BorderIcons = [biSystemMenu] + BorderStyle = bsSingle + Caption = 'User authentication' + ClientHeight = 195 + ClientWidth = 537 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [] + Position = poScreenCenter + OnClose = FormClose + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + DesignSize = ( + 537 + 195) + TextHeight = 15 + object InfoLbl: TLabel + Left = 40 + Top = 16 + Width = 308 + Height = 15 + Caption = 'Type your username and password for the following page :' + end + object UsernameLbl: TLabel + Left = 40 + Top = 72 + Width = 53 + Height = 15 + Caption = 'Username' + end + object PasswordLbl: TLabel + Left = 40 + Top = 120 + Width = 50 + Height = 15 + Caption = 'Password' + end + object URILbl: TLabel + Left = 40 + Top = 37 + Width = 3 + Height = 15 + end + object ButtonPnl: TPanel + Left = 0 + Top = 160 + Width = 537 + Height = 35 + Align = alBottom + BevelOuter = bvNone + Padding.Left = 40 + Padding.Top = 5 + Padding.Right = 40 + Padding.Bottom = 5 + TabOrder = 2 + ExplicitWidth = 432 + object OkBtn: TButton + Left = 40 + Top = 5 + Width = 120 + Height = 25 + Align = alLeft + Caption = 'Ok' + Enabled = False + ModalResult = 1 + TabOrder = 0 + OnClick = OkBtnClick + ExplicitHeight = 31 + end + object CancelBtn: TButton + Left = 377 + Top = 5 + Width = 120 + Height = 25 + Align = alRight + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 1 + OnClick = CancelBtnClick + ExplicitLeft = 317 + ExplicitHeight = 31 + end + end + object UsernameEdt: TEdit + Left = 120 + Top = 69 + Width = 377 + Height = 23 + Anchors = [akLeft, akTop, akRight] + TabOrder = 0 + OnChange = UsernameEdtChange + end + object PasswordEdt: TEdit + Left = 120 + Top = 117 + Width = 377 + Height = 23 + Anchors = [akLeft, akTop, akRight] + PasswordChar = '*' + TabOrder = 1 + OnChange = UsernameEdtChange + end +end diff --git a/demos/Delphi_VCL/MiniBrowser/uBasicUserAuthForm.pas b/demos/Delphi_VCL/MiniBrowser/uBasicUserAuthForm.pas new file mode 100644 index 0000000..229ec17 --- /dev/null +++ b/demos/Delphi_VCL/MiniBrowser/uBasicUserAuthForm.pas @@ -0,0 +1,97 @@ +unit uBasicUserAuthForm; + +interface + +uses + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, + uWVTypeLibrary, uWVCoreWebView2Args, uWVCoreWebView2Deferral; + +type + TTBasicUserAuthForm = class(TForm) + ButtonPnl: TPanel; + OkBtn: TButton; + CancelBtn: TButton; + InfoLbl: TLabel; + UsernameLbl: TLabel; + PasswordLbl: TLabel; + UsernameEdt: TEdit; + PasswordEdt: TEdit; + URILbl: TLabel; + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormDestroy(Sender: TObject); + procedure OkBtnClick(Sender: TObject); + procedure CancelBtnClick(Sender: TObject); + procedure UsernameEdtChange(Sender: TObject); + procedure FormShow(Sender: TObject); + private + FArgs : TCoreWebView2BasicAuthenticationRequestedEventArgs; + FDeferral : TCoreWebView2Deferral; + FOkPressed : boolean; + public + constructor Create(AOwner: TComponent; const aArgs : ICoreWebView2BasicAuthenticationRequestedEventArgs); reintroduce; + end; + +implementation + +{$R *.dfm} + +uses + uWVCoreWebView2BasicAuthenticationResponse; + +procedure TTBasicUserAuthForm.CancelBtnClick(Sender: TObject); +begin + close; +end; + +constructor TTBasicUserAuthForm.Create(AOwner: TComponent; const aArgs : ICoreWebView2BasicAuthenticationRequestedEventArgs); +begin + inherited Create(AOwner); + + FArgs := TCoreWebView2BasicAuthenticationRequestedEventArgs.Create(aArgs); + FDeferral := TCoreWebView2Deferral.Create(FArgs.Deferral); + FOkPressed := False; +end; + +procedure TTBasicUserAuthForm.FormClose(Sender: TObject; var Action: TCloseAction); +begin + if not(FOkPressed) then + FArgs.Cancel := True; + + Action := TCloseAction.caFree; +end; + +procedure TTBasicUserAuthForm.FormDestroy(Sender: TObject); +begin + if assigned(FDeferral) then + FreeAndNil(FDeferral); + + if assigned(FArgs) then + FreeAndNil(FArgs); +end; + +procedure TTBasicUserAuthForm.FormShow(Sender: TObject); +begin + URILbl.Caption := FArgs.URI; +end; + +procedure TTBasicUserAuthForm.OkBtnClick(Sender: TObject); +var + TempResponse : TCoreWebView2BasicAuthenticationResponse; +begin + FOkPressed := True; + + TempResponse := TCoreWebView2BasicAuthenticationResponse.Create(FArgs.Response); + TempResponse.Username := UsernameEdt.Text; + TempResponse.Password := PasswordEdt.Text; + TempResponse.Free; + + close; +end; + +procedure TTBasicUserAuthForm.UsernameEdtChange(Sender: TObject); +begin + OkBtn.Enabled := (length(UsernameEdt.Text) > 0) and (length(PasswordEdt.Text) > 0); +end; + +end. diff --git a/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.dfm b/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.dfm index 5b381a1..fa7e841 100644 --- a/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.dfm +++ b/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.dfm @@ -143,6 +143,7 @@ object MiniBrowserFrm: TMiniBrowserFrm 'https://html5demos.com/drag/' 'https://frames-per-second.appspot.com/' 'https://badssl.com/' + 'https://www.httpwatch.com/httpgallery/authentication/' 'edge://flags/' 'edge://gpu/' 'edge://about/') @@ -237,6 +238,7 @@ object MiniBrowserFrm: TMiniBrowserFrm OnRetrieveHTMLCompleted = WVBrowser1RetrieveHTMLCompleted OnRetrieveTextCompleted = WVBrowser1RetrieveTextCompleted OnRetrieveMHTMLCompleted = WVBrowser1RetrieveMHTMLCompleted + OnBasicAuthenticationRequested = WVBrowser1BasicAuthenticationRequested Left = 48 Top = 64 end diff --git a/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas b/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas index dc071ab..a5039ab 100644 --- a/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas +++ b/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas @@ -8,7 +8,10 @@ interface WinApi.TlHelp32, Winapi.PsAPI, uWVBrowser, uWVWinControl, uWVWindowParent, uWVTypes, uWVConstants, uWVTypeLibrary, uWVLibFunctions, uWVLoader, uWVInterfaces, uWVCoreWebView2Args, uWVCoreWebView2DownloadOperation, - uWVBrowserBase; + uWVBrowserBase, uBasicUserAuthForm; + +const + PWV_SHOWUSERAUTH = WM_APP + $A50; type TMiniBrowserFrm = class(TForm) @@ -102,6 +105,7 @@ TMiniBrowserFrm = class(TForm) procedure WVBrowser1RetrieveHTMLCompleted(Sender: TObject; aResult: Boolean; const aHTML: wvstring); 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); protected FDownloadOperation : TCoreWebView2DownloadOperation; @@ -110,6 +114,7 @@ TMiniBrowserFrm = class(TForm) FBlockImages : boolean; FGetHeaders : boolean; FHeaders : TStringList; + FUserAuthFrm : TTBasicUserAuthForm; procedure UpdateNavButtons(aIsNavigating : boolean); procedure UpdateDownloadInfo(aDownloadID : integer); @@ -121,6 +126,7 @@ TMiniBrowserFrm = class(TForm) procedure WMMove(var aMessage : TWMMove); message WM_MOVE; procedure WMMoving(var aMessage : TMessage); message WM_MOVING; + procedure ShowUserAuthMsg(var aMessage : TMessage); message PWV_SHOWUSERAUTH; public { Public declarations } end; @@ -287,6 +293,7 @@ procedure TMiniBrowserFrm.FormCreate(Sender: TObject); FGetHeaders := True; FHeaders := TStringList.Create; FFileStream := nil; + FUserAuthFrm := nil; FBlockImages := False; FDownloadIDGen := 0; FDownloadOperation := nil; @@ -437,6 +444,16 @@ procedure TMiniBrowserFrm.WVBrowser1AfterCreated(Sender: TObject); WVBrowser1.AddWebResourceRequestedFilter('*', COREWEBVIEW2_WEB_RESOURCE_CONTEXT_MEDIA); end; +procedure TMiniBrowserFrm.WVBrowser1BasicAuthenticationRequested( + Sender: TObject; const aWebView: ICoreWebView2; + const aArgs: ICoreWebView2BasicAuthenticationRequestedEventArgs); +begin + FUserAuthFrm := TTBasicUserAuthForm.Create(self, aArgs); + // Modal forms and dialogs must be shown outside WebView events + // https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/threading-model + PostMessage(Handle, PWV_SHOWUSERAUTH, 0, 0); +end; + procedure TMiniBrowserFrm.WVBrowser1BytesReceivedChanged(Sender: TObject; const aDownloadOperation: ICoreWebView2DownloadOperation; aDownloadID : integer); begin @@ -732,6 +749,11 @@ procedure TMiniBrowserFrm.WMMoving(var aMessage : TMessage); WVBrowser1.NotifyParentWindowPositionChanged; end; +procedure TMiniBrowserFrm.ShowUserAuthMsg(var aMessage : TMessage); +begin + FUserAuthFrm.ShowModal; +end; + initialization GlobalWebView2Loader := TWVLoader.Create(nil); GlobalWebView2Loader.UserDataFolder := ExtractFileDir(Application.ExeName) + '\CustomCache'; diff --git a/demos/Lazarus/MiniBrowser/MiniBrowser.lps b/demos/Lazarus/MiniBrowser/MiniBrowser.lps index 15f22dc..96da0c4 100644 --- a/demos/Lazarus/MiniBrowser/MiniBrowser.lps +++ b/demos/Lazarus/MiniBrowser/MiniBrowser.lps @@ -4,7 +4,7 @@ - + @@ -19,11 +19,11 @@ - - + + - + @@ -42,11 +42,11 @@ - - - - + + + + @@ -214,13 +214,14 @@ - - - + + + + @@ -265,127 +266,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + diff --git a/demos/Lazarus/MiniBrowser/uBasicUserAuthForm.lfm b/demos/Lazarus/MiniBrowser/uBasicUserAuthForm.lfm new file mode 100644 index 0000000..821f912 --- /dev/null +++ b/demos/Lazarus/MiniBrowser/uBasicUserAuthForm.lfm @@ -0,0 +1,99 @@ +object TBasicUserAuthForm: TTBasicUserAuthForm + Left = 511 + Height = 195 + Top = 254 + Width = 537 + BorderIcons = [biSystemMenu] + BorderStyle = bsSingle + Caption = 'User authentication' + ClientHeight = 195 + ClientWidth = 537 + Color = clBtnFace + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Segoe UI' + OnClose = FormClose + OnDestroy = FormDestroy + OnShow = FormShow + Position = poScreenCenter + LCLVersion = '2.2.0.4' + object InfoLbl: TLabel + Left = 40 + Height = 15 + Top = 16 + Width = 308 + Caption = 'Type your username and password for the following page :' + end + object UsernameLbl: TLabel + Left = 40 + Height = 15 + Top = 72 + Width = 53 + Caption = 'Username' + end + object PasswordLbl: TLabel + Left = 40 + Height = 15 + Top = 120 + Width = 50 + Caption = 'Password' + end + object URILbl: TLabel + Left = 40 + Height = 1 + Top = 37 + Width = 1 + end + object ButtonPnl: TPanel + Left = 0 + Height = 35 + Top = 160 + Width = 537 + Align = alBottom + BevelOuter = bvNone + ClientHeight = 35 + ClientWidth = 537 + TabOrder = 2 + object OkBtn: TButton + Left = 40 + Height = 25 + Top = 5 + Width = 120 + Caption = 'Ok' + Enabled = False + ModalResult = 1 + OnClick = OkBtnClick + TabOrder = 0 + end + object CancelBtn: TButton + Left = 377 + Height = 25 + Top = 5 + Width = 120 + Caption = 'Cancel' + ModalResult = 2 + OnClick = CancelBtnClick + TabOrder = 1 + end + end + object UsernameEdt: TEdit + Left = 120 + Height = 23 + Top = 69 + Width = 377 + Anchors = [akTop, akLeft, akRight] + OnChange = UsernameEdtChange + TabOrder = 0 + end + object PasswordEdt: TEdit + Left = 120 + Height = 23 + Top = 117 + Width = 377 + Anchors = [akTop, akLeft, akRight] + EchoMode = emPassword + OnChange = UsernameEdtChange + PasswordChar = '*' + TabOrder = 1 + end +end diff --git a/demos/Lazarus/MiniBrowser/uBasicUserAuthForm.lrs b/demos/Lazarus/MiniBrowser/uBasicUserAuthForm.lrs new file mode 100644 index 0000000..22ba5ae --- /dev/null +++ b/demos/Lazarus/MiniBrowser/uBasicUserAuthForm.lrs @@ -0,0 +1,30 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TTBasicUserAuthForm','FORMDATA',[ + 'TPF0'#19'TTBasicUserAuthForm'#18'TBasicUserAuthForm'#4'Left'#3#255#1#6'Heigh' + +'t'#3#195#0#3'Top'#3#254#0#5'Width'#3#25#2#11'BorderIcons'#11#12'biSystemMen' + +'u'#0#11'BorderStyle'#7#8'bsSingle'#7'Caption'#6#19'User authentication'#12 + +'ClientHeight'#3#195#0#11'ClientWidth'#3#25#2#5'Color'#7#9'clBtnFace'#10'Fon' + +'t.Color'#7#12'clWindowText'#11'Font.Height'#2#244#9'Font.Name'#6#8'Segoe UI' + +#7'OnClose'#7#9'FormClose'#9'OnDestroy'#7#11'FormDestroy'#6'OnShow'#7#8'Form' + +'Show'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#7'2.2.0.4'#0#6'TLab' + +'el'#7'InfoLbl'#4'Left'#2'('#6'Height'#2#15#3'Top'#2#16#5'Width'#3'4'#1#7'Ca' + +'ption'#6'8Type your username and password for the following page :'#0#0#6'T' + +'Label'#11'UsernameLbl'#4'Left'#2'('#6'Height'#2#15#3'Top'#2'H'#5'Width'#2'5' + +#7'Caption'#6#8'Username'#0#0#6'TLabel'#11'PasswordLbl'#4'Left'#2'('#6'Heigh' + +'t'#2#15#3'Top'#2'x'#5'Width'#2'2'#7'Caption'#6#8'Password'#0#0#6'TLabel'#6 + +'URILbl'#4'Left'#2'('#6'Height'#2#1#3'Top'#2'%'#5'Width'#2#1#0#0#6'TPanel'#9 + +'ButtonPnl'#4'Left'#2#0#6'Height'#2'#'#3'Top'#3#160#0#5'Width'#3#25#2#5'Alig' + +'n'#7#8'alBottom'#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2'#'#11'Client' + +'Width'#3#25#2#8'TabOrder'#2#2#0#7'TButton'#5'OkBtn'#4'Left'#2'('#6'Height'#2 + +#25#3'Top'#2#5#5'Width'#2'x'#7'Caption'#6#2'Ok'#7'Enabled'#8#11'ModalResult' + +#2#1#7'OnClick'#7#10'OkBtnClick'#8'TabOrder'#2#0#0#0#7'TButton'#9'CancelBtn' + +#4'Left'#3'y'#1#6'Height'#2#25#3'Top'#2#5#5'Width'#2'x'#7'Caption'#6#6'Cance' + +'l'#11'ModalResult'#2#2#7'OnClick'#7#14'CancelBtnClick'#8'TabOrder'#2#1#0#0#0 + +#5'TEdit'#11'UsernameEdt'#4'Left'#2'x'#6'Height'#2#23#3'Top'#2'E'#5'Width'#3 + +'y'#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'OnChange'#7#17'Usernam' + +'eEdtChange'#8'TabOrder'#2#0#0#0#5'TEdit'#11'PasswordEdt'#4'Left'#2'x'#6'Hei' + +'ght'#2#23#3'Top'#2'u'#5'Width'#3'y'#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'ak' + +'Right'#0#8'EchoMode'#7#10'emPassword'#8'OnChange'#7#17'UsernameEdtChange'#12 + +'PasswordChar'#6#1'*'#8'TabOrder'#2#1#0#0#0 +]); diff --git a/demos/Lazarus/MiniBrowser/uBasicUserAuthForm.pas b/demos/Lazarus/MiniBrowser/uBasicUserAuthForm.pas new file mode 100644 index 0000000..f919ae8 --- /dev/null +++ b/demos/Lazarus/MiniBrowser/uBasicUserAuthForm.pas @@ -0,0 +1,99 @@ +unit uBasicUserAuthForm; + +{$MODE Delphi} + +interface + +uses + LCLIntf, LCLType, Windows, SysUtils, Variants, Classes, Graphics, + Controls, Forms, Dialogs, StdCtrls, ExtCtrls, + uWVTypeLibrary, uWVCoreWebView2Args, uWVCoreWebView2Deferral; + +type + TTBasicUserAuthForm = class(TForm) + ButtonPnl: TPanel; + OkBtn: TButton; + CancelBtn: TButton; + InfoLbl: TLabel; + UsernameLbl: TLabel; + PasswordLbl: TLabel; + UsernameEdt: TEdit; + PasswordEdt: TEdit; + URILbl: TLabel; + procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure FormDestroy(Sender: TObject); + procedure OkBtnClick(Sender: TObject); + procedure CancelBtnClick(Sender: TObject); + procedure UsernameEdtChange(Sender: TObject); + procedure FormShow(Sender: TObject); + private + FArgs : TCoreWebView2BasicAuthenticationRequestedEventArgs; + FDeferral : TCoreWebView2Deferral; + FOkPressed : boolean; + public + constructor Create(AOwner: TComponent; const aArgs : ICoreWebView2BasicAuthenticationRequestedEventArgs); reintroduce; + end; + +implementation + +{$R *.lfm} + +uses + uWVCoreWebView2BasicAuthenticationResponse; + +procedure TTBasicUserAuthForm.CancelBtnClick(Sender: TObject); +begin + close; +end; + +constructor TTBasicUserAuthForm.Create(AOwner: TComponent; const aArgs : ICoreWebView2BasicAuthenticationRequestedEventArgs); +begin + inherited Create(AOwner); + + FArgs := TCoreWebView2BasicAuthenticationRequestedEventArgs.Create(aArgs); + FDeferral := TCoreWebView2Deferral.Create(FArgs.Deferral); + FOkPressed := False; +end; + +procedure TTBasicUserAuthForm.FormClose(Sender: TObject; var Action: TCloseAction); +begin + if not(FOkPressed) then + FArgs.Cancel := True; + + Action := TCloseAction.caFree; +end; + +procedure TTBasicUserAuthForm.FormDestroy(Sender: TObject); +begin + if assigned(FDeferral) then + FreeAndNil(FDeferral); + + if assigned(FArgs) then + FreeAndNil(FArgs); +end; + +procedure TTBasicUserAuthForm.FormShow(Sender: TObject); +begin + URILbl.Caption := Utf8Encode(FArgs.URI); +end; + +procedure TTBasicUserAuthForm.OkBtnClick(Sender: TObject); +var + TempResponse : TCoreWebView2BasicAuthenticationResponse; +begin + FOkPressed := True; + + TempResponse := TCoreWebView2BasicAuthenticationResponse.Create(FArgs.Response); + TempResponse.Username := Utf8Decode(UsernameEdt.Text); + TempResponse.Password := Utf8Decode(PasswordEdt.Text); + TempResponse.Free; + + close; +end; + +procedure TTBasicUserAuthForm.UsernameEdtChange(Sender: TObject); +begin + OkBtn.Enabled := (length(UsernameEdt.Text) > 0) and (length(PasswordEdt.Text) > 0); +end; + +end. diff --git a/demos/Lazarus/MiniBrowser/uMiniBrowser.lfm b/demos/Lazarus/MiniBrowser/uMiniBrowser.lfm index 3896b79..f7a9e6a 100644 --- a/demos/Lazarus/MiniBrowser/uMiniBrowser.lfm +++ b/demos/Lazarus/MiniBrowser/uMiniBrowser.lfm @@ -133,6 +133,7 @@ object MiniBrowserFrm: TMiniBrowserFrm 'https://html5demos.com/drag/' 'https://frames-per-second.appspot.com/' 'https://badssl.com/' + 'https://www.httpwatch.com/httpgallery/authentication/' 'edge://flags/' 'edge://gpu/' 'edge://about/' @@ -225,6 +226,7 @@ object MiniBrowserFrm: TMiniBrowserFrm OnRetrieveHTMLCompleted = WVBrowser1RetrieveHTMLCompleted OnRetrieveTextCompleted = WVBrowser1RetrieveTextCompleted OnRetrieveMHTMLCompleted = WVBrowser1RetrieveMHTMLCompleted + OnBasicAuthenticationRequested = WVBrowser1BasicAuthenticationRequested Left = 48 Top = 64 end diff --git a/demos/Lazarus/MiniBrowser/uMiniBrowser.pas b/demos/Lazarus/MiniBrowser/uMiniBrowser.pas index 8deaa26..c8a8ffc 100644 --- a/demos/Lazarus/MiniBrowser/uMiniBrowser.pas +++ b/demos/Lazarus/MiniBrowser/uMiniBrowser.pas @@ -9,7 +9,11 @@ interface ActiveX, Controls, Forms, Dialogs, ComCtrls, StdCtrls, ExtCtrls, Menus, jwatlhelp32, jwapsapi, uWVBrowser, uWVWindowParent, uWVTypes, uWVTypeLibrary, uWVLoader, - uWVCoreWebView2Args, uWVCoreWebView2DownloadOperation, uWVBrowserBase, uWVEvents; + uWVCoreWebView2Args, uWVCoreWebView2DownloadOperation, uWVBrowserBase, + uWVEvents, uBasicUserAuthForm; + +const + PWV_SHOWUSERAUTH = WM_APP + $A50; type @@ -92,6 +96,7 @@ TMiniBrowserFrm = class(TForm) procedure Muted1Click(Sender: TObject); procedure WVBrowser1AfterCreated(Sender: TObject); + procedure WVBrowser1BasicAuthenticationRequested(Sender: TObject; const aWebView: ICoreWebView2; const aArgs: ICoreWebView2BasicAuthenticationRequestedEventArgs); procedure WVBrowser1DocumentTitleChanged(Sender: TObject); procedure WVBrowser1InitializationError(Sender: TObject; aErrorCode: HRESULT; const aErrorMessage: wvstring); procedure WVBrowser1PrintToPdfCompleted(Sender: TObject; aErrorCode: HRESULT; aIsSuccessful: Boolean); @@ -114,7 +119,8 @@ TMiniBrowserFrm = class(TForm) FFileStream : TFileStream; FBlockImages : boolean; FGetHeaders : boolean; - FHeaders : TStringList; + FHeaders : TStringList; + FUserAuthFrm : TTBasicUserAuthForm; procedure UpdateNavButtons(aIsNavigating : boolean); procedure UpdateDownloadInfo(aDownloadID : integer); @@ -125,7 +131,8 @@ TMiniBrowserFrm = class(TForm) procedure SaveAsTextFile(const aFileName : string; const aFileContents : wvstring); procedure WMMove(var aMessage : TWMMove); message WM_MOVE; - procedure WMMoving(var aMessage : TMessage); message WM_MOVING; + procedure WMMoving(var aMessage : TMessage); message WM_MOVING; + procedure ShowUserAuthMsg(var aMessage : TMessage); message PWV_SHOWUSERAUTH; public { Public declarations } end; @@ -203,7 +210,8 @@ procedure TMiniBrowserFrm.FormCreate(Sender: TObject); begin FGetHeaders := True; FHeaders := TStringList.Create; - FFileStream := nil; + FFileStream := nil; + FUserAuthFrm := nil; FBlockImages := False; FDownloadIDGen := 0; FDownloadOperation := nil; @@ -424,6 +432,16 @@ procedure TMiniBrowserFrm.WVBrowser1AfterCreated(Sender: TObject); WVBrowser1.AddWebResourceRequestedFilter('*', COREWEBVIEW2_WEB_RESOURCE_CONTEXT_IMAGE); end; +procedure TMiniBrowserFrm.WVBrowser1BasicAuthenticationRequested( + Sender: TObject; const aWebView: ICoreWebView2; + const aArgs: ICoreWebView2BasicAuthenticationRequestedEventArgs); +begin + FUserAuthFrm := TTBasicUserAuthForm.Create(self, aArgs); + // Modal forms and dialogs must be shown outside WebView events + // https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/threading-model + PostMessage(Handle, PWV_SHOWUSERAUTH, 0, 0); +end; + procedure TMiniBrowserFrm.WVBrowser1BytesReceivedChanged(Sender: TObject; const aDownloadOperation: ICoreWebView2DownloadOperation; aDownloadID : integer); begin @@ -745,6 +763,11 @@ procedure TMiniBrowserFrm.WMMoving(var aMessage : TMessage); WVBrowser1.NotifyParentWindowPositionChanged; end; +procedure TMiniBrowserFrm.ShowUserAuthMsg(var aMessage : TMessage); +begin + FUserAuthFrm.ShowModal; +end; + initialization GlobalWebView2Loader := TWVLoader.Create(nil); GlobalWebView2Loader.UserDataFolder := UTF8Decode(ExtractFileDir(Application.ExeName) + '\CustomCache'); diff --git a/packages/WebView4DelphiFMXRTL.dpk b/packages/WebView4DelphiFMXRTL.dpk index e3e2305..97f2ab3 100644 --- a/packages/WebView4DelphiFMXRTL.dpk +++ b/packages/WebView4DelphiFMXRTL.dpk @@ -1,5 +1,4 @@ package WebView4DelphiFMXRTL; - {$R *.res} {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} {$ALIGN 8} @@ -38,4 +37,3 @@ contains uWVFMXWindowParent in '..\source\uWVFMXWindowParent.pas'; end. - diff --git a/packages/WebView4DelphiFMXRTL.dproj b/packages/WebView4DelphiFMXRTL.dproj index f002ec3..9a13fbd 100644 --- a/packages/WebView4DelphiFMXRTL.dproj +++ b/packages/WebView4DelphiFMXRTL.dproj @@ -7,17 +7,47 @@ True Debug Win32 - 1 + 3 Package true + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + true Base true + + true + Base + true + true Base @@ -49,6 +79,31 @@ false true + + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar + + + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar + + + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + iPhoneAndiPad + true + Debug + $(MSBuildProjectName) + + + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSCameraUsageDescription=The reason for accessing the camera;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSMotionUsageDescription=The reason for accessing the accelerometer;NSDesktopFolderUsageDescription=The reason for accessing the Desktop folder;NSDocumentsFolderUsageDescription=The reason for accessing the Documents folder;NSDownloadsFolderUsageDescription=The reason for accessing the Downloads folder;NSNetworkVolumesUsageDescription=The reason for accessing files on a network volume;NSRemovableVolumesUsageDescription=The reason for accessing files on a removable volume;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + Debug + + + CFBundleName=$(MSBuildProjectName);CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);NSHighResolutionCapable=true;LSApplicationCategoryType=public.app-category.utilities;NSLocationUsageDescription=The reason for accessing the location information of the user;NSContactsUsageDescription=The reason for accessing the contacts;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSCameraUsageDescription=The reason for accessing the camera;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSMotionUsageDescription=The reason for accessing the accelerometer;NSDesktopFolderUsageDescription=The reason for accessing the Desktop folder;NSDocumentsFolderUsageDescription=The reason for accessing the Documents folder;NSDownloadsFolderUsageDescription=The reason for accessing the Downloads folder;NSNetworkVolumesUsageDescription=The reason for accessing files on a network volume;NSRemovableVolumesUsageDescription=The reason for accessing files on a removable volume;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + Debug + true Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) @@ -56,6 +111,13 @@ 1033 CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + DEBUG;$(DCC_Define) true @@ -106,7 +168,7 @@ - + true @@ -127,13 +189,13 @@ true - - + + true - - + + true @@ -938,8 +1000,13 @@ + False + False + False + False + False True - False + True 12 diff --git a/packages/WebView4DelphiFMXRTL.res b/packages/WebView4DelphiFMXRTL.res index 8f87691a43466b970b6497e7f13942e67dcdd2ea..2310afdeceb5da8ff6081ae0641f82058220dda7 100644 GIT binary patch delta 12 TcmX@XdV+Ps5hfO91_lNI9H;{r delta 12 TcmX@XdV+Ps5hfN!1_lNI9H0Xh diff --git a/packages/WebView4DelphiVCLRTL.dpk b/packages/WebView4DelphiVCLRTL.dpk index 25a140a..5725132 100644 --- a/packages/WebView4DelphiVCLRTL.dpk +++ b/packages/WebView4DelphiVCLRTL.dpk @@ -1,5 +1,4 @@ package WebView4DelphiVCLRTL; - {$R *.res} {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} {$ALIGN 8} @@ -76,6 +75,7 @@ contains uWVCoreWebView2HttpResponseHeaders in '..\source\uWVCoreWebView2HttpResponseHeaders.pas', uWVBrowserBase in '..\source\uWVBrowserBase.pas', uWVCoreWebView2ProcessInfoCollection in '..\source\uWVCoreWebView2ProcessInfoCollection.pas', - uWVCoreWebView2ProcessInfo in '..\source\uWVCoreWebView2ProcessInfo.pas'; + uWVCoreWebView2ProcessInfo in '..\source\uWVCoreWebView2ProcessInfo.pas', + uWVCoreWebView2BasicAuthenticationResponse in '..\source\uWVCoreWebView2BasicAuthenticationResponse.pas'; end. diff --git a/packages/WebView4DelphiVCLRTL.dproj b/packages/WebView4DelphiVCLRTL.dproj index 965d2de..7f5520b 100644 --- a/packages/WebView4DelphiVCLRTL.dproj +++ b/packages/WebView4DelphiVCLRTL.dproj @@ -95,6 +95,7 @@ + @@ -136,10 +137,9 @@ - - Cfg_2 - Base - + + + Base @@ -147,6 +147,10 @@ Cfg_1 Base + + Cfg_2 + Base + Delphi.Personality.12 @@ -158,181 +162,236 @@ - - + + + WebView4DelphiVCLRTL.bpl true - + true - - + + true - - - WebView4DelphiVCLRTL.bpl + + true - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + + 1 - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 + + 0 - - - - Contents\Resources + + + classes + 64 + + + classes + 64 + + + + + classes 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + + + res\xml 1 - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + + res\xml 1 - - - Contents\MacOS - 0 - - + + + library\lib\armeabi-v7a 1 - + - res\drawable-xxhdpi + library\lib\armeabi + 1 + + + library\lib\armeabi 1 - + + + library\lib\armeabi-v7a + 1 + + + - classes + library\lib\mips + 1 + + + library\lib\mips 1 - + - res\drawable-hdpi + library\lib\armeabi-v7a 1 - res\drawable-hdpi + library\lib\arm64-v8a 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + + + library\lib\armeabi-v7a 1 - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + + + + res\drawable + 1 + + + res\drawable 1 - - - 0 - .dll;.bpl + + + res\values + 1 - + + res\values 1 - .dylib - - + + + res\values-v21 1 - + + res\values-v21 1 - - 0 + + + + res\values + 1 - + + res\values 1 - + + + + res\drawable + 1 + + + res\drawable 1 + + - library\lib\armeabi-v7a + res\drawable-xxhdpi 1 - + + res\drawable-xxhdpi 1 - - + + + res\drawable-xxxhdpi 1 - + + res\drawable-xxxhdpi 1 - - + + + res\drawable-ldpi 1 - + + res\drawable-ldpi 1 - + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + + + res\drawable-hdpi 1 - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + + res\drawable-hdpi 1 - + - res\values-v21 + res\drawable-xhdpi 1 - res\values-v21 + res\drawable-xhdpi 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + + + res\drawable-mdpi 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + + res\drawable-mdpi 1 - + - library\lib\armeabi + res\drawable-hdpi + 1 + + + res\drawable-hdpi 1 @@ -346,31 +405,33 @@ 1 - - - 0 - - + + + res\drawable-xxhdpi 1 - + + res\drawable-xxhdpi 1 - - + + + res\drawable-xxxhdpi 1 - + + res\drawable-xxxhdpi 1 - + + + + res\drawable-small 1 - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + + res\drawable-small 1 @@ -379,36 +440,32 @@ res\drawable-normal 1 - - - + + res\drawable-normal 1 - + + + + res\drawable-large 1 - + + res\drawable-large 1 - - + - library\lib\armeabi-v7a - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + res\drawable-xlarge 1 - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + + res\drawable-xlarge 1 - + res\values 1 @@ -418,115 +475,192 @@ 1 - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + + 1 - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + 0 + - - + + 1 + .framework - + 1 + .framework - + 1 + .framework + + + 0 - - - res\drawable-xxxhdpi + + 1 + .dylib - - res\drawable-xxxhdpi + 1 + .dylib - - - - - res\drawable + 1 + .dylib + + + 0 + .dll;.bpl - - - res\drawable-xxxhdpi + + 1 + .dylib - - res\drawable-xxxhdpi + 1 + .dylib - - 1 + .dylib - + 1 + .dylib - + 1 + .dylib + + + 1 + .dylib + + + 0 + .bpl - + + + 0 + - library\lib\armeabi-v7a + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - res\drawable + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - library\lib\armeabi-v7a + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - res\drawable-mdpi + + + 1 + + + 1 + + 1 - - - res\drawable-xlarge + + + 1 + + + 1 + + 1 - - + + + 1 + + + 1 + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - library\lib\mips + + + 1 + + + 1 + + 1 - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -536,18 +670,23 @@ 1 - - - 0 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 - + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - .framework - - - library\lib\armeabi-v7a + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -561,39 +700,48 @@ 1 - - - 1 - + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - res\xml + + 1 - - res\xml + + 1 + + 1 - - + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 @@ -603,66 +751,69 @@ 1 - - + + 1 1 - + 1 - + + + 1 + - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - res\drawable-xhdpi + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - - res\drawable-large + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - Assets + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - Assets + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - Assets + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - Assets + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - res\drawable-hdpi + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -672,8 +823,7 @@ 1 - - + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 @@ -693,178 +843,145 @@ 1 - - - res\values + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - res\values + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - + - res\values 1 - - - - res\drawable-small + 1 - - - res\drawable-mdpi + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1 - - res\drawable-mdpi + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 1 - + + + + + + + 1 + - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset 1 - - - res\drawable-xxhdpi + + + + + + Contents\Resources 1 - - res\drawable-xxhdpi + + Contents\Resources 1 - - - + + Contents\Resources 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + + + library\lib\armeabi-v7a 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + + library\lib\arm64-v8a 1 - - - - 0 - - - 0 - - - 0 - - 0 - - - 0 - - - 0 + 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset 1 - - - - 0 - .bpl - - + 1 - .dylib 1 - .dylib - + 1 - .dylib - + 1 - .dylib - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 + + 0 - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + + + + library\lib\armeabi-v7a 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + + 1 - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 - - - library\lib\armeabi-v7a + + + Assets 1 - - - - classes - 64 - - - classes - 64 + + Assets + 1 - - - res\drawable-ldpi + + + Assets + 1 + + + Assets 1 - - - - - - + + - + + + + + True diff --git a/packages/WebView4Delphi_designtime.dpk b/packages/WebView4Delphi_designtime.dpk index 83763a6..6b2af8c 100644 --- a/packages/WebView4Delphi_designtime.dpk +++ b/packages/WebView4Delphi_designtime.dpk @@ -1,5 +1,4 @@ package WebView4Delphi_designtime; - {$R *.res} {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} {$ALIGN 8} @@ -25,6 +24,7 @@ package WebView4Delphi_designtime; {$IMAGEBASE $400000} {$DEFINE DEBUG} {$ENDIF IMPLICITBUILDING} +{$DESCRIPTION 'WebView4Delphi'} {$DESIGNONLY} {$IMPLICITBUILD ON} diff --git a/packages/WebView4Delphi_designtime.dproj b/packages/WebView4Delphi_designtime.dproj index 1b32f0c..68e81ef 100644 --- a/packages/WebView4Delphi_designtime.dproj +++ b/packages/WebView4Delphi_designtime.dproj @@ -13,6 +13,21 @@ true + + true + Base + true + + + true + Base + true + + + true + Base + true + true Base @@ -53,6 +68,26 @@ All WebView4Delphi_designtime true + 3082 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + WebView4Delphi + + + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar + + + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar + + + CFBundleName=$(MSBuildProjectName);CFBundleDevelopmentRegion=en;CFBundleDisplayName=$(MSBuildProjectName);CFBundleIdentifier=$(MSBuildProjectName);CFBundleInfoDictionaryVersion=7.1;CFBundleVersion=1.0.0;CFBundleShortVersionString=1.0.0;CFBundlePackageType=APPL;CFBundleSignature=????;LSRequiresIPhoneOS=true;CFBundleAllowMixedLocalizations=YES;CFBundleExecutable=$(MSBuildProjectName);UIDeviceFamily=iPhone & iPad;NSLocationAlwaysUsageDescription=The reason for accessing the location information of the user;NSLocationWhenInUseUsageDescription=The reason for accessing the location information of the user;NSLocationAlwaysAndWhenInUseUsageDescription=The reason for accessing the location information of the user;UIBackgroundModes=;NSContactsUsageDescription=The reason for accessing the contacts;NSPhotoLibraryUsageDescription=The reason for accessing the photo library;NSPhotoLibraryAddUsageDescription=The reason for adding to the photo library;NSCameraUsageDescription=The reason for accessing the camera;NSFaceIDUsageDescription=The reason for accessing the face id;NSMicrophoneUsageDescription=The reason for accessing the microphone;NSSiriUsageDescription=The reason for accessing Siri;ITSAppUsesNonExemptEncryption=false;NSBluetoothAlwaysUsageDescription=The reason for accessing bluetooth;NSBluetoothPeripheralUsageDescription=The reason for accessing bluetooth peripherals;NSCalendarsUsageDescription=The reason for accessing the calendar data;NSRemindersUsageDescription=The reason for accessing the reminders;NSMotionUsageDescription=The reason for accessing the accelerometer;NSSpeechRecognitionUsageDescription=The reason for requesting to send user data to Apple's speech recognition servers + iPhoneAndiPad + true + Debug + $(MSBuildProjectName) Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) @@ -115,9 +150,7 @@ WebView4Delphi_designtime.dpk - - File c:\program files (x86)\embarcadero\studio\22.0\bin\dcledge280.bpl not found - + @@ -952,6 +985,9 @@ + False + False + False True False diff --git a/packages/webview4delphi.lpk b/packages/webview4delphi.lpk index 9369163..66925df 100644 --- a/packages/webview4delphi.lpk +++ b/packages/webview4delphi.lpk @@ -12,8 +12,8 @@ - - + + @@ -188,6 +188,10 @@ + + + + diff --git a/packages/webview4delphi.pas b/packages/webview4delphi.pas index 695ed39..dd32885 100644 --- a/packages/webview4delphi.pas +++ b/packages/webview4delphi.pas @@ -28,7 +28,7 @@ interface uWVEvents, uWVInterfaces, uWVLibFunctions, uWVLoader, uWVMiscFunctions, uWVTypeLibrary, uWVTypes, uWVWinControl, uWVWindowParent, uWVCoreWebView2ProcessInfo, uWVCoreWebView2ProcessInfoCollection, - LazarusPackageIntf; + uWVCoreWebView2BasicAuthenticationResponse, LazarusPackageIntf; implementation diff --git a/source/uWVBrowser.pas b/source/uWVBrowser.pas index fdf6e8e..1ea441d 100644 --- a/source/uWVBrowser.pas +++ b/source/uWVBrowser.pas @@ -107,6 +107,7 @@ TWVBrowser = class(TWVBrowserBase) property OnFrameContentLoading; property OnFrameDOMContentLoaded; property OnFrameWebMessageReceived; + property OnBasicAuthenticationRequested; end; {$IFDEF FPC} diff --git a/source/uWVBrowserBase.pas b/source/uWVBrowserBase.pas index 88ceda4..c9fb99f 100644 --- a/source/uWVBrowserBase.pas +++ b/source/uWVBrowserBase.pas @@ -129,6 +129,7 @@ TWVBrowserBase = class(TComponent, IWVBrowserEvents) FOnFrameContentLoading : TOnFrameContentLoadingEvent; FOnFrameDOMContentLoaded : TOnFrameDOMContentLoadedEvent; FOnFrameWebMessageReceived : TOnFrameWebMessageReceivedEvent; + FOnBasicAuthenticationRequested : TOnBasicAuthenticationRequestedEvent; function GetBrowserProcessID : cardinal; function GetBrowserVersionInfo : wvstring; @@ -289,6 +290,7 @@ TWVBrowserBase = class(TComponent, IWVBrowserEvents) function FrameContentLoadingEventHandler_Invoke(const sender: ICoreWebView2Frame; const args: ICoreWebView2ContentLoadingEventArgs; aFrameID: integer): HRESULT; function FrameDOMContentLoadedEventHandler_Invoke(const sender: ICoreWebView2Frame; const args: ICoreWebView2DOMContentLoadedEventArgs; aFrameID: integer): HRESULT; function FrameWebMessageReceivedEventHandler_Invoke(const sender: ICoreWebView2Frame; const args: ICoreWebView2WebMessageReceivedEventArgs; aFrameID: integer): HRESULT; + function BasicAuthenticationRequestedEventHandler_Invoke(const sender: ICoreWebView2; const args: ICoreWebView2BasicAuthenticationRequestedEventArgs): HRESULT; procedure doOnInitializationError(aErrorCode: HRESULT; const aErrorMessage: wvstring); virtual; procedure doOnEnvironmentCompleted; virtual; @@ -357,6 +359,7 @@ TWVBrowserBase = class(TComponent, IWVBrowserEvents) procedure doOnFrameContentLoadingEvent(const sender: ICoreWebView2Frame; const args: ICoreWebView2ContentLoadingEventArgs; aFrameID: integer); virtual; procedure doOnFrameDOMContentLoadedEvent(const sender: ICoreWebView2Frame; const args: ICoreWebView2DOMContentLoadedEventArgs; aFrameID: integer); virtual; procedure doOnFrameWebMessageReceivedEvent(const sender: ICoreWebView2Frame; const args: ICoreWebView2WebMessageReceivedEventArgs; aFrameID: integer); virtual; + procedure doOnBasicAuthenticationRequestedEvent(const sender: ICoreWebView2; const args: ICoreWebView2BasicAuthenticationRequestedEventArgs); virtual; public constructor Create(AOwner: TComponent); override; @@ -602,6 +605,9 @@ TWVBrowserBase = class(TComponent, IWVBrowserEvents) // ICoreWebView2_9 events property OnIsDefaultDownloadDialogOpenChanged : TOnIsDefaultDownloadDialogOpenChangedEvent read FOnIsDefaultDownloadDialogOpenChanged write FOnIsDefaultDownloadDialogOpenChanged; + // ICoreWebView2_10 events + property OnBasicAuthenticationRequested : TOnBasicAuthenticationRequestedEvent read FOnBasicAuthenticationRequested write FOnBasicAuthenticationRequested; + // ICoreWebView2Controller events property OnAcceleratorKeyPressed : TOnAcceleratorKeyPressedEvent read FOnAcceleratorKeyPressed write FOnAcceleratorKeyPressed; property OnGotFocus : TNotifyEvent read FOnGotFocus write FOnGotFocus; @@ -774,6 +780,7 @@ constructor TWVBrowserBase.Create(AOwner: TComponent); FOnIsMutedChanged := nil; FOnIsDocumentPlayingAudioChanged := nil; FOnIsDefaultDownloadDialogOpenChanged := nil; + FOnBasicAuthenticationRequested := nil; end; destructor TWVBrowserBase.Destroy; @@ -1596,36 +1603,53 @@ procedure TWVBrowserBase.doOnProcessInfosChangedEvent(const sender: ICoreWebView FOnProcessInfosChanged(self, sender); end; -procedure TWVBrowserBase.doOnFrameNavigationStarting2(const sender: ICoreWebView2Frame; const args: ICoreWebView2NavigationStartingEventArgs; aFrameID : integer); +procedure TWVBrowserBase.doOnFrameNavigationStarting2(const sender : ICoreWebView2Frame; + const args : ICoreWebView2NavigationStartingEventArgs; + aFrameID : integer); begin if assigned(FOnFrameNavigationStarting2) then FOnFrameNavigationStarting2(self, sender, args, aFrameID); end; -procedure TWVBrowserBase.doOnFrameNavigationCompleted2(const sender: ICoreWebView2Frame; const args: ICoreWebView2NavigationCompletedEventArgs; aFrameID : integer); +procedure TWVBrowserBase.doOnFrameNavigationCompleted2(const sender : ICoreWebView2Frame; + const args : ICoreWebView2NavigationCompletedEventArgs; + aFrameID : integer); begin if assigned(FOnFrameNavigationCompleted2) then FOnFrameNavigationCompleted2(self, sender, args, aFrameID); end; -procedure TWVBrowserBase.doOnFrameContentLoadingEvent(const sender: ICoreWebView2Frame; const args: ICoreWebView2ContentLoadingEventArgs; aFrameID: integer); +procedure TWVBrowserBase.doOnFrameContentLoadingEvent(const sender : ICoreWebView2Frame; + const args : ICoreWebView2ContentLoadingEventArgs; + aFrameID : integer); begin if assigned(FOnFrameContentLoading) then FOnFrameContentLoading(self, sender, args, aFrameID); end; -procedure TWVBrowserBase.doOnFrameDOMContentLoadedEvent(const sender: ICoreWebView2Frame; const args: ICoreWebView2DOMContentLoadedEventArgs; aFrameID: integer); +procedure TWVBrowserBase.doOnFrameDOMContentLoadedEvent(const sender : ICoreWebView2Frame; + const args : ICoreWebView2DOMContentLoadedEventArgs; + aFrameID : integer); begin if assigned(FOnFrameDOMContentLoaded) then FOnFrameDOMContentLoaded(self, sender, args, aFrameID); end; -procedure TWVBrowserBase.doOnFrameWebMessageReceivedEvent(const sender: ICoreWebView2Frame; const args: ICoreWebView2WebMessageReceivedEventArgs; aFrameID: integer); +procedure TWVBrowserBase.doOnFrameWebMessageReceivedEvent(const sender : ICoreWebView2Frame; + const args : ICoreWebView2WebMessageReceivedEventArgs; + aFrameID : integer); begin if assigned(FOnFrameWebMessageReceived) then FOnFrameWebMessageReceived(self, sender, args, aFrameID); end; +procedure TWVBrowserBase.doOnBasicAuthenticationRequestedEvent(const sender : ICoreWebView2; + const args : ICoreWebView2BasicAuthenticationRequestedEventArgs); +begin + if assigned(FOnBasicAuthenticationRequested) then + FOnBasicAuthenticationRequested(self, sender, args); +end; + procedure TWVBrowserBase.doOnRetrieveMHTMLCompleted(aErrorCode: HRESULT; const aReturnObjectAsJson: wvstring); var TempMHTML : wvstring; @@ -1801,6 +1825,13 @@ function TWVBrowserBase.FrameWebMessageReceivedEventHandler_Invoke(const sender doOnFrameWebMessageReceivedEvent(sender, args, aFrameID); end; +function TWVBrowserBase.BasicAuthenticationRequestedEventHandler_Invoke(const sender : ICoreWebView2; + const args : ICoreWebView2BasicAuthenticationRequestedEventArgs): HRESULT; +begin + Result := S_OK; + doOnBasicAuthenticationRequestedEvent(sender, args); +end; + function TWVBrowserBase.ExecuteScriptCompletedHandler_Invoke(errorCode: HRESULT; resultObjectAsJson: PWideChar; aExecutionID : integer): HRESULT; begin Result := S_OK; diff --git a/source/uWVCoreWebView2.pas b/source/uWVCoreWebView2.pas index 22ed42d..fc2a806 100644 --- a/source/uWVCoreWebView2.pas +++ b/source/uWVCoreWebView2.pas @@ -24,6 +24,7 @@ TCoreWebView2 = class FBaseIntf7 : ICoreWebView2_7; FBaseIntf8 : ICoreWebView2_8; FBaseIntf9 : ICoreWebView2_9; + FBaseIntf10 : ICoreWebView2_10; FContainsFullScreenElementChangedToken : EventRegistrationToken; FContentLoadingToken : EventRegistrationToken; FDocumentTitleChangedToken : EventRegistrationToken; @@ -48,6 +49,7 @@ TCoreWebView2 = class FIsMutedChangedToken : EventRegistrationToken; FIsDocumentPlayingAudioChangedToken : EventRegistrationToken; FIsDefaultDownloadDialogOpenChangedToken : EventRegistrationToken; + FBasicAuthenticationRequestedToken : EventRegistrationToken; FDevToolsEventNames : TStringList; FDevToolsEventTokens : array of EventRegistrationToken; @@ -102,6 +104,7 @@ TCoreWebView2 = class function AddIsMutedChangedEvent(const aBrowserComponent : TComponent) : boolean; function AddIsDocumentPlayingAudioChangedEvent(const aBrowserComponent : TComponent) : boolean; function AddIsDefaultDownloadDialogOpenChangedEvent(const aBrowserComponent : TComponent) : boolean; + function AddBasicAuthenticationRequestedEvent(const aBrowserComponent : TComponent) : boolean; public constructor Create(const aBaseIntf : ICoreWebView2); reintroduce; @@ -176,8 +179,9 @@ constructor TCoreWebView2.Create(const aBaseIntf : ICoreWebView2); succeeded(FBaseIntf.QueryInterface(IID_ICoreWebView2_5, FBaseIntf5)) and succeeded(FBaseIntf.QueryInterface(IID_ICoreWebView2_6, FBaseIntf6)) and succeeded(FBaseIntf.QueryInterface(IID_ICoreWebView2_7, FBaseIntf7)) and - succeeded(FBaseIntf.QueryInterface(IID_ICoreWebView2_8, FBaseIntf8)) then - FBaseIntf.QueryInterface(IID_ICoreWebView2_9, FBaseIntf9); + succeeded(FBaseIntf.QueryInterface(IID_ICoreWebView2_8, FBaseIntf8)) and + succeeded(FBaseIntf.QueryInterface(IID_ICoreWebView2_9, FBaseIntf9)) then + FBaseIntf.QueryInterface(IID_ICoreWebView2_10, FBaseIntf10); end; destructor TCoreWebView2.Destroy; @@ -218,6 +222,7 @@ procedure TCoreWebView2.InitializeFields; FBaseIntf7 := nil; FBaseIntf8 := nil; FBaseIntf9 := nil; + FBaseIntf10 := nil; FDevToolsEventTokens := nil; FDevToolsEventNames := nil; @@ -250,6 +255,7 @@ procedure TCoreWebView2.InitializeTokens; FIsMutedChangedToken.value := 0; FIsDocumentPlayingAudioChangedToken.value := 0; FIsDefaultDownloadDialogOpenChangedToken.value := 0; + FBasicAuthenticationRequestedToken.value := 0; end; function TCoreWebView2.GetInitialized : boolean; @@ -349,6 +355,10 @@ procedure TCoreWebView2.RemoveAllEvents; (FIsDefaultDownloadDialogOpenChangedToken.value <> 0) then FBaseIntf9.remove_IsDefaultDownloadDialogOpenChanged(FIsDefaultDownloadDialogOpenChangedToken); + if assigned(FBaseIntf10) and + (FBasicAuthenticationRequestedToken.Value <> 0) then + FBaseIntf10.remove_BasicAuthenticationRequested(FBasicAuthenticationRequestedToken); + UnsubscribeAllDevToolsProtocolEvents; end; except @@ -720,6 +730,21 @@ function TCoreWebView2.AddIsDefaultDownloadDialogOpenChangedEvent(const aBrowser end; end; +function TCoreWebView2.AddBasicAuthenticationRequestedEvent(const aBrowserComponent : TComponent) : boolean; +var + TempHandler : ICoreWebView2BasicAuthenticationRequestedEventHandler; +begin + Result := False; + + if assigned(FBaseIntf10) and (FBasicAuthenticationRequestedToken.value = 0) then + try + TempHandler := TCoreWebView2BasicAuthenticationRequestedEventHandler.Create(TWVBrowserBase(aBrowserComponent)); + Result := succeeded(FBaseIntf10.add_BasicAuthenticationRequested(TempHandler, FBasicAuthenticationRequestedToken)); + finally + TempHandler := nil; + end; +end; + function TCoreWebView2.AddAllBrowserEvents(const aBrowserComponent : TComponent) : boolean; begin Result := AddNavigationStartingEvent(aBrowserComponent) and @@ -745,7 +770,8 @@ function TCoreWebView2.AddAllBrowserEvents(const aBrowserComponent : TComponent) AddClientCertificateRequestedEvent(aBrowserComponent) and AddIsMutedChangedEvent(aBrowserComponent) and AddIsDocumentPlayingAudioChangedEvent(aBrowserComponent) and - AddIsDefaultDownloadDialogOpenChangedEvent(aBrowserComponent); + AddIsDefaultDownloadDialogOpenChangedEvent(aBrowserComponent) and + AddBasicAuthenticationRequestedEvent(aBrowserComponent); end; function TCoreWebView2.AddWebResourceRequestedFilter(const URI : wvstring; diff --git a/source/uWVCoreWebView2Args.pas b/source/uWVCoreWebView2Args.pas index 53b80fe..c085d6a 100644 --- a/source/uWVCoreWebView2Args.pas +++ b/source/uWVCoreWebView2Args.pas @@ -454,17 +454,41 @@ TCoreWebView2ClientCertificateRequestedEventArgs = class property Deferral : ICoreWebView2Deferral read GetDeferral; end; + TCoreWebView2BasicAuthenticationRequestedEventArgs = class + protected + FBaseIntf : ICoreWebView2BasicAuthenticationRequestedEventArgs; + + function GetInitialized : boolean; + function GetUri : wvstring; + function GetChallenge : wvstring; + function GetResponse : ICoreWebView2BasicAuthenticationResponse; + function GetCancel : boolean; + function GetDeferral : ICoreWebView2Deferral; + + procedure SetCancel(aValue : boolean); + + public + constructor Create(const aArgs: ICoreWebView2BasicAuthenticationRequestedEventArgs); reintroduce; + destructor Destroy; override; + + property Initialized : boolean read GetInitialized; + property BaseIntf : ICoreWebView2BasicAuthenticationRequestedEventArgs read FBaseIntf; + property Uri : wvstring read GetUri; + property Challenge : wvstring read GetChallenge; + property Response : ICoreWebView2BasicAuthenticationResponse read GetResponse; + property Cancel : boolean read GetCancel write SetCancel; + property Deferral : ICoreWebView2Deferral read GetDeferral; + end; + implementation uses {$IFDEF FPC} - ActiveX, + ActiveX; {$ELSE} - Winapi.ActiveX, + Winapi.ActiveX; {$ENDIF} - uWVMiscFunctions; - // TCoreWebView2AcceleratorKeyPressedEventArgs @@ -1885,4 +1909,96 @@ procedure TCoreWebView2ClientCertificateRequestedEventArgs.SetHandled(aValue : b end; +// TCoreWebView2BasicAuthenticationRequestedEventArgs + +constructor TCoreWebView2BasicAuthenticationRequestedEventArgs.Create(const aArgs: ICoreWebView2BasicAuthenticationRequestedEventArgs); +begin + inherited Create; + + FBaseIntf := aArgs; +end; + +destructor TCoreWebView2BasicAuthenticationRequestedEventArgs.Destroy; +begin + FBaseIntf := nil; + + inherited Destroy; +end; + +function TCoreWebView2BasicAuthenticationRequestedEventArgs.GetInitialized : boolean; +begin + Result := assigned(FBaseIntf); +end; + +function TCoreWebView2BasicAuthenticationRequestedEventArgs.GetUri : wvstring; +var + TempString : PWideChar; +begin + Result := ''; + TempString := nil; + + if Initialized and + succeeded(FBaseIntf.Get_uri(TempString)) then + begin + Result := TempString; + CoTaskMemFree(TempString); + end; +end; + +function TCoreWebView2BasicAuthenticationRequestedEventArgs.GetChallenge : wvstring; +var + TempString : PWideChar; +begin + Result := ''; + TempString := nil; + + if Initialized and + succeeded(FBaseIntf.Get_Challenge(TempString)) then + begin + Result := TempString; + CoTaskMemFree(TempString); + end; +end; + +function TCoreWebView2BasicAuthenticationRequestedEventArgs.GetResponse : ICoreWebView2BasicAuthenticationResponse; +var + TempResult : ICoreWebView2BasicAuthenticationResponse; +begin + Result := nil; + TempResult := nil; + + if Initialized and + succeeded(FBaseIntf.Get_Response(TempResult)) and + (TempResult <> nil) then + Result := TempResult; +end; + +function TCoreWebView2BasicAuthenticationRequestedEventArgs.GetCancel : boolean; +var + TempInt : integer; +begin + Result := Initialized and + succeeded(FBaseIntf.Get_Cancel(TempInt)) and + (TempInt <> 0); +end; + +function TCoreWebView2BasicAuthenticationRequestedEventArgs.GetDeferral : ICoreWebView2Deferral; +var + TempResult : ICoreWebView2Deferral; +begin + Result := nil; + TempResult := nil; + + if Initialized and + succeeded(FBaseIntf.GetDeferral(TempResult)) and + (TempResult <> nil) then + Result := TempResult; +end; + +procedure TCoreWebView2BasicAuthenticationRequestedEventArgs.SetCancel(aValue : boolean); +begin + if Initialized then + FBaseIntf.Set_Cancel(ord(aValue)); +end; + end. diff --git a/source/uWVCoreWebView2BasicAuthenticationResponse.pas b/source/uWVCoreWebView2BasicAuthenticationResponse.pas new file mode 100644 index 0000000..84594d6 --- /dev/null +++ b/source/uWVCoreWebView2BasicAuthenticationResponse.pas @@ -0,0 +1,107 @@ +unit uWVCoreWebView2BasicAuthenticationResponse; + +{$IFDEF FPC}{$MODE Delphi}{$ENDIF} + +{$I webview2.inc} + +interface + +uses + uWVTypeLibrary, uWVTypes; + +type + TCoreWebView2BasicAuthenticationResponse = class + protected + FBaseIntf : ICoreWebView2BasicAuthenticationResponse; + + function GetInitialized : boolean; + function GetUserName : wvstring; + function GetPassword : wvstring; + + procedure SetUserName(const aValue : wvstring); + procedure SetPassword(const aValue : wvstring); + + public + constructor Create(const aBaseIntf : ICoreWebView2BasicAuthenticationResponse); reintroduce; + destructor Destroy; override; + + property Initialized : boolean read GetInitialized; + property BaseIntf : ICoreWebView2BasicAuthenticationResponse read FBaseIntf write FBaseIntf; + property UserName : wvstring read GetUserName write SetUserName; + property Password : wvstring read GetPassword write SetPassword; + end; + +implementation + +uses + {$IFDEF FPC} + ActiveX; + {$ELSE} + Winapi.ActiveX; + {$ENDIF} + +constructor TCoreWebView2BasicAuthenticationResponse.Create(const aBaseIntf: ICoreWebView2BasicAuthenticationResponse); +begin + inherited Create; + + FBaseIntf := aBaseIntf; +end; + +destructor TCoreWebView2BasicAuthenticationResponse.Destroy; +begin + FBaseIntf := nil; + + inherited Destroy; +end; + +function TCoreWebView2BasicAuthenticationResponse.GetInitialized : boolean; +begin + Result := assigned(FBaseIntf); +end; + +function TCoreWebView2BasicAuthenticationResponse.GetUserName : wvstring; +var + TempResult : PWideChar; +begin + Result := ''; + TempResult := nil; + + if Initialized and + succeeded(FBaseIntf.Get_UserName(TempResult)) and + (TempResult <> nil) then + begin + Result := TempResult; + CoTaskMemFree(TempResult); + end; +end; + +function TCoreWebView2BasicAuthenticationResponse.GetPassword : wvstring; +var + TempResult : PWideChar; +begin + Result := ''; + TempResult := nil; + + if Initialized and + succeeded(FBaseIntf.Get_Password(TempResult)) and + (TempResult <> nil) then + begin + Result := TempResult; + CoTaskMemFree(TempResult); + end; +end; + +procedure TCoreWebView2BasicAuthenticationResponse.SetUserName(const aValue : wvstring); +begin + if Initialized then + FBaseIntf.Set_UserName(PWideChar(aValue)); +end; + +procedure TCoreWebView2BasicAuthenticationResponse.SetPassword(const aValue : wvstring); +begin + if Initialized then + FBaseIntf.Set_Password(PWideChar(aValue)); +end; + +end. + diff --git a/source/uWVCoreWebView2Delegates.pas b/source/uWVCoreWebView2Delegates.pas index a2b234a..0b730a5 100644 --- a/source/uWVCoreWebView2Delegates.pas +++ b/source/uWVCoreWebView2Delegates.pas @@ -657,6 +657,17 @@ TCoreWebView2FrameWebMessageReceivedEventHandler = class(TInterfacedObject, IC destructor Destroy; override; end; + TCoreWebView2BasicAuthenticationRequestedEventHandler = class(TInterfacedObject, ICoreWebView2BasicAuthenticationRequestedEventHandler) + protected + FEvents : Pointer; + + function Invoke(const sender: ICoreWebView2; const args: ICoreWebView2BasicAuthenticationRequestedEventArgs): HResult; stdcall; + + public + constructor Create(const aEvents: IWVBrowserEvents); reintroduce; + destructor Destroy; override; + end; + implementation @@ -2128,5 +2139,30 @@ function TCoreWebView2FrameWebMessageReceivedEventHandler.Invoke(const sender : end; +// TCoreWebView2BasicAuthenticationRequestedEventHandler + +constructor TCoreWebView2BasicAuthenticationRequestedEventHandler.Create(const aEvents: IWVBrowserEvents); +begin + inherited Create; + + FEvents := Pointer(aEvents); +end; + +destructor TCoreWebView2BasicAuthenticationRequestedEventHandler.Destroy; +begin + FEvents := nil; + + inherited Destroy; +end; + +function TCoreWebView2BasicAuthenticationRequestedEventHandler.Invoke(const sender : ICoreWebView2; + const args : ICoreWebView2BasicAuthenticationRequestedEventArgs): HResult; stdcall; +begin + if (FEvents <> nil) then + Result := IWVBrowserEvents(FEvents).BasicAuthenticationRequestedEventHandler_Invoke(sender, args) + else + Result := E_FAIL; +end; + end. diff --git a/source/uWVEvents.pas b/source/uWVEvents.pas index c7ff186..5adc87a 100644 --- a/source/uWVEvents.pas +++ b/source/uWVEvents.pas @@ -67,11 +67,12 @@ interface TOnIsDocumentPlayingAudioChangedEvent = procedure(Sender: TObject; const aWebView: ICoreWebView2) of object; TOnIsDefaultDownloadDialogOpenChangedEvent = procedure(Sender: TObject; const aWebView: ICoreWebView2) of object; TOnProcessInfosChangedEvent = procedure(Sender: TObject; const aEnvironment: ICoreWebView2Environment) of object; - TOnFrameNavigationStartingEvent = procedure(Sender: TObject; const aWebView: ICoreWebView2Frame; const aArgs: ICoreWebView2NavigationStartingEventArgs; aFrameID: integer) of object; - TOnFrameNavigationCompletedEvent = procedure(Sender: TObject; const aWebView: ICoreWebView2Frame; const aArgs: ICoreWebView2NavigationCompletedEventArgs; aFrameID: integer) of object; - TOnFrameContentLoadingEvent = procedure(Sender: TObject; const aWebView: ICoreWebView2Frame; const aArgs: ICoreWebView2ContentLoadingEventArgs; aFrameID: integer) of object; - TOnFrameDOMContentLoadedEvent = procedure(Sender: TObject; const aWebView: ICoreWebView2Frame; const aArgs: ICoreWebView2DOMContentLoadedEventArgs; aFrameID: integer) of object; - TOnFrameWebMessageReceivedEvent = procedure(Sender: TObject; const aWebView: ICoreWebView2Frame; const aArgs: ICoreWebView2WebMessageReceivedEventArgs; aFrameID: integer) of object; + TOnFrameNavigationStartingEvent = procedure(Sender: TObject; const aFrame: ICoreWebView2Frame; const aArgs: ICoreWebView2NavigationStartingEventArgs; aFrameID: integer) of object; + TOnFrameNavigationCompletedEvent = procedure(Sender: TObject; const aFrame: ICoreWebView2Frame; const aArgs: ICoreWebView2NavigationCompletedEventArgs; aFrameID: integer) of object; + TOnFrameContentLoadingEvent = procedure(Sender: TObject; const aFrame: ICoreWebView2Frame; const aArgs: ICoreWebView2ContentLoadingEventArgs; aFrameID: integer) of object; + TOnFrameDOMContentLoadedEvent = procedure(Sender: TObject; const aFrame: ICoreWebView2Frame; const aArgs: ICoreWebView2DOMContentLoadedEventArgs; aFrameID: integer) of object; + TOnFrameWebMessageReceivedEvent = procedure(Sender: TObject; const aFrame: ICoreWebView2Frame; const aArgs: ICoreWebView2WebMessageReceivedEventArgs; aFrameID: integer) of object; + TOnBasicAuthenticationRequestedEvent = procedure(Sender: TObject; const aWebView: ICoreWebView2; const aArgs: ICoreWebView2BasicAuthenticationRequestedEventArgs) of object; // Custom events TOnCompMsgEvent = procedure(Sender: TObject; var aMessage: TMessage; var aHandled: Boolean) of object; diff --git a/source/uWVFMXBrowser.pas b/source/uWVFMXBrowser.pas index f09991a..e4d0c3b 100644 --- a/source/uWVFMXBrowser.pas +++ b/source/uWVFMXBrowser.pas @@ -105,6 +105,7 @@ TWVFMXBrowser = class(TWVBrowserBase) property OnFrameContentLoading; property OnFrameDOMContentLoaded; property OnFrameWebMessageReceived; + property OnBasicAuthenticationRequested; end; implementation diff --git a/source/uWVInterfaces.pas b/source/uWVInterfaces.pas index 410396d..b954ee3 100644 --- a/source/uWVInterfaces.pas +++ b/source/uWVInterfaces.pas @@ -196,6 +196,9 @@ interface // ICoreWebView2FrameWebMessageReceivedEventHandler function FrameWebMessageReceivedEventHandler_Invoke(const sender: ICoreWebView2Frame; const args: ICoreWebView2WebMessageReceivedEventArgs; aFrameID: integer): HResult; + + // ICoreWebView2BasicAuthenticationRequestedEventHandler + function BasicAuthenticationRequestedEventHandler_Invoke(const sender: ICoreWebView2; const args: ICoreWebView2BasicAuthenticationRequestedEventArgs): HResult; end; implementation diff --git a/source/uWVMiscFunctions.pas b/source/uWVMiscFunctions.pas index 7997263..b70c390 100644 --- a/source/uWVMiscFunctions.pas +++ b/source/uWVMiscFunctions.pas @@ -29,6 +29,7 @@ function SystemCursorIDToDelphiCursor(aSystemCursorID : cardinal) : TCursor; procedure OutputDebugMessage(const aMessage : string); function CustomExceptionHandler(const aFunctionName : string; const aException : exception) : boolean; +procedure LogMouseEvent(aEventKind : TWVMouseEventKind; aVirtualKeys : TWVMouseEventVirtualKeys; aMouseData : cardinal; aPoint : TPoint); function CoreWebViewColorToDelphiColor(const aColor : COREWEBVIEW2_COLOR) : TColor; function DelphiColorToCoreWebViewColor(const aColor : TColor) : COREWEBVIEW2_COLOR; @@ -167,6 +168,14 @@ function CustomExceptionHandler(const aFunctionName : string; const aException : Result := (GlobalWebView2Loader <> nil) and GlobalWebView2Loader.ReRaiseExceptions; end; +procedure LogMouseEvent(aEventKind : TWVMouseEventKind; aVirtualKeys : TWVMouseEventVirtualKeys; aMouseData : cardinal; aPoint : TPoint); +begin + OutputDebugMessage('aEventKind: $' + IntToHex(integer(aEventKind), 4) + ', ' + + 'aVirtualKeys: $' + IntToHex(Integer(aVirtualKeys), 2) + ', ' + + 'aMouseData: ' + IntToStr(integer(aMouseData)) + ', ' + + 'aPoint: (' + IntToStr(aPoint.x) + ',' + IntToStr(aPoint.y) + ')'); +end; + // Basic ISO8601ToDate alternative written by David Heffernan // https://stackoverflow.com/questions/24108718/is-there-a-delphi-rtl-function-that-can-convert-the-iso-8601-basic-date-format-t // Use ISO8601ToDate in Delphi XE6 or later versions. diff --git a/source/uWVTypeLibrary.pas b/source/uWVTypeLibrary.pas index 22e5579..928e502 100644 --- a/source/uWVTypeLibrary.pas +++ b/source/uWVTypeLibrary.pas @@ -28,10 +28,10 @@ // ************************************************************************ // // $Rev: 98336 $ -// File generated on 08/02/2022 10:58:57 from Type Library described below. +// File generated on 11/03/2022 15:10:52 from Type Library described below. // ************************************************************************ // -// Type Lib: Z:\microsoft.web.webview2.1.0.1108.44.nupkg_FILES\WebView2.tlb (1) +// Type Lib: Z:\microsoft.web.webview2.1.0.1150.38.nupkg_FILES\WebView2.tlb (1) // LIBID: {26D34152-879F-4065-BEA2-3DAA2CFADFB8} // LCID: 0 // Helpfile: @@ -165,6 +165,10 @@ interface IID_ICoreWebView2IsDocumentPlayingAudioChangedEventHandler: TGUID = '{5DEF109A-2F4B-49FA-B7F6-11C39E513328}'; IID_ICoreWebView2_9: TGUID = '{4D7B2EAB-9FDC-468D-B998-A9260B5ED651}'; IID_ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler: TGUID = '{3117DA26-AE13-438D-BD46-EDBEB2C4CE81}'; + IID_ICoreWebView2_10: TGUID = '{B1690564-6F5A-4983-8E48-31D1143FECDB}'; + IID_ICoreWebView2BasicAuthenticationRequestedEventHandler: TGUID = '{58B4D6C2-18D4-497E-B39B-9A96533FA278}'; + IID_ICoreWebView2BasicAuthenticationRequestedEventArgs: TGUID = '{EF05516F-D897-4F9E-B672-D8E2307A3FB0}'; + IID_ICoreWebView2BasicAuthenticationResponse: TGUID = '{07023F7D-2D77-4D67-9040-6E7D428C6A40}'; IID_ICoreWebView2BrowserProcessExitedEventArgs: TGUID = '{1F00663F-AF8C-4782-9CDD-DD01C52E34CB}'; IID_ICoreWebView2BrowserProcessExitedEventHandler: TGUID = '{FA504257-A216-4911-A860-FE8825712861}'; IID_ICoreWebView2CompositionController: TGUID = '{3DF9B733-B9AE-4A15-86B4-EB9EE9826469}'; @@ -582,6 +586,10 @@ interface ICoreWebView2IsDocumentPlayingAudioChangedEventHandler = interface; ICoreWebView2_9 = interface; ICoreWebView2IsDefaultDownloadDialogOpenChangedEventHandler = interface; + ICoreWebView2_10 = interface; + ICoreWebView2BasicAuthenticationRequestedEventHandler = interface; + ICoreWebView2BasicAuthenticationRequestedEventArgs = interface; + ICoreWebView2BasicAuthenticationResponse = interface; ICoreWebView2BrowserProcessExitedEventArgs = interface; ICoreWebView2BrowserProcessExitedEventHandler = interface; ICoreWebView2CompositionController = interface; @@ -1992,6 +2000,57 @@ COREWEBVIEW2_COLOR = record function Invoke(const sender: ICoreWebView2; const args: IUnknown): HResult; stdcall; end; +// *********************************************************************// +// Interface: ICoreWebView2_10 +// Flags: (0) +// GUID: {B1690564-6F5A-4983-8E48-31D1143FECDB} +// *********************************************************************// + ICoreWebView2_10 = interface(ICoreWebView2_9) + ['{B1690564-6F5A-4983-8E48-31D1143FECDB}'] + function add_BasicAuthenticationRequested(const eventHandler: ICoreWebView2BasicAuthenticationRequestedEventHandler; + out token: EventRegistrationToken): HResult; stdcall; + function remove_BasicAuthenticationRequested(token: EventRegistrationToken): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: ICoreWebView2BasicAuthenticationRequestedEventHandler +// Flags: (0) +// GUID: {58B4D6C2-18D4-497E-B39B-9A96533FA278} +// *********************************************************************// + ICoreWebView2BasicAuthenticationRequestedEventHandler = interface(IUnknown) + ['{58B4D6C2-18D4-497E-B39B-9A96533FA278}'] + function Invoke(const sender: ICoreWebView2; + const args: ICoreWebView2BasicAuthenticationRequestedEventArgs): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: ICoreWebView2BasicAuthenticationRequestedEventArgs +// Flags: (0) +// GUID: {EF05516F-D897-4F9E-B672-D8E2307A3FB0} +// *********************************************************************// + ICoreWebView2BasicAuthenticationRequestedEventArgs = interface(IUnknown) + ['{EF05516F-D897-4F9E-B672-D8E2307A3FB0}'] + function Get_uri(out value: PWideChar): HResult; stdcall; + function Get_Challenge(out Challenge: PWideChar): HResult; stdcall; + function Get_Response(out Response: ICoreWebView2BasicAuthenticationResponse): HResult; stdcall; + function Get_Cancel(out Cancel: Integer): HResult; stdcall; + function Set_Cancel(Cancel: Integer): HResult; stdcall; + function GetDeferral(out deferral: ICoreWebView2Deferral): HResult; stdcall; + end; + +// *********************************************************************// +// Interface: ICoreWebView2BasicAuthenticationResponse +// Flags: (0) +// GUID: {07023F7D-2D77-4D67-9040-6E7D428C6A40} +// *********************************************************************// + ICoreWebView2BasicAuthenticationResponse = interface(IUnknown) + ['{07023F7D-2D77-4D67-9040-6E7D428C6A40}'] + function Get_UserName(out UserName: PWideChar): HResult; stdcall; + function Set_UserName(UserName: PWideChar): HResult; stdcall; + function Get_Password(out Password: PWideChar): HResult; stdcall; + function Set_Password(Password: PWideChar): HResult; stdcall; + end; + // *********************************************************************// // Interface: ICoreWebView2BrowserProcessExitedEventArgs // Flags: (0) diff --git a/update_WebView4Delphi.json b/update_WebView4Delphi.json index 068d904..db202a5 100644 --- a/update_WebView4Delphi.json +++ b/update_WebView4Delphi.json @@ -2,9 +2,9 @@ "UpdateLazPackages" : [ { "ForceNotify" : true, - "InternalVersion" : 44, + "InternalVersion" : 45, "Name" : "webview4delphi.lpk", - "Version" : "1.0.1108.44" + "Version" : "1.0.1150.38" } ], "UpdatePackageData" : {