TCEFApplicationCore is used to simplify the CEF initialization and finalization.
TCEFApplication inherits from TCEFApplicationCore and it was created to avoid an issue with the CEF subprocesses and MS Office.
Most demos initializate a global variable called GlobalCEFApp using TCEFApplication but the demos using a different executable for the subprocesses will use TCEFApplicationCore in the subprocesses.
GlobalCEFApp is usually created before the main application form and destroyed when all the forms are already closed. When an application uses a different executable for the subprocesses the GlobalCEFApp can be created at any moment.
Most of the properties, events and methods in TCEFApplicationCore correspond to methods and callbacks in these CEF classes : CefApp, CefBrowserProcessHandler, CefRenderProcessHandler, CefResourceBundleHandler and CefLoadHandler.
Some properties are used to assign values to the CEF settings and to enable some CEF command line switches
when it's initialized. This means that those properties must be set before initializing CEF and all the changes made to those properties after initialization are ignored.
The command line switches
can be used to enable or disable many Chromium features available as configuration flags in the that browser.
Used to add any command line switch that is not available as a TCEFApplicationCore property.
Used to initialize CEF in the main browser process. In case CEF is configured to used the same executable for all processes then all processes must call this function.
CEF can only be initialized once per process. This is a CEF feature and there's no workaround.
Used to initialize CEF in the subprocesses. This function can only be used when CEF is configured to use a different executable for the subprocesses.
This procedure is only available in MacOS to read some configuration settings from the command line arguments.
This procedure is used to perform a single iteration of CEF message loop processing when the multithreaded message loop is disabled and the external message pump is enabled.
Read the code comments about cef_do_message_loop_work for more details.
This procedure is a replacement for the main application message loop when the multithreaded message loop and the external message pump are disabled.
Read the code comments about cef_run_message_loop for more details.
Procedure used to stop the message loop started by RunMessageLoop when the multithreaded message loop and the external message pump are disabled.
Read the code comments about cef_quit_message_loop for more details.
This procedure is used to update the device scale factor property value in this class. That value is only used in OSR mode.
All the procedures and function that start with Internal_
are meant to be used by the CEF handlers and they should never be used by applications.
The following properties are used to populate the TCefSettings record when CEF is initialized and they should be set before the StartMainProcess/StartSubProcess calls.
Read the code comments about cef_settings_t for more information about each of them.
The following properties add some of the most popular command line switches to CEF when it's initialized and they should be set before the StartMainProcess/StartSubProcess calls.
The command line switches may change with every Chromium version.
These links have the updated list of switches :
These are the the equivalent switches for the properties :
AllowFileAccessFromFiles | --allow-file-access-from-files |
AllowRunningInsecureContent | --allow-running-insecure-content |
AllowUniversalAccessFromFileUrls | --allow-universal-access-from-files |
AutoplayPolicy | --autoplay-policy |
BlinkSettings | --blink-settings |
DefaultEncoding | --default-encoding |
DevToolsProtocolLogFile | --devtools-protocol-log-file |
DisableBackgroundNetworking | --disable-background-networking |
DisableBlinkFeatures | --disable-blink-features |
DisableChromeLoginPrompt | --disable-chrome-login-prompt |
DisableExtensions | --disable-extensions |
DisableFeatures | --disable-features |
DisableImageLoading | --disable-image-loading |
DisableJavascript | --disable-javascript |
DisableJavascriptAccessClipboard | --disable-javascript-access-clipboard |
DisableJavascriptCloseWindows | --disable-javascript-close-windows |
DisableJavascriptDomPaste | --disable-javascript-dom-paste |
DisableNewBrowserInfoTimeout | --disable-new-browser-info-timeout |
DisablePDFExtension | --disable-pdf-extension |
DisablePlugins | --disable-plugins |
DisableReadingFromCanvas | --disable-reading-from-canvas |
DisableSafeBrowsing | --safebrowsing-disable-auto-update |
DisableSiteIsolationTrials | --disable-site-isolation-trials |
DisableSpellChecking | --disable-spell-checking |
DisableTabToLinks | --disable-tab-to-links |
DisableTextAreaResize | --disable-text-area-resize |
DisableWebSecurity | --disable-web-security |
DisableZygote | --no-zygote |
EnableBlinkFeatures | --enable-blink-features |
EnableFeatures | --enable-features |
EnableGPU | --enable-gpu-plugin |
EnableMediaStream | --enable-media-stream |
EnablePrintPreview | --enable-print-preview |
EnableProfanityFilter | --enable-profanity-filter |
EnableSpeechInput | --enable-speech-input |
EnableUsermediaScreenCapturing | --enable-usermedia-screen-capturing |
FastUnload | --enable-fast-unload |
ForcedDeviceScaleFactor | --device-scale-factor |
ForceFieldTrialParams | --force-fieldtrial-params |
ForceFieldTrials | --force-fieldtrials |
HyperlinkAuditing | --no-pings |
ImageShrinkStandaloneToFit | --image-shrink-standalone-to-fit |
MetricsRecordingOnly | --metrics-recording-only |
MuteAudio | --mute-audio |
OverrideSpellCheckLang | --override-spell-check-lang |
PluginPolicy | --plugin-policy |
SingleProcess | --single-process |
SitePerProcess | --site-per-process |
SmoothScrolling | --enable-smooth-scrolling |
TouchEvents | --touch-events |
UseFakeUIForMediaStream | --use-fake-ui-for-media-stream |
UseMockKeyChain | --use-mock-keychain |
See the code in TcefApplicationCore.AddCustomCommandLineSwitches to know how each property is translated into one or more switches.
ApiHashCommit | Calls cef_api_hash to get the commit hash. |
ApiHashPlatform | Calls cef_api_hash to get the platform hash. |
ApiHashUniversal | Calls cef_api_hash to get the universal hash. |
AvailableSystemMemory | Calculates the available memory in Windows. |
CheckCEFFiles | Checks if the CEF binaries are present and the DLL version. |
ChildProcessesCount | Returns the number of CEF subprocesses running at that moment. |
ChromeBuild | Returns the build version information from Chromium. |
ChromeElfPath | Returns the path to chrome_elf.dll. |
ChromeMajorVer | Returns the major version information from Chromium. |
ChromeMinorVer | Returns the minor version information from Chromium. |
ChromeRelease | Returns the release version information from Chromium. |
ChromeVersion | Returns the full version information from Chromium. |
DeleteCache | Used to delete all the cache files before CEF is initialized. |
DeleteCookies | Used to delete all the cookies before CEF is initialized. |
DeviceScaleFactor | Returns the device scale factor used in OSR mode. |
DisableRequestHandlingForTesting | Used to bypass request handling in CEF to facilitate debugging of network-related issues. |
EnableHighDPISupport | Used to support high DPI monitors. Calls cef_enable_highdpi_support when CEF is initialized. |
GlobalContextInitialized | Set to True when the global context is initialized and the application can start creating web browsers. |
LastErrorMessage | Last error message that is usually shown when CEF finds a problem at initialization. |
LibCefPath | Path to libcef.dll or libcef.so |
LibCefVersion | Complete libcef version information. |
LibLoaded | Set to true when TCEFApplicationCore has loaded the CEF libraries. |
LocalesRequired | List of locale files that will be checked with CheckCEFFiles. |
LogProcessInfo | Add a debug log information line when the CEF libraries are loaded. |
MissingBinariesException | Raise an exception when the CEF binaries check fails. |
MissingLibFiles | List of missing CEF library files. |
MustCreateBrowserProcessHandler | Force the creation of ICefBrowserProcessHandler. |
MustCreateLoadHandler | Force the creation of ICefLoadHandler. |
MustCreateRenderProcessHandler | Force the creation of ICefRenderProcessHandler. |
MustCreateResourceBundleHandler | Force the creation of ICefResourceBundleHandler. |
MustFreeLibrary | Set to true to free the library handle when TCEFApplicationCore is destroyed. |
OsmodalLoop | Set to true when the application receives WM_ENTERMENULOOP and set to false when the application receives WM_EXITMENULOOP. |
ProcessType | CEF process type currently running. |
ReRaiseExceptions | Set to true to raise all exceptions. |
SetCurrentDir | Used to set the current directory when the CEF libraries are loaded. This is required if the application is launched from a different application. |
ShowMessageDlg | Set to true when you need to use a showmessage dialog to show the error messages. |
Status | Returns the TCEFApplicationCore initialization status. |
SystemMemoryLoad | Memory load in Windows. |
TotalSystemMemory | Total system memory in Windows. |
UsedMemory | Total used memory by all CEF processes. |
WidevinePath | Path to the Widevine CDM plugin. |
WindowsSandboxInfo | Pointer to the sandbox info. Currently unused in Delphi and Lazarus. |
XDisplay | Pointer to XDisplay in Linux. |
Read this page and the code comments in this file for all the details about ICefApp.
OnRegCustomSchemes | Corresponds to CefApp.OnRegisterCustomSchemes. Provides an opportunity to register custom schemes. |
Read this page and the code comments in this file for all the details about ICefBrowserProcessHandler.
OnContextInitialized | Triggered on the browser process UI thread immediately after the CEF context has been initialized. |
OnBeforeChildProcessLaunch | Triggered before a child process is launched. |
OnScheduleMessagePumpWork | Triggered when work has been scheduled for the browser process. |
OnGetDefaultClient | Return the default client for use with a newly created browser window. |
Read this page and the code comments in this file for all the details about ICefResourceBundleHandler.
OnGetLocalizedString | Triggered to retrieve a localized translation for the specified string_id. |
OnGetDataResource | Triggered to retrieve data for the specified scale independent resource_id. |
OnGetDataResourceForScale | Triggered to retrieve data for the specified resource_id nearest the scale factor scale_factor. |
Read this page and the code comments in this file for all the details about ICefRenderProcessHandler.
All these events are triggered on the render process only.
OnWebKitInitialized | Triggered after WebKit has been initialized. |
OnBrowserCreated | Triggered after a browser has been created. |
OnBrowserDestroyed | Triggered before a browser is destroyed. |
OnContextCreated | Triggered immediately after the V8 context for a frame has been created. |
OnContextReleased | Triggered immediately before the V8 context for a frame is released. |
OnUncaughtException | Triggered for global uncaught exceptions in a frame. |
OnFocusedNodeChanged | Triggered when a new node in the the browser gets focus. |
OnProcessMessageReceived | Triggered when a new message is received from a different process. |
Read this page and the code comments in this file for all the details about ICefRegisterCDMCallback.
OnCDMRegistrationComplete | Triggered when CDM registration is complete. |
Read this page and the code comments in this file for all the details about ICefLoadHandler.
All these events are triggered on the render process only.
OnLoadingStateChange | Triggered when the loading state has changed. |
OnLoadStart | Triggered after a navigation has been committed and before the browser begins loading contents in the frame. |
OnLoadEnd | Triggered when the browser is done loading a frame. |
OnLoadError | Triggered when a navigation fails or is canceled. |
DestroyApplicationObject | Destroy the Application object before initializing subprocesses. |
DestroyAppWindows | Destroy the handles created by the Application object before initializing subprocesses. |
Add a handler that will be alerted when the global context is initialized. Only available in Lazarus.
Remove a handler from the handler list that will be alerted when the global context is initialized. Only available in Lazarus.