2017-08-19 12:53:47 +02:00
// ************************************************************************
// ***************************** CEF4Delphi *******************************
// ************************************************************************
//
2019-10-19 10:58:34 +02:00
// CEF4Delphi is based on DCEF3 which uses CEF to embed a chromium-based
2017-08-19 12:53:47 +02:00
// browser in Delphi applications.
//
// The original license of DCEF3 still applies to CEF4Delphi.
//
// For more information about CEF4Delphi visit :
// https://www.briskbard.com/index.php?lang=en&pageid=cef
//
2023-01-07 15:53:04 +01:00
// Copyright <20> 2023 Salvador Diaz Fau. All rights reserved.
2017-08-19 12:53:47 +02:00
//
// ************************************************************************
// ************ vvvv Original license and comments below vvvv *************
// ************************************************************************
( *
* Delphi Chromium Embedded 3
*
* Usage allowed under the restrictions of the Lesser GNU General Public License
* or alternatively the restrictions of the Mozilla Public License 1.1
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
*
* Unit owner : Henri Gourvest < hgourvest@ gmail. com>
* Web site : http: //www.progdigy.com
* Repository : http: //code.google.com/p/delphichromiumembedded/
* Group : http: //groups.google.com/group/delphichromiumembedded
*
* Embarcadero Technologies, Inc is not permitted to use or redistribute
* this source code without explicit permission.
*
* )
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
unit uCookieVisitor;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
{$I cef.inc}
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
interface
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
uses
{$IFDEF DELPHI16_UP}
Winapi . Windows, Winapi . Messages, System. SysUtils, System. Variants, System. Classes, Vcl. Graphics,
2019-12-03 12:12:19 +01:00
Vcl. Controls, Vcl. Forms, Vcl. Dialogs, Vcl. StdCtrls, Vcl. ExtCtrls, System. StrUtils,
2017-08-19 12:53:47 +02:00
{$ELSE}
Windows, Messages, SysUtils, Variants, Classes, Graphics,
2019-12-03 12:12:19 +01:00
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, StrUtils,
2017-08-19 12:53:47 +02:00
{$ENDIF}
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes, uCEFConstants,
2019-12-03 12:12:19 +01:00
uCEFCookieManager, uCEFCookieVisitor, uCEFWinControl, uCEFSentinel,
uCEFChromiumCore;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
const
2019-10-29 16:13:35 +01:00
MINIBROWSER_SHOWCOOKIES = WM_APP + $101 ;
MINIBROWSER_COOKIESDELETED = WM_APP + $102 ;
MINIBROWSER_COOKIESET = WM_APP + $103 ;
MINIBROWSER_CONTEXTMENU_DELETECOOKIES = MENU_ID_USER_FIRST + 1 ;
MINIBROWSER_CONTEXTMENU_GETCOOKIES = MENU_ID_USER_FIRST + 2 ;
MINIBROWSER_CONTEXTMENU_SETCOOKIE = MENU_ID_USER_FIRST + 3 ;
MINIBROWSER_CONTEXTMENU_GETGOOGLECOOKIES = MENU_ID_USER_FIRST + 4 ;
2020-06-24 12:29:13 +02:00
MINIBROWSER_CONTEXTMENU_DELETECACHE = MENU_ID_USER_FIRST + 5 ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
type
TCookieVisitorFrm = class( TForm)
AddressBarPnl: TPanel;
Edit1: TEdit;
GoBtn: TButton;
CEFWindowParent1: TCEFWindowParent;
Chromium1: TChromium;
2017-11-04 18:32:29 +01:00
Timer1: TTimer;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
procedure Chromium1AfterCreated( Sender: TObject; const browser: ICefBrowser) ;
2021-02-27 12:55:29 +01:00
procedure Chromium1BeforeContextMenu( Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel) ;
procedure Chromium1ContextMenuCommand( Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer ; eventFlags: Cardinal ; out Result : Boolean ) ;
procedure Chromium1CookiesDeleted( Sender: TObject; numDeleted: Integer ) ;
procedure Chromium1BeforePopup( Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean ; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean ; var Result : Boolean ) ;
procedure Chromium1Close( Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction) ;
procedure Chromium1BeforeClose( Sender: TObject; const browser: ICefBrowser) ;
procedure Chromium1CookieSet( Sender: TObject; aSuccess: Boolean ; aID: Integer ) ;
procedure Chromium1CookieVisitorDestroyed( Sender: TObject; aID: Integer ) ;
procedure Chromium1CookiesVisited( Sender: TObject; const name_, value, domain, path: ustring; secure, httponly, hasExpires: Boolean ; const creation, lastAccess, expires: TDateTime; count, total, aID: Integer ; same_site: TCefCookieSameSite; priority: Integer ; var aDeleteCookie, aResult: Boolean ) ;
2017-08-19 12:53:47 +02:00
procedure GoBtnClick( Sender: TObject) ;
2017-11-04 18:32:29 +01:00
procedure Timer1Timer( Sender: TObject) ;
2021-02-27 12:55:29 +01:00
procedure FormShow( Sender: TObject) ;
procedure FormCreate( Sender: TObject) ;
2018-03-31 18:08:18 +02:00
procedure FormCloseQuery( Sender: TObject; var CanClose: Boolean ) ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
private
procedure WMMove( var aMessage : TWMMove) ; message WM_MOVE;
procedure WMMoving( var aMessage : TMessage) ; message WM_MOVING;
2017-12-18 19:38:56 +01:00
procedure WMEnterMenuLoop( var aMessage: TMessage) ; message WM_ENTERMENULOOP;
procedure WMExitMenuLoop( var aMessage: TMessage) ; message WM_EXITMENULOOP;
2017-09-07 10:58:09 +02:00
procedure BrowserCreatedMsg( var aMessage : TMessage) ; message CEF_AFTERCREATED;
2018-03-31 18:08:18 +02:00
procedure BrowserDestroyMsg( var aMessage : TMessage) ; message CEF_DESTROY;
2017-08-19 12:53:47 +02:00
procedure ShowCookiesMsg( var aMessage : TMessage) ; message MINIBROWSER_SHOWCOOKIES;
2019-10-29 16:13:35 +01:00
procedure CookiesDeletedMsg( var aMessage : TMessage) ; message MINIBROWSER_COOKIESDELETED;
procedure CookieSetMsg( var aMessage : TMessage) ; message MINIBROWSER_COOKIESET;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
protected
2018-03-31 18:08:18 +02:00
FText : string ;
// Variables to control when can we destroy the form safely
FCanClose : boolean ; // Set to True in TChromium.OnBeforeClose
FClosing : boolean ; // Set to True in the CloseQuery event.
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
public
procedure AddCookieInfo( const aCookie : TCookie) ;
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
var
CookieVisitorFrm: TCookieVisitorFrm;
2021-09-05 10:49:20 +02:00
2019-08-01 18:20:42 +02:00
procedure CreateGlobalCEFApp;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
implementation
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
{$R *.dfm}
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
uses
2020-06-24 12:29:13 +02:00
uSimpleTextViewer, uCEFTask, uCEFMiscFunctions, uCEFDictionaryValue;
2021-09-05 10:49:20 +02:00
2019-10-29 16:13:35 +01:00
// This demo has a context menu to test several TChromium functions related to cookies like TChromium.VisitAllCookies,
// TChromium.SetCookie, TChromium.DeleteCookies, etc.
// TChromium.VisitAllCookies and TChromium.VisitURLCookies trigger the TChromium.OnCookiesVisited event for each
// cookie and it'll save the information using the AddCookieInfo function.
2017-08-19 12:53:47 +02:00
// When the last cookie arrives we show the information in a SimpleTextViewer form.
2019-10-29 16:13:35 +01:00
// TChromium.SetCookie triggers TChromium.OnCookieSet when it has set the cookie.
// TChromium.DeleteCookies triggers TChromium.OnCookiesDeleted when the cookies have been deleted.
2018-03-31 18:08:18 +02:00
// Destruction steps
// =================
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
2020-01-01 12:48:10 +01:00
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
2021-09-05 10:49:20 +02:00
2019-08-01 18:20:42 +02:00
procedure CreateGlobalCEFApp;
begin
GlobalCEFApp : = TCefApplication. Create;
2021-02-27 12:55:29 +01:00
//GlobalCEFApp.cache := 'cache';
2019-08-01 18:20:42 +02:00
//GlobalCEFApp.LogFile := 'cef.log';
//GlobalCEFApp.LogSeverity := LOGSEVERITY_VERBOSE;
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
procedure TCookieVisitorFrm. AddCookieInfo( const aCookie : TCookie) ;
begin
// This should be protected by a mutex.
2019-11-03 11:17:09 +01:00
FText : = FText + aCookie. name + ' : ' + aCookie. value + ' (' + aCookie. domain + ')' + #13 + #10 ;
2017-08-19 12:53:47 +02:00
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
procedure TCookieVisitorFrm. BrowserCreatedMsg( var aMessage : TMessage) ;
begin
2017-08-23 12:28:45 +02:00
CEFWindowParent1. UpdateSize;
2017-08-19 12:53:47 +02:00
AddressBarPnl. Enabled : = True ;
end ;
2021-09-05 10:49:20 +02:00
2018-03-31 18:08:18 +02:00
procedure TCookieVisitorFrm. BrowserDestroyMsg( var aMessage : TMessage) ;
begin
CEFWindowParent1. Free;
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
procedure TCookieVisitorFrm. ShowCookiesMsg( var aMessage : TMessage) ;
begin
2017-08-22 18:35:04 +02:00
SimpleTextViewerFrm. Memo1. Lines. Text : = FText; // This should be protected by a mutex.
2017-08-19 12:53:47 +02:00
SimpleTextViewerFrm. ShowModal;
end ;
2021-09-05 10:49:20 +02:00
2019-10-29 16:13:35 +01:00
procedure TCookieVisitorFrm. CookiesDeletedMsg( var aMessage : TMessage) ;
begin
showmessage( 'Deleted cookies : ' + inttostr( aMessage. lParam) ) ;
end ;
2021-09-05 10:49:20 +02:00
2019-10-29 16:13:35 +01:00
procedure TCookieVisitorFrm. CookieSetMsg( var aMessage : TMessage) ;
2018-10-21 20:32:35 +02:00
begin
2021-02-27 12:55:29 +01:00
Chromium1. FlushCookieStore;
2021-09-05 10:49:20 +02:00
2019-10-29 16:13:35 +01:00
if ( aMessage. wParam < > 0 ) then
showmessage( 'Cookie set successfully !' )
2018-10-21 20:32:35 +02:00
else
2019-10-29 16:13:35 +01:00
showmessage( 'There was a problem setting the cookie' ) ;
2018-10-21 20:32:35 +02:00
end ;
2021-09-05 10:49:20 +02:00
2017-11-04 18:32:29 +01:00
procedure TCookieVisitorFrm. Timer1Timer( Sender: TObject) ;
begin
Timer1. Enabled : = False ;
2021-09-05 10:49:20 +02:00
2017-11-16 12:49:15 +01:00
if not( Chromium1. CreateBrowser( CEFWindowParent1, '' ) ) and not( Chromium1. Initialized) then
Timer1. Enabled : = True ;
2017-11-04 18:32:29 +01:00
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
procedure TCookieVisitorFrm. GoBtnClick( Sender: TObject) ;
begin
Chromium1. LoadURL( Edit1. Text ) ;
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
procedure TCookieVisitorFrm. Chromium1AfterCreated( Sender: TObject; const browser: ICefBrowser) ;
begin
2017-09-07 10:58:09 +02:00
PostMessage( Handle, CEF_AFTERCREATED, 0 , 0 ) ;
2017-08-19 12:53:47 +02:00
end ;
2021-09-05 10:49:20 +02:00
2018-03-31 18:08:18 +02:00
procedure TCookieVisitorFrm. Chromium1BeforeClose( Sender: TObject; const browser: ICefBrowser) ;
begin
2020-01-01 12:48:10 +01:00
FCanClose : = True ;
PostMessage( Handle, WM_CLOSE, 0 , 0 ) ;
2018-03-31 18:08:18 +02:00
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
procedure TCookieVisitorFrm. Chromium1BeforeContextMenu( Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const params: ICefContextMenuParams; const model: ICefMenuModel) ;
begin
model. AddSeparator;
2019-10-29 16:13:35 +01:00
model. AddItem( MINIBROWSER_CONTEXTMENU_DELETECOOKIES, 'Delete cookies' ) ;
2017-08-19 12:53:47 +02:00
model. AddSeparator;
2019-10-29 16:13:35 +01:00
model. AddItem( MINIBROWSER_CONTEXTMENU_GETCOOKIES, 'Visit all cookies' ) ;
model. AddItem( MINIBROWSER_CONTEXTMENU_GETGOOGLECOOKIES, 'Visit cookies from Google' ) ;
model. AddItem( MINIBROWSER_CONTEXTMENU_SETCOOKIE, 'Set cookie' ) ;
2020-06-24 12:29:13 +02:00
model. AddItem( MINIBROWSER_CONTEXTMENU_DELETECACHE, 'Delete cache' ) ;
2017-08-19 12:53:47 +02:00
end ;
2021-09-05 10:49:20 +02:00
2018-02-16 18:41:13 +01:00
procedure TCookieVisitorFrm. Chromium1BeforePopup( Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame; const targetUrl,
targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition;
2018-03-29 20:02:04 +02:00
userGesture: Boolean ; const popupFeatures: TCefPopupFeatures;
2018-02-16 18:41:13 +01:00
var windowInfo: TCefWindowInfo; var client: ICefClient;
2019-06-16 10:31:13 +02:00
var settings: TCefBrowserSettings;
var extra_info: ICefDictionaryValue;
var noJavascriptAccess: Boolean ;
2018-03-29 20:02:04 +02:00
var Result : Boolean ) ;
2018-02-16 18:41:13 +01:00
begin
// For simplicity, this demo blocks all popup windows and new tabs
Result : = ( targetDisposition in [ WOD_NEW_FOREGROUND_TAB, WOD_NEW_BACKGROUND_TAB, WOD_NEW_POPUP, WOD_NEW_WINDOW] ) ;
end ;
2021-09-05 10:49:20 +02:00
2018-03-31 18:08:18 +02:00
procedure TCookieVisitorFrm. Chromium1Close( Sender: TObject;
2019-03-28 10:40:36 +01:00
const browser: ICefBrowser; var aAction : TCefCloseBrowserAction) ;
2018-03-31 18:08:18 +02:00
begin
PostMessage( Handle, CEF_DESTROY, 0 , 0 ) ;
2019-03-28 10:40:36 +01:00
aAction : = cbaDelay;
2018-03-31 18:08:18 +02:00
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
procedure TCookieVisitorFrm. Chromium1ContextMenuCommand( Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const params: ICefContextMenuParams; commandId: Integer ;
eventFlags: Cardinal ; out Result : Boolean ) ;
begin
Result : = False ;
case commandId of
MINIBROWSER_CONTEXTMENU_DELETECOOKIES : Chromium1. DeleteCookies;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
MINIBROWSER_CONTEXTMENU_GETCOOKIES :
begin
// This should be protected by a mutex
2019-10-29 16:13:35 +01:00
FText : = '' ;
Chromium1. VisitAllCookies;
2017-08-19 12:53:47 +02:00
end ;
2021-09-05 10:49:20 +02:00
2019-10-29 16:13:35 +01:00
MINIBROWSER_CONTEXTMENU_GETGOOGLECOOKIES :
2018-10-21 20:32:35 +02:00
begin
2019-10-29 16:13:35 +01:00
// This should be protected by a mutex
FText : = '' ;
Chromium1. VisitURLCookies( 'https://www.google.com' ) ;
2018-10-21 20:32:35 +02:00
end ;
2021-09-05 10:49:20 +02:00
2019-10-29 16:13:35 +01:00
MINIBROWSER_CONTEXTMENU_SETCOOKIE :
Chromium1. SetCookie( 'https://www.example.com' ,
'example_cookie_name' ,
'1234' ,
'' ,
'/' ,
True ,
True ,
2021-02-27 12:55:29 +01:00
False ,
now,
2019-10-29 16:13:35 +01:00
now,
now,
2020-05-23 15:00:44 +02:00
CEF_COOKIE_SAME_SITE_UNSPECIFIED,
CEF_COOKIE_PRIORITY_MEDIUM,
2019-10-29 16:13:35 +01:00
False ) ;
2021-09-05 10:49:20 +02:00
2020-06-24 12:29:13 +02:00
MINIBROWSER_CONTEXTMENU_DELETECACHE :
Chromium1. ExecuteDevToolsMethod( 0 , 'Network.clearBrowserCache' , nil ) ;
2017-08-19 12:53:47 +02:00
end ;
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
procedure TCookieVisitorFrm. Chromium1CookiesDeleted( Sender: TObject; numDeleted: Integer ) ;
begin
2019-10-29 16:13:35 +01:00
PostMessage( Handle, MINIBROWSER_COOKIESDELETED, 0 , numDeleted) ;
end ;
2021-09-05 10:49:20 +02:00
2019-10-29 16:13:35 +01:00
procedure TCookieVisitorFrm. Chromium1CookieSet( Sender: TObject;
aSuccess: Boolean ; aID: Integer ) ;
begin
2020-03-29 17:31:42 +02:00
PostMessage( Handle, MINIBROWSER_COOKIESET, WPARAM( aSuccess) , aID) ;
2019-10-29 16:13:35 +01:00
end ;
2021-09-05 10:49:20 +02:00
2019-10-29 16:13:35 +01:00
procedure TCookieVisitorFrm. Chromium1CookiesVisited( Sender: TObject;
const name_, value, domain, path: ustring; secure, httponly,
2020-05-23 15:00:44 +02:00
hasExpires: Boolean ; const creation, lastAccess, expires: TDateTime; count,
total, aID: Integer ; same_site: TCefCookieSameSite; priority: Integer ;
var aDeleteCookie, aResult: Boolean ) ;
2019-10-29 16:13:35 +01:00
var
TempCookie : TCookie;
begin
aDeleteCookie : = False ;
2021-09-05 10:49:20 +02:00
2019-10-29 16:13:35 +01:00
TempCookie. name : = name_;
TempCookie. value : = value;
TempCookie. domain : = domain;
TempCookie. path : = path;
TempCookie. secure : = secure;
TempCookie. httponly : = httponly;
TempCookie. creation : = creation;
TempCookie. last_access : = lastAccess;
TempCookie. has_expires : = hasExpires;
TempCookie. expires : = expires;
2020-05-23 15:00:44 +02:00
TempCookie. same_site : = same_site;
TempCookie. priority : = priority;
2021-09-05 10:49:20 +02:00
2019-10-29 16:13:35 +01:00
AddCookieInfo( TempCookie) ;
2021-09-05 10:49:20 +02:00
2019-11-08 14:32:03 +01:00
aResult : = ( count < > pred( total) ) ;
end ;
2021-09-05 10:49:20 +02:00
2019-11-08 14:32:03 +01:00
procedure TCookieVisitorFrm. Chromium1CookieVisitorDestroyed( Sender: TObject; aID: Integer ) ;
begin
PostMessage( Handle, MINIBROWSER_SHOWCOOKIES, 0 , 0 ) ;
2017-08-19 12:53:47 +02:00
end ;
2021-09-05 10:49:20 +02:00
2018-03-31 18:08:18 +02:00
procedure TCookieVisitorFrm. FormCloseQuery( Sender: TObject; var CanClose: Boolean ) ;
begin
CanClose : = FCanClose;
2021-09-05 10:49:20 +02:00
2018-03-31 18:08:18 +02:00
if not( FClosing) then
begin
FClosing : = True ;
Visible : = False ;
2021-09-05 10:49:20 +02:00
2018-03-31 18:08:18 +02:00
Chromium1. CloseBrowser( True ) ;
end ;
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
procedure TCookieVisitorFrm. FormCreate( Sender: TObject) ;
begin
2018-03-31 18:08:18 +02:00
FCanClose : = False ;
FClosing : = False ;
2021-09-05 10:49:20 +02:00
2020-03-04 09:42:32 +01:00
Chromium1. DefaultURL : = Edit1. Text ;
2017-08-19 12:53:47 +02:00
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
procedure TCookieVisitorFrm. FormShow( Sender: TObject) ;
begin
2017-11-04 18:32:29 +01:00
// GlobalCEFApp.GlobalContextInitialized has to be TRUE before creating any browser
// If it's not initialized yet, we use a simple timer to create the browser later.
if not( Chromium1. CreateBrowser( CEFWindowParent1, '' ) ) then Timer1. Enabled : = True ;
2017-08-19 12:53:47 +02:00
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
procedure TCookieVisitorFrm. WMMove( var aMessage : TWMMove) ;
begin
inherited ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
if ( Chromium1 < > nil ) then Chromium1. NotifyMoveOrResizeStarted;
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
procedure TCookieVisitorFrm. WMMoving( var aMessage : TMessage) ;
begin
inherited ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
if ( Chromium1 < > nil ) then Chromium1. NotifyMoveOrResizeStarted;
end ;
2021-09-05 10:49:20 +02:00
2017-12-18 19:38:56 +01:00
procedure TCookieVisitorFrm. WMEnterMenuLoop( var aMessage: TMessage) ;
begin
inherited ;
2021-09-05 10:49:20 +02:00
2017-12-18 19:38:56 +01:00
if ( aMessage. wParam = 0 ) and ( GlobalCEFApp < > nil ) then GlobalCEFApp. OsmodalLoop : = True ;
end ;
2021-09-05 10:49:20 +02:00
2017-12-18 19:38:56 +01:00
procedure TCookieVisitorFrm. WMExitMenuLoop( var aMessage: TMessage) ;
begin
inherited ;
2021-09-05 10:49:20 +02:00
2017-12-18 19:38:56 +01:00
if ( aMessage. wParam = 0 ) and ( GlobalCEFApp < > nil ) then GlobalCEFApp. OsmodalLoop : = False ;
end ;
2021-09-05 10:49:20 +02:00
2017-08-19 12:53:47 +02:00
end .