CEF4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC.


CEF4Delphi is based on DCEF3, made by Henri Gourvest, which is adapted to the 2623 branch of CEF. In order to have Chromium-based web browser tabs in BriskBard it's necessary to use the latest stable branch of CEF and have frequent updates. DCEF3 hasn't been updated in the last months so it was decided to create a new project.

The main goal of CEF4Delphi is to simplify, whenever is possible, the work necessary to upgrade it to the latest version of CEF. To achieve this goal it was necessary to take the following measures :

  • Some redundancies were removed. The OSR TChromium component was merged into TChromium.
  • The code comments copied from CEF were removed. The comments in CEF are updated as frequently as the code and they can be replaced by a reference to the CEF file where you can find them.
  • The code is now spread over many smaller units.
  • There are new comments with the equivalencies between classes and types of CEF4Delphi and CEF.

The latest version of CEF4Delphi uses the branch 3945 of CEF. More precisely, it uses CEF 79.1.31 which includes Chromium 79.0.3945.117

CEF4Delphi was developed and tested on Delphi 10.3 Rio and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2 and Lazarus 2.0.6 with FPC 3.0.4. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components tested in 32 and 64 bits.

If you wish to test CEF4Delphi consider downloading the latest Delphi Community Edition from Embarcadero for free.

It's also possible to test CEF4Delphi downloading Lazarus/FPC for free.


Before using CEF4Delphi with an aplication made with Delphi or Lazarus it's necessary to understand that CEF4Delphi is a wrapper that uses CEF's C API and, in turn, CEF insulates the user from the underlying Chromium and Blink code complexity.

CEF4Delphi's overview

Stable releases

The master branch in the repository is considered a development branch and it may have issues. Use the latest released version if you need a stable component.


CEF4Delphi project :

Chromium Embedded Framework (CEF) project :

CEF binaries used by CEF4Delphi :

OldCEF4Delphi project :


Google announced that they would drop Windows XP support for Chrome in 2015. The last CEF branch that was compatible with Windows XP was 2623, released in 2016.

Since CEF4Delphi uses the latest CEF branch, it's not compatible with Windows XP, Windows Vista, Windows Server 2003 and Windows Server 2008.

CEF4Delphi needs Windows 7, 8, 8.1, 10 or newer to make it work but if you need to test some other Windows version just download and try to run the CEF Sample Application from the CEF's downloads page.

If you need to support Windows XP and Vista in your app use OldCEF4Delphi.


To build and install CEF4Delphi in the latest version of Delphi you need to follow these steps :

  1. Download the latest version of CEF4Delphi from GitHub.
  2. Decompress CEF4Delphi into a directory and make sure your user has write privileges in that directory.
  3. Run Delphi.
  4. Add the CEF4Delphi's source directory to the Library path in Delphi inside the Tools->Options menu. The Options window will show up and there you have to click on Environment Options->Delphi Options->Library, select the right platform (32 or 64 bits) and add directory in Library path.
  5. Open the file CEF4Delphi.dproj from Delphi if you only want the VCL components. If you want VCL and FireMonkey (FMX) components, open CEF4Delphi_FMX.dproj.
  6. Right-click on the CEF4Delphi.bpl icon inside the Project manager and select the Build option.
  7. Right-click on the CEF4Delphi.bpl icon inside the Project manager and select the Install option.

To compile and install CEF4Delphi in Delphi 7 you need to follow these steps :

  1. Download the latest version of CEF4Delphi from GitHub.
  2. Decompress CEF4Delphi into a directory and make sure your user has write privileges in that directory.
  3. Run Delphi.
  4. Add the CEF4Delphi's source directory to the Library path in Delphi inside the Tools->Environment options menu. The Environment Options window will show up and there you have to select the Library tab to modify the Library path.
  5. Open the file CEF4Delphi_D7.dpk from Delphi.
  6. Click on the Compile button.
  7. Click on the Install button.

To compile and install CEF4Delphi in Lazarus you need to follow these steps :

  1. Download the latest version of CEF4Delphi from GitHub.
  2. Decompress CEF4Delphi into a directory and make sure your user has write privileges in that directory.
  3. Run Lazarus.
  4. Open the file cef4delphi_lazarus.lpk from the Package->Open Package File (*.lpk)... menu.
  5. Click on the Compile button in the package window.
  6. Click on the Use button and select the Install option.


Before you use CEF4Delphi for the first time it's highly recommended to read all the information about CEF and the design documents of Chromium.

The CEF API documents are available at magpcss.org and there is extensive information about the CEF usage in its source code comments.

As you can see in the documentation, CEF uses multiple processes and it'll run the same executable or a different one to create them. That's why CEF needs to be initialized before TApplication runs.

CEF4Delphi simplifies all CEF initialization thanks to GlobalCEFApp, which is an instance of the TCEFApplication class.

Since TApplication must only be initialized and run in the main process, it's necessary to create GlobalCEFApp and call GlobalCEFApp.StartMainProcess to detect if that is the main process.

Delphi applications use to have this code in the DPR file :

program Project1; uses Vcl.Forms, Unit1 in 'Unit1.pas' {Form1}; {$R *.res} begin Application.Initialize; Application.MainFormOnTaskbar := True; Application.CreateForm(TForm1, Form1); Application.Run; end.

To include CEF4Delphi you only have to add uCEFApplication and WinApi.Windows to the uses clause, create the GlobalCEFApp global variable, call the GlobalCEFApp.StartMainProcess function and free GlobalCEFApp in the last step. You also have to add the SetPEFlags directive.

program Project1; uses Vcl.Forms, WinApi.Windows, uCEFApplication, Unit1 in 'Unit1.pas' {Form1}; {$R *.res} {$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE} begin GlobalCEFApp := TCefApplication.Create; if GlobalCEFApp.StartMainProcess then begin Application.Initialize; Application.MainFormOnTaskbar := True; Application.CreateForm(TForm1, Form1); Application.Run; end; GlobalCEFApp.Free; end.

The GlobalCEFApp creation must be in the DPR file and the call to GlobalCEFApp.StartMainProcess must be in a if..then clause.

GlobalCEFApp.StartMainProcess will return True if it detects that it's running in the main process and only then Application.Initialize, Application.MainFormOnTaskbar, Application.CreateForm and Application.Run will only be executed.

If you wish a different CEF configuration you only have to modify the properties of GlobalCEFApp before the GlobalCEFApp.StartMainProcess function call.

Almost all TCefApplication's properties have the same meaning as the fields of cef_settings_t but it also includes the events from CefApp, CefBrowserProcessHandler, CefRenderProcessHandler, CefResourceBundleHandler and CefLoadHandler.

Other properties in TCefApplication :

  • SingleProcess : Runs the renderer and plugins in the same process as the browser. This mode is unsupported and it must only be used for debugging purposes.
  • FlashEnabled : Enable detection and use of a system-wide Pepper Flash install.
  • EnableMediaStream : Enable media (WebRTC audio/video) streaming.
  • EnableSpeechInput : Enable speech input (x-webkit-speech).
  • UseFakeUIForMediaStream : Bypass the media stream infobar by selecting the default device for media streams.
  • EnableGPU : Enable the GPU plugin and Pepper 3D rendering.
  • EnableFeatures : Comma-separated list of feature names to enable.
  • DisableFeatures : Comma-separated list of feature names to disable.
  • EnableBlinkFeatures : Enable one or more Blink runtime-enabled features.
  • DisableBlinkFeatures : Disable one or more Blink runtime-enabled features.
  • SmoothScrolling : Enables smooth scroll animation.
  • FastUnload : Enable the fast unload controller, which speeds up tab/window close by running a tab's onunload js handler independently of the GUI.
  • DisableSafeBrowsing : Disable SafeBrowsing. (for testing only)
  • MuteAudio : Mutes audio.
  • SitePerProcess : Enforces a one-site-per-process security policy.
  • DisableWebSecurity : Don't enforce the same-origin policy.
  • DisablePDFExtension : Disable the PDF extension.
  • DisableExtensions : Disable extensions.
  • AutoplayPolicy : Sets the autoplay policy with these values : appDefault, appDocumentUserActivationRequired, appNoUserGestureRequired, appUserGestureRequired or appUserGestureRequiredForCrossOrigin.
  • DisableBackgroundNetworking : Disable several subsystems which run network requests in the background.
  • MetricsRecordingOnly : Enables the recording of metrics reports but disables reporting.
  • AllowFileAccessFromFiles : Allow file:// URIs to read other file:// URIs.
  • AllowRunningInsecureContent : Allow https pages to run JavaScript, CSS or plugins from http URLs.
  • EnablePrintPreview : Enable print preview.
  • PluginPolicy : Default plugin policy action.
  • DefaultEncoding : Default encoding.
  • DisableJavascript : Disable JavaScript.
  • DisableJavascriptCloseWindows : Disable closing of windows via JavaScript.
  • DisableJavascriptAccessClipboard : Disable clipboard access via JavaScript.
  • DisableJavascriptDomPaste : Disable DOM paste via JavaScript execCommand.
  • AllowUniversalAccessFromFileUrls : Allow universal access from file URLs.
  • DisableImageLoading : Disable loading of images from the network. A cached image will still be rendered if requested.
  • ImageShrinkStandaloneToFit : Shrink stand-alone images to fit.
  • DisableTextAreaResize : Disable resizing of text areas.
  • DisableTabToLinks : Disable using the tab key to advance focus to links.
  • DisablePlugins : Disable plugins.
  • EnableProfanityFilter : Enable the speech input profanity filter.
  • DisableSpellChecking : Disable spell checking.
  • OverrideSpellCheckLang : Override the default spellchecking language which comes from locales.pak.
  • WindowsSandboxInfo : Pointer to the sandbox information.
  • EnableHighDPISupport : Enable high DPI.
  • DeleteCache : Set to True if you wish to delete the cache during initialization.
  • DeleteCookies : Set to True if you wish to delete the cookies during initialization.
  • CheckCEFFiles : Set to True if you wish to check the integrity of the CEF files during the initialization.
  • ShowMessageDlg : Set to True to show error messages in case some CEF files are missing.
  • SetCurrentDir : Set to True to set the current application directory before loading the CEF libraries.
  • GlobalContextInitialized : Global CEF context has been initialized.
  • ChromeMajorVer : Chromium DLL major version.
  • ChromeMinorVer : Chromium DLL minor version.
  • ChromeRelease : Chromium DLL release number.
  • ChromeBuild : Chromium DLL build number.
  • ChromeVersion : Full Chromium DLL version.
  • LibCefVersion : Supported libcef.dll version.
  • LibCefPath : libcef.dll path.
  • ChromeElfPath : chrome_elf.dll path.
  • LibLoaded : The DLL files are loaded.
  • LogProcessInfo : Set to True to add the process information to the log file.
  • DestroyAppWindows : Destroy Application.Handle to avoid a MS Excel bug.
  • ReRaiseExceptions : Raise all exceptions.
  • DeviceScaleFactor : Device scale factor used in OSR mode.
  • CheckDevToolsResources : Set to True to check if the DevTools resources are present.
  • LocalesRequired : List of locale resources that need to be present.
  • CustomFlashPath : Directory with the Adobe Flash libraries.
  • ProcessType : CEF process type.
  • MustCreateResourceBundleHandler : This property indicates if GlobalCEFApp must create a ResourceBundleHandler.
  • MustCreateBrowserProcessHandler : This property indicates if GlobalCEFApp must create a BrowserProcessHandler.
  • MustCreateRenderProcessHandler : This property indicates if GlobalCEFApp must create a RenderProcessHandler.
  • MustCreateLoadHandler : This property indicates if GlobalCEFApp must create a LoadHandler.
  • Status : GlobalCEFApp initialization status.
  • MissingLibFiles : Missing CEF binairy files.
  • WidevinePath : Path to the Widevine files.
  • MustFreeLibrary : Set to False with large apps to avoid shutdown problems.
  • ChildProcessesCount : Child CEF processes count.
  • UsedMemory : Used RAM memory by the application.
  • TotalSystemMemory : Total system memory.
  • AvailableSystemMemory : Available system memory.
  • SystemMemoryLoad : System memory load.
  • TouchEvents : Enable support for touch event feature detection.
  • DisableReadingFromCanvas : Taints all canvas elements, regardless of origin.
  • HyperlinkAuditing : Send hyperlink auditing pings in all browsers.
  • DisableSiteIsolationTrials : Disables site isolation.

To add command line arguments use the AddCustomCommandLine procedure with any of the switches in these lists : peter.sh, cef_switches.cc.

If you need to use another executable for subprocesses check the SubProcess demo, configure the BrowserSubprocessPath property of TCefApplication with the name of the executable.

After that, you must add different components depending on the type of application that you want :

  • Regular browser UI window : Add a TChromium and a TCEFWindowParent to the Form where you want to have a web browser and then call the CreateBrowser function with the TCEFWindowParent instance as the first parameter. Alternatively you can add a TChromiumWindow, which is a class that inherits from TCEFWindowParent and has a TChromium child control. Take a look at the SimpleBrowser and SimpleBrowser2 demos for more details.
  • Off-Screen Rendering : Add a TChromium to the Form and call the CreateBrowser without parameters. Be sure to set GlobalCEFApp.WindowlessRenderingEnabled to True. Check the SimpleOSRBrowser demo for more details.

As you can see in the source code, TChromium has the functions, procedures and events of :

Other properties and functions in TChromium that you may find interesting :

  • IncZoomStep, DecZoomStep, ResetZoomStep : Used to zoom in or out.
  • CustomHeaderName, CustomHeaderValue : Used to send customized headers on every request.
  • DoNotTrack : Set to True if you want to send the DNT header.
  • SendReferrer : Set to True if you want to send the 'referer' header.
  • ProxyType, ProxyServer, ProxyPort, ProxyUsername, ProxyPassword, ProxyScriptURL, ProxyByPassList, MaxConnectionsPerProxy : Proxy configuration as described here.
  • SpellChecking : Set to True if you want to enable the spell checker.
  • SpellCheckerDicts : Comma delimited list of language codes used by the spell checker, for example 'es-ES,en-US,fr-FR,de-DE,it-IT'.
  • HyperlinkAuditing : Enable hyperlink auditing.
  • RunAllFlashInAllowMode : Run all Flash content automatically.
  • AllowOutdatedPlugins : Allow using outdated plugins.
  • AlwaysAuthorizePlugins : Always authorize plugins.
  • SafeSearch : SafeSearch is mandatory for Google Web Searches.
  • YouTubeRestrict : Restrict Mode on YouTube.
  • PrintingEnabled : Enable printing.
  • TakeSnapshot : Takes a screenshot and saves it in a TBitmap. Only works in normal mode without hardware acceleration.
  • SaveAsBitmapStream : Takes a screenshot and saves it in a TStream in Bitmap format. Only works in normal mode without hardware acceleration.

Almost all the TCefApplication, TChromium and TChromiumWindow events are executed in a different thread. If you access any VCL object in those events you may have issues, specially if you create or destroy them inside those events. It's recommended to save the parameters and send a Windows message to the main form to handle the VCL components safely in the main thread.

As all other CEF applications, you must copy the CEF binary distribution files to the directory where your CEF4Delphi application is located. Those files are part of a package called Standard Distribution and it's available at the CEF downloads page.

Once you've downloaded and decompressed the Standard Distribution package for the windows platform of your choice, you must copy the contents of the Release and Resources directories to the directory of your application's exe. Here's an screenshot of the final layout :

Final layout of the CEF binary distribution files with the application.
Final layout of the CEF binary distribution files with the application.
Notice how cef_sandbox.lib and libcef.lib can be omitted.

In case you want to move all CEF binaries to another directory you can set the GlobalCEFApp.FrameworkDirPath, GlobalCEFApp.ResourcesDirPath and GlobalCEFApp.LocalesDirPath before the GlobalCEFApp.StartMainProcess call in the DPR file.

If the CEF binaries are not correctly copied in the right directory you may see these error messages depending on the GlobalCEFApp properties : CEF binaries missing, CEF framework files missing, CEF resources missing or CEF locale files missing.

It's extremely important to only use the version of the CEF binary distribution files specified in the introduction. CEF evolves very rapidly and changes are introduced in every version.

If you try to use a different version your application could crash or, depending on the GlobalCEFApp properties, you may see this error message : Unsupported CEF version.

In case you're creating a FireMonkey application, please read the code comments in the FMX demos. FireMonkey applications using CEF4Delphi need to add a $(FrameworkType) conditional define in the project options to avoid duplicated resources.

All CEF browsers must be properly closed to avoid shutdown issues. Read the code comments in the demo you used as a template for your application for more details about the browser destruction sequence.

Generally, all browsers must call TChromium.CloseBrowser and wait for the TChromium.OnClose and TChromium.OnBeforeClose events but some demos also use a component called TCEFSentinel. TCEFSentinel is a timer initiated by the TCEFSentinel.Start function that triggers the TCEFSentinel.OnClose event when most of the CEF subprocesses are closed.


CEF uses several processes and that can make your app difficult to debug in Delphi but in those situations you can use the following tools :

  • Set GlobalCEFApp.SingleProcess to True before the GlobalCEFApp.StartMainProcess call in the DPR file. That will force CEF to use only one process and Delphi can debug it without problems. This single process mode should only be used for debugging purposes.
  • Use several processes but select the option Run->Run Without Debugging... in Delphi. Then click on Run->Attach To Process... and select the process you wish to debug.
  • Use the debug.log file to log custom text messages with the CefLog function like the DOMVisitor demo does. It's necesary to set the GlobalCEFApp.LogFile and GlobalCEFApp.LogSeverity properties before the GlobalCEFApp.StartMainProcess call in the DPR file.
  • In case of using javascript you can use the DevTools to read the console messages and to debug the javascript code. The MiniBrowser demo has all you need to add the DevTools to your app.


  • SimpleBrowser : The simplest web browser made with CEF4Delphi. It uses a TChromiumWindow component.
  • SimpleBrowser2 : The simplest web browser made with CEF4Delphi. It uses a combination of two components : TChromium and TCEFWindowParent.
  • MiniBrowser : A web browser using a TChromium and a TCEFWindowParent. It has custom context menus, basic web browser interface, developer tools, zoom, printing, proxy settings and some extra functions to copy the HTML and JavaScript printing.
  • SimpleOSRBrowser : A web browser using TChromium in OSR mode in case you need offscreen rendering.
  • CustomResourceBrowser : A simple browser that shows customized resources and web pages instead of Internet websites.
  • DOMVisitor : A basic DOM visitor using the CEF classes. It includes node search and DOM iteration.
  • FullScreenBrowser : Simple full screen browser that uses TChromium and TCEFWindowParent. It uses the ESC key to exit.
  • JavaScript : Set of JavaScript dialogs and integration demos with extensions, window bindings, function executions, evaluations and process messaging.
  • MDIBrowser : Multiple TChromium components in one MDI application.
  • ToolBoxBrowser : Multiple TChromium components in one application using ToolBox forms.
  • SchemeRegistrationBrowser : Complete URL scheme registration that shows customized web pages.
  • SubProcess : In case you can't use the main exe for all CEF processes you can use this demo.
  • CookieVisitor : Uses TCefCookieManagerRef to read all the cookies.
  • TabbedBrowser : Multiple TChromium and TCEFWindowParent components in tab sheets.
  • ExternalPumpBrowser : Browser made with the TChromium and TCEFWindowParent components using the external message pump configuration.
  • OSRExternalPumpBrowser : Browser in OSR mode using the external message pump configuration.
  • SimpleExternalPumpBrowser : Browser made with the TChromiumWindow component using the external message pump configuration.
  • SimpleServer : HTTP and websockets server made with the TCEFServerComponent component for communication between applications in localhost.
  • MDIExternalPumpBrowser : Multiple TChromium components in one MDI application using the external message pump configuration.
  • FMXExternalPumpBrowser : A web browser using TFMXChromium in a FireMonkey application.
  • ResponseFilterBrowser : A browser made with the TChromium and TCEFWindowParent components using a custom response filter.
  • PopupBrowser : This demo shows how to use custom forms with popup windows in OSR mode.
  • PopupBrowser2 : This demo shows how to use custom forms with popup windows in normal mode.
  • SimpleFMXBrowser : The simplest web browser made with CEF4Delphi and FireMonkey components. It uses TFMXChromium and TFMXWindowParent.
  • DLLBrowser : A web browser created from a DLL.
  • FMXToolBoxBrowser : Multiple TFMXChromium components in one FireMonkey application using ToolBox forms.
  • KioskOSRBrowser : Full screen Kiosk browser in OSR mode with a virtual keyboard that is shown automatically when the user clicks on an editable HTML element. The context menu also has an option to show/hide the keyboard. Press the ESC key to exit this demo.
  • ConsoleBrowser : Web browser in OSR mode created in a DLL and a console application.
  • PostInspectorBrowser : Web browser with a POST data inspector.
  • URLRequest : Demo about the TCEFUrlRequestClientComponent component.
  • EditorBrowser : HTML editor using TChromium and TCEFWindowParent.
  • OAuth2Tester : User authentication with OAuth 2.0 and REST API requests using TCEFServerComponent and TCEFUrlRequestClientComponent.

To test the demos follow these instructions :

  1. Download the CEF binaries used by CEF4Delphi : 32 bit - 64 bit
  2. Decompress the CEF binaries in a temporary directory.
  3. Copy the contents from the Release and Resources directories to the BIN directory in CEF4Delphi.
  4. Build the demo.
  5. Run the demo.


Due to licensing issues and the US patent law, the CEF binaries available at Spotify have the proprietary codecs disabled. If you use those binaries, any website that offers media using H264 won't work.

In case you need to use those codecs, you can build the CEF binaries yourself as described in this forum thread.

Building the CEF binaries requires a very powerful computer. It can take several hours even with an Intel I7 cpu with 16GB of RAM. It's recommended to have 32GB of RAM and to use an SSD drive.

Read the 'Quick Start', 'Branches And Building' and 'Automated Build Setup' articles in the CEF Wiki before building the binaries.

The CEF sources used to build the binaries must have exactly the same CEF version supported by CEF4Delphi at that moment.

Read this forum thread for a shorter guide to build the CEF binaries.

Browser plugins and extensions

Currently CEF only supports the Adobe Flash PPAPI plugin. NaCl plugins, NPAPI plugins and browser extensions are not supported but there's a feature request to add extensions.

Google dropped support of NPAPI plugins in Chromium 45 released in September 2015. Only the CEF branches older than 2454 support NPAPI plugins for Java, Silverlight or Facebook video.

About the name

CEF4Delphi is just a numeronym and it should be interpreted as CEF for Delphi. It doesn't mean that it's based in CEF4.

How to help

If you wish to help in this project you can make a donation by clicking this button :

You can also use Patreon to help this project :

Or sponsor this project on GitHub :

You can also help by telling your friends about this project, sharing the messages of this project on the social networks, writing articles about this project on your website, making suggestions, reporting issues, etc.

If you shop online you can also help by using these links for your purchases :

This article was updated on January 18th, 2020.

Copyright © 2020  All rights reserved.
Cookie usage

By browsing our site you agree to our use of cookies. You will only see this message once.
Find out more