TChromium, TFMXChromium and TChromiumCore

This is the component that puts together all browser procedures, functions, properties and events in one place. It has all you need to create, modify and destroy a web browser.

VCL and LCL applications use TChromium but FireMonkey applications use TFMXChromium. Both components inherit from TChromiumCore which has most of the code but you'll see many references to TChromium in the forum to keep it simple.

CEF uses handlers and several classes to control the web browser and TChromiumCore hides all that complexity in one component.

Some of those handlers must always be created with each TChromiumCore instance but many will only be created if the application uses at least one event related to that handler.

It's necessary to assign procedures to the TChromiumCore events you need before creating the browser because the handler that will trigger an event will only be created if that event is us

Some properties are used when TChromiumCore creates a browser and they need to be set before the TChromiumCore.CreateBrowser call.

The default CEF configuration uses multiple threads to improve the browser performance and most of the events in this component are executed in the context of those background threads. This can cause problems with VCL, LCL and FMX controls because they are not thread safe.

If you use the default CEF configuration move all the code that creates, destroys or modifies controls outside the TChromiumCore events.

TChromiumCore will handle one browser by default but it can also be configured to handle multiple browsers when you allow CEF to create all popup windows automatically.

You have to set TChromiumCore.MultiBrowserMode to true and set Result to false in the TChromiumCore.OnBeforePopup event in order to enable this feature.

All the events from all the browsers handled by TChromiumCore in multi-browser mode will be triggered using the same TChromiumCore instance. To differentiate what browser is responsible for each triggered event you can compare TChromiumCore.BrowserId with browser.Identifier.

There are several TChromiumCore functions and properties used to handle the array of browsers handled in multi-browser mode.

Procedures and functions in TChromiumCore

function TChromiumCore.CreateClientHandler(aIsOSR : boolean = True) : boolean;

Used to create the client handler which will also create most of the browser handlers needed for the browser.

function TChromiumCore.CreateClientHandler(var aClient : ICefClient; aIsOSR : boolean = True) : boolean;

Used to create the client handler when a browser requests a new browser in a popup window or tab in the TChromiumCore.OnBeforePopup event.

procedure TChromiumCore.CloseBrowser(aForceClose : boolean);

Used to request the selected browser close. It calls the CefBrowserHost.CloseBrowser method. Read this for more details about this procedure.

procedure TChromiumCore.CloseAllBrowsers;

Calls CloseBrowser for all the browsers handled by this TChromiumCore instance.

function TChromiumCore.TryCloseBrowser : boolean;

Helper for closing a browser. It calls the CefBrowserHost.TryCloseBrowser. Read this for more details about this procedure.

function TChromiumCore.SelectBrowser(aID : integer) : boolean;

Select the browser with the aID identifier when TchromiumCore uses the multi-browser mode.

function TChromiumCore.IndexOfBrowserID(aID : integer) : integer;

Returns the index in the browsers array of the browser with the aID identifier when TChromiumCore uses the multi-browser mode.

function TChromiumCore.ShareRequestContext(var aContext : ICefRequestContext; const aHandler : ICefRequestContextHandler = nil) : boolean;

Creates a new request context in the aContext parameter that shares storage with the request context of the current browser and uses an optional handler.

procedure TChromiumCore.InitializeDragAndDrop(const aDropTargetWnd : HWND);

Used with browsers in OSR mode to initialize drag and drop in Windows.

procedure TChromiumCore.ShutdownDragAndDrop;

Used with browsers in OSR mode to shutdown drag and drop in Windows.

function TChromiumCore.SetNewBrowserParent(aNewParentHwnd : HWND) : boolean;

Used to reparent the browser to a different TCEFWindowParent.

function TChromiumCore.CreateBrowser(aParentHandle : TCefWindowHandle; aParentRect : TRect; const aWindowName : ustring = ''; const aContext : ICefRequestContext = nil; const aExtraInfo : ICefDictionaryValue = nil; aForceAsPopup : boolean = False) : boolean; overload; virtual;
function TChromiumCore.CreateBrowser(const aURL : ustring; const aBrowserViewComp : TCEFBrowserViewComponent; const aContext : ICefRequestContext = nil; const aExtraInfo : ICefDictionaryValue = nil) : boolean; overload; virtual;

Used to create the browser after the global request context has been initialized. You need to set all properties and events before calling this function because it will only create the internal handlers needed for those events and the property values will be used in the browser initialization.

The browser will be fully initialized when the TChromiumCore.OnAfterCreated is triggered.

procedure TChromiumCore.LoadURL(const aURL : ustring; const aFrameName : ustring = ''); overload;
procedure TChromiumCore.LoadURL(const aURL : ustring; const aFrame : ICefFrame); overload;
procedure TChromiumCore.LoadURL(const aURL : ustring; const aFrameIdentifier : int64); overload;

Used to navigate to a URL in the specified frame or the main frame.

procedure TChromiumCore.LoadString(const aHTML : ustring; const aFrameName : ustring = ''); overload;
procedure TChromiumCore.LoadString(const aHTML : ustring; const aFrame : ICefFrame); overload;
procedure TChromiumCore.LoadString(const aHTML : ustring; const aFrameIdentifier : int64); overload;

Used to load a DATA URI with the HTML string contents in the specified frame or the main frame.

procedure TChromiumCore.LoadResource(const aStream : TCustomMemoryStream; const aMimeType, aCharset : string; const aFrameName : ustring = ''); overload;
procedure TChromiumCore.LoadResource(const aStream : TCustomMemoryStream; const aMimeType, aCharset : string; const aFrame : ICefFrame); overload;
procedure TChromiumCore.LoadResource(const aStream : TCustomMemoryStream; const aMimeType, aCharset : string; const aFrameIdentifier : int64); overload;

Used to load a DATA URI with the stream contents in the specified frame or the main frame. The DATA URI will be configured with the mime type and charset specified in the parameters.

procedure TChromiumCore.LoadRequest(const aRequest: IcefRequest);

Loads the request specified in the parameter.

WARNING: This function will fail with bad IPC message reason INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the request origin using some other mechanism (LoadURL, link click, etc).

procedure TChromiumCore.GoBack;
procedure TChromiumCore.GoForward;
procedure TChromiumCore.Reload;
procedure TChromiumCore.ReloadIgnoreCache;
procedure TChromiumCore.StopLoad;

Basic browser navigation function to go back, forward, reload and stop. ReloadIgnoreCache will reload the current page ignoring any cached data.

procedure TChromiumCore.StartDownload(const aURL : ustring);

Starts downloading a file in the specified URL.

procedure TChromiumCore.DownloadImage(const imageUrl: ustring; isFavicon: Boolean; maxImageSize: cardinal; bypassCache: Boolean);

Starts downloading an image in the specified URL.

procedure TChromiumCore.SimulateMouseWheel(aDeltaX, aDeltaY : integer);

Calls CefBrowserHost.SendMouseWheelEvent to simulate a simple mouse wheel event. Use TChromiumCore.SendMouseWheelEvent if you need to specify the mouse coordinates or the event flags.

function TChromiumCore.ClearCertificateExceptions(aClearImmediately : boolean = True) : boolean;

Calls CefRequestContext.ClearCertificateExceptions to clear all certificate exceptions that were added as part of handling TChromiumCore.OnCertificateError. Read this for more details about this function.

function TChromiumCore.ClearHttpAuthCredentials(aClearImmediately : boolean = True) : boolean;

Clears all HTTP authentication credentials that were added as part of handling GetAuthCredentials. Read this for more details about this function.

function TChromiumCore.CloseAllConnections(aCloseImmediately : boolean = True) : boolean;

Clears all active and idle connections that Chromium currently has. Read this for more details about this function.

procedure TChromiumCore.RetrieveHTML(const aFrameName : ustring = ''); overload;
procedure TChromiumCore.RetrieveHTML(const aFrame : ICefFrame); overload;
procedure TChromiumCore.RetrieveHTML(const aFrameIdentifier : int64); overload;

Retrieve all the HTML content from the specified frame or the main frame. It uses a CefStringVisitor to get the HTML content asynchronously and the result will be received in the TChromiumCore.OnTextResultAvailable event.

procedure TChromiumCore.RetrieveText(const aFrameName : ustring = ''); overload;
procedure TChromiumCore.RetrieveText(const aFrame : ICefFrame); overload;
procedure TChromiumCore.RetrieveText(const aFrameIdentifier : int64); overload;

Retrieve all the text content from the specified frame or the main frame. It uses a CefStringVisitor to get the text content asynchronously and the result will be received in the TChromiumCore.OnTextResultAvailable event.

procedure TChromiumCore.GetNavigationEntries(currentOnly: Boolean);

Retrieve the current navigation entries asynchronously. The result will be available in the TChromiumCore.OnNavigationVisitorResultAvailable event. Read these documents to know more details about GetNavigationEntries and the visitor used to get the entries.

function TChromiumCore.GetFrameNames(var aFrameNames : TStrings) : boolean;

Returns the names of all existing frames.

function TChromiumCore.GetFrameIdentifiers(var aFrameCount : NativeUInt; var aFrameIdentifierArray : TCefFrameIdentifierArray) : boolean;

Returns the identifiers of all existing frames.

procedure TChromiumCore.ExecuteJavaScript(const aCode, aScriptURL : ustring; const aFrameName : ustring = ''; aStartLine : integer = 0); overload;
procedure TChromiumCore.ExecuteJavaScript(const aCode, aScriptURL : ustring; const aFrame : ICefFrame; aStartLine : integer = 0); overload;
procedure TChromiumCore.ExecuteJavaScript(const aCode, aScriptURL : ustring; const aFrameIdentifier : int64; aStartLine : integer = 0); overload;

Execute a string of JavaScript code in the specified frame or the main frame. Read this for more details about this procedure.

procedure TChromiumCore.UpdatePreferences;

Used to update the browser preferences using the TChromiumCore property values asynchronously.

procedure TChromiumCore.SavePreferences(const aFileName : string);

Save the browser preferences as a text file.

procedure TChromiumCore.ResolveHost(const aURL : ustring);

Calls CefRequestContext.ResolveHost to resolve the domain in the URL parameter to a list of IP addresses. The result will be received in the TChromiumCore.OnResolvedHostAvailable event.

function TChromiumCore.IsSameBrowser(const aBrowser : ICefBrowser) : boolean;

Used to check if the browser parameter is the same as the selected browser in TChromiumCore.

function TChromiumCore.ExecuteTaskOnCefThread(aCefThreadId : TCefThreadId; aTaskID : cardinal; aDelayMs : Int64 = 0) : boolean;

Calling ExecuteTaskOnCefThread function will trigger the TChromiumCore.OnExecuteTaskOnCefThread event.

  • aCefThreadId indicates the CEF thread on which TChromiumCore.OnExecuteTaskOnCefThread will be executed.
  • aTaskID is a custom ID used to identify the task that triggered the TChromiumCore.OnExecuteTaskOnCefThread event.
  • aDelayMs is an optional delay in milliseconds to trigger the TChromiumCore.OnExecuteTaskOnCefThread event.
procedure TChromiumCore.SetUserAgentOverride(const aUserAgent : ustring; const aAcceptLanguage : ustring = ''; const aPlatform : ustring = '');

This procedure calls the Emulation.setUserAgentOverride DevTools method to override the user agent string. Read this for more details about that method.

procedure TChromiumCore.ClearDataForOrigin(const aOrigin : ustring; aStorageTypes : TCefClearDataStorageTypes = cdstAll);

This procedure calls the Storage.clearDataForOrigin DevTools method to clear the storage data for a given origin. Read this for more details about that method.

procedure TChromiumCore.ClearCache;

This procedure calls the Network.clearBrowserCache DevTools method to clear the cache data.

function TChromiumCore.DeleteCookies(const url : ustring = ''; const cookieName : ustring = ''; aDeleteImmediately : boolean = False) : boolean;

Used to delete cookies immediately or asynchronously. If aDeleteImmediately is false TChromiumCore.DeleteCookies triggers the TChromiumCore.OnCookiesDeleted event when the cookies are deleted.

function TChromiumCore.VisitAllCookies(aID : integer = 0) : boolean;

TChromiumCore.VisitAllCookies triggers the TChromiumCore.OnCookiesVisited event for each cookie aID is an optional parameter to identify which VisitAllCookies call has triggered the OnCookiesVisited event.

TChromiumCore.OnCookiesVisited may not be triggered if the cookie store is empty but the TChromium.OnCookieVisitorDestroyed event will always be triggered to signal when the browser when the visit is over.

function TChromiumCore.VisitURLCookies(const url : ustring; includeHttpOnly : boolean = False; aID : integer = 0) : boolean;

TChromiumCore.VisitURLCookies triggers the TChromiumCore.OnCookiesVisited event for each cookie aID is an optional parameter to identify which VisitURLCookies call has triggered the OnCookiesVisited event.

TChromiumCore.OnCookiesVisited may not be triggered if the cookie store is empty but the TChromium.OnCookieVisitorDestroyed event will always be triggered to signal when the browser when the visit is over.

function TChromiumCore.SetCookie(const url, name_, value, domain, path: ustring; secure, httponly, hasExpires: Boolean; const creation, lastAccess, expires: TDateTime; same_site : TCefCookieSameSite; priority : TCefCookiePriority; aSetImmediately : boolean = True; aID : integer = 0): Boolean;

TChromiumCore.SetCookie triggers the TChromiumCore.OnCookieSet event when the cookie has been set aID is an optional parameter to identify which SetCookie call has triggered the OnCookieSet event.

function TChromiumCore.FlushCookieStore(aFlushImmediately : boolean = True) : boolean;

Used to flush the cookies. If aFlushImmediately is false then OnCookiesFlushed is triggered when the cookies are flushed.

procedure TChromiumCore.ShowDevTools(const inspectElementAt: TPoint; aWindowInfo: PcefWindowInfo);

Calls CefBrowserHost.ShowDevTools to open the developer tools (DevTools) in its own browser. If inspectElementAt has a valid point with coordinates different than low(integer) then the element at the specified location will be inspected. Read this for more details about that procedure.

procedure TChromiumCore.CloseDevTools; overload;
procedure TChromiumCore.CloseDevTools(const aDevToolsWnd : TCefWindowHandle); overload;

Calls CefBrowserHost.CloseDevTools to close the developer tools. Read this for more details about this procedure.

function TChromiumCore.SendDevToolsMessage(const message_: ustring): boolean;

Calls CefBrowserHost.SendDevToolsMessage to send a function call message over the DevTools protocol. Read the code comments for send_dev_tools_message for more details.

function TChromiumCore.ExecuteDevToolsMethod(message_id: integer; const method: ustring; const params: ICefDictionaryValue): Integer;

Calls CefBrowserHost.ExecuteDevToolsMethod to execute a function call over the DevTools protocol. Read the code comments for execute_dev_tools_method for more details.

function TChromiumCore.AddDevToolsMessageObserver(const observer: ICefDevToolsMessageObserver): IcefRegistration;

Used to add a custom DevTools message observer. Read the code comments for add_dev_tools_message_observer for more details.

procedure TChromiumCore.Find(aIdentifier : integer; const aSearchText : ustring; aForward, aMatchCase, aFindNext : Boolean);

Calls CefBrowserHost.Find to search for aSearchText in the current web page. Read this for more details about that procedure.

procedure TChromiumCore.StopFinding(aClearSelection : Boolean);

Calls CefBrowserHost.StopFinding to stop searching for text in the current web page. Read this for more details about that procedure.

procedure TChromiumCore.Print;

Print the current browser contents.

procedure TChromiumCore.PrintToPDF(const aFilePath, aTitle, aURL : ustring);

Print the current browser contents to a PDF file.

procedure TChromiumCore.ClipboardCopy;
procedure TChromiumCore.ClipboardPaste;
procedure TChromiumCore.ClipboardCut;
procedure TChromiumCore.ClipboardUndo;
procedure TChromiumCore.ClipboardRedo;
procedure TChromiumCore.ClipboardDel;
procedure TChromiumCore.SelectAll;

Execute clipboard functions like copy, paste, cut, undo, etc. in the focused frame.

procedure TChromiumCore.IncZoomStep;
procedure TChromiumCore.DecZoomStep;
procedure TChromiumCore.IncZoomPct;
procedure TChromiumCore.DecZoomPct;
procedure TChromiumCore.ResetZoomStep;
procedure TChromiumCore.ResetZoomLevel;
procedure TChromiumCore.ResetZoomPct;
procedure TChromiumCore.ReadZoom;

Increase, decrease, reset or read the zoom value. These procedures trigger the TChromium.OnZoomPctAvailable event with the new value.

procedure TChromiumCore.WasResized;

Used in OSR mode to notify the browser that the panel showing the browser contents has been resized.

procedure TChromiumCore.WasHidden(hidden: Boolean);

Used in OSR mode to notify the browser that it has been hidden or shown.

procedure TChromiumCore.NotifyScreenInfoChanged;

Used in OSR mode to notify the browser that the screen info has changed.

procedure TchromiumCore.NotifyMoveOrResizeStarted;

Used in OSR mode to notify the browser that the window hosting it is about to be moved or resized.

procedure TChromiumCore.Invalidate(type_: TCefPaintElementType = PET_VIEW);

Used in OSR mode to invalidate the view.

procedure TChromiumCore.SendExternalBeginFrame;

Used in OSR mode to issue a BeginFrame request to Chromium.

procedure TChromiumCore.SendKeyEvent(const event: PcefKeyEvent);

Used to send a key event to the browser. Read this for more details about that procedure.

procedure TChromiumCore.SendMouseClickEvent(const event: PCefMouseEvent; type_: TCefMouseButtonType; mouseUp: Boolean; clickCount: Integer);

Send a mouse click event to the browser. Read this for more details about that procedure.

procedure TChromiumCore.SendMouseMoveEvent(const event: PCefMouseEvent; mouseLeave: Boolean);

Send a mouse move event to the browser. Read this for more details about that procedure.

procedure TChromiumCore.SendMouseWheelEvent(const event: PCefMouseEvent; deltaX, deltaY: Integer);

Send a mouse wheel event to the browser. Read this for more details about that procedure.

procedure TChromiumCore.SendTouchEvent(const event: PcefTouchEvent);

Send a touch event to the browser for a windowless browser. Read this for more details about that procedure.

procedure TChromiumCore.SendFocusEvent(setFocus: Boolean);

Send a focus event to the browser. Read this for more details about that procedure.

procedure TChromiumCore.SendCaptureLostEvent;

Send a capture lost event to the browser. Read this for more details about that procedure.

procedure TChromiumCore.SendProcessMessage(targetProcess: TCefProcessId; const ProcMessage: ICefProcessMessage; const aFrameName : ustring = ''); overload;
procedure TChromiumCore.SendProcessMessage(targetProcess: TCefProcessId; const ProcMessage: ICefProcessMessage; const aFrame : ICefFrame); overload;
procedure TChromiumCore.SendProcessMessage(targetProcess: TCefProcessId; const ProcMessage: ICefProcessMessage; const aFrameIdentifier : int64); overload;

Send a message to the specified target process using the specified frame or the main frame. Read this for more details about that procedure.

function TChromiumCore.CreateUrlRequest(const request: ICefRequest; const client: ICefUrlrequestClient; const aFrameName : ustring = ''): ICefUrlRequest; overload;
function TChromiumCore.CreateUrlRequest(const request: ICefRequest; const client: ICefUrlrequestClient; const aFrame : ICefFrame): ICefUrlRequest; overload;
function TChromiumCore.CreateUrlRequest(const request: ICefRequest; const client: ICefUrlrequestClient; const aFrameIdentifier : int64): ICefUrlRequest; overload;

Create a new URL request that will be treated as originating from the specified frame or the main frame and the associated browser. Read this for more details about that procedure.

procedure TChromiumCore.SetFocus(focus: Boolean);

Set whether the browser is focused. Read this for more details about that procedure.

procedure TChromiumCore.SetAccessibilityState(accessibilityState: TcefState);

Set accessibility state for all frames. Read this for more details about that procedure.

procedure TChromiumCore.DragTargetDragEnter(const dragData: ICefDragData; const event: PCefMouseEvent; allowedOps: TcefDragOperations);

Call this method when the user drags the mouse into the web view (before calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). Read this for more details about that procedure.

procedure TChromiumCore.DragTargetDragOver(const event: PCefMouseEvent; allowedOps: TcefDragOperations);

Call this method each time the mouse is moved across the web view during a drag operation (after calling DragTargetDragEnter and before calling DragTargetDragLeave/DragTargetDrop). Read this for more details about that procedure.

procedure TChromiumCore.DragTargetDragLeave;

Call this method when the user drags the mouse out of the web view (after calling DragTargetDragEnter). Read this for more details about that procedure.

procedure TChromiumCore.DragTargetDrop(const event: PcefMouseEvent);

Call this method when the user completes the drag operation by dropping the object onto the web view (after calling DragTargetDragEnter). Read this for more details about that procedure.

procedure TChromiumCore.DragSourceEndedAt(x, y: Integer; op: TcefDragOperation);

Call this method when the drag operation started by a CefRenderHandler.StartDragging call has ended either in a drop or by being cancelled. Read this for more details about that procedure.

procedure TChromiumCore.DragSourceSystemDragEnded;

Call this method when the drag operation started by a CefRenderHandler.StartDragging call has completed. Read this for more details about that procedure.

procedure TChromiumCore.IMESetComposition(const text: ustring; const underlines : TCefCompositionUnderlineDynArray; const replacement_range, selection_range : PcefRange);

Begins a new composition or updates the existing composition. Read this for more details about that procedure.

procedure TChromiumCore.IMECommitText(const text: ustring; const replacement_range : PCefRange; relative_cursor_pos : integer);

Completes the existing composition by optionally inserting the specified |text| into the composition node. Read this for more details about that procedure.

procedure TChromiumCore.IMEFinishComposingText(keep_selection : boolean);

Completes the existing composition by applying the current composition node contents. Read this for more details about that procedure.

procedure TchromiumCore.IMECancelComposition;

Cancels the existing composition and discards the composition node contents without applying them. Read this for more details about that procedure.

procedure TChromiumCore.ReplaceMisspelling(const aWord : ustring);

If a misspelled word is currently selected in an editable node calling this method will replace it with the specified aWord. Read this for more details about that procedure.

procedure TChromiumCore.AddWordToDictionary(const aWord : ustring);

Add the specified aWord to the spelling dictionary. Read this for more details about that procedure.

procedure TChromiumCore.UpdateBrowserSize(aLeft, aTop, aWidth, aHeight : integer);

Used in Linux to resize the browser contents.

procedure TChromiumCore.UpdateXWindowVisibility(aVisible : boolean);

Used in Linux to update the browser visibility.

function TChromiumCore.AddObserver(const observer: ICefMediaObserver): IcefRegistration;

Add an observer for MediaRouter events. Read this for more details about that procedure.

function TChromiumCore.GetSource(const urn: ustring): IcefMediaSource;

Returns a MediaSource object for the specified media source URN. Read this for more details about that procedure.

procedure TChromiumCore.NotifyCurrentSinks;

Trigger an asynchronous call to CefMediaObserver.OnSinks on all registered observers. Read this for more details about that procedure.

procedure TChromiumCore.NotifyCurrentRoutes;

Trigger an asynchronous call to CefMediaObserver,OnRoutes on all registered observers. Read this for more details about that procedure.

procedure TChromiumCore.CreateRoute(const source: ICefMediaSource; const sink: IcefMediaSink);

Create a new route between source and sink. Read this for more details about that procedure.

procedure TChromiumCore.GetDeviceInfo(const aMediaSink: IcefMediaSink);

Calls CefMediaSink.GetDeviceInfo to retrieve the device info asynchronously. Read these code comments to know more details about CefMediaSink.GetDeviceInfo.

function TChromiumCore.LoadExtension(const root_directory: ustring; const manifest: ICefDictionaryValue = nil; const handler: ICefExtensionHandler = nil; const requestContext : ICefRequestContext = nil) : boolean;

Calls CefRequestContext.LoadExtension to load a browser extension. Read this for more details about that procedure.

function TChromiumCore.DidLoadExtension(const extension_id: ustring): boolean;

Returns true if this context was used to load the extension identified by extension_id. Read this for more details about that procedure.

function TChromiumCore.HasExtension(const extension_id: ustring): boolean;

Returns true if this context has access to the extension identified by extension_id. Read this for more details about that procedure.

function TChromiumCore.GetExtensions(const extension_ids: TStringList): boolean;

Retrieve the list of all extensions that this context has access to (see HasExtension). Read this for more details about that procedure.

function TChromiumCore.GetExtension(const extension_id: ustring): IcefExtension;

Returns the extension matching extension_id or nil if no matching extension is accessible in this context (see HasExtension). Read this for more details about that procedure.

Properties in TChromiumCore

DefaultUrlFirst URL loaded by the browser after its creation.
Options
FontOptions
DefaultEncoding
Properties used to fill the TCefBrowserSettings record which is used during the browser creation. Read this or this for all the details about cef_browser_settings_t.
PDFPrintOptionsProperties used to fill the TCefPdfPrintSettings record which is used in the TChromiumCore.PrintToPDF call. Read this for all the details about cef_pdf_print_settings_t.
BrowserIdCalls the CefBrowser.GetIdentifier method to return the globally unique identifier for the selected browser.
BrowserReturns a CefBrowser instance of the selected browser.
BrowserByIdReturns a CefBrowser instance of the browser with the specified id.
BrowserCountReturns the number of browsers in the browser array when the multi-browser mode is enabled.
BrowserIdByIndexReturns the identifier of the browser in the specified array position when the multi-browser mode is enabled.
CefClientReturns the CefClient instance used in this browser.
ReqContextHandlerReturns the CefRequestContextHandler instance used in this browser.
ResourceRequestHandlerReturns the CefResourceRequestHandler instance used in this browser.
CefWindowInfoReturns the TCefWindowInfo record used when the browser was created. Read the source code comments for cef_window_info_t corresponding to each platform : Windows, Linux and MacOS.
VisibleNavigationEntryCalls CefBrowserHost.GetVisibleNavigationEntry to return the current visible navigation entry for the selected browser.
RequestContextReturns a CefRequestContext instance used by the selected browser.
MediaRouterReturns a CefMediaRouter instance used by the selected browser.
MediaObserverReturns a CefMediaObserver instance used by the selected browser.
MediaObserverRegReturns the CefRegistration instance obtained when the default MediaObserver was added.
DevToolsMsgObserverReturns a CefDevToolsMessageObserver instance used by the selected browser.
DevToolsMsgObserverRegReturns the CefRegistration instance obtained when the default DevToolsMessageObserver was added.
ExtensionHandlerReturns a CefExtensionHandler instance used by the selected browser.
MultithreadAppReturns the value of GlobalCEFApp.MultiThreadedMessageLoop.
IsLoadingCalls CefBrowser.IsLoading and returns true if the browser is currently loading.
HasDocumentCalls CefBrowser.HasDocument and returns true if a document has been loaded in the browser.
HasViewCalls CefBrowserHost.HasView and returns true if this browser is wrapped in a CefBrowserView.
HasDevToolsCalls CefBrowserHost.HasDevTools and returns true if this browser currently has an associated DevTools browser.
HasClientHandlerReturns true if CefClient has a valid value.
HasBrowserReturns true if this component has a valid selected browser.
CanGoBackCalls CefBrowser.CanGoBack and returns true if the browser can navigate back.
CanGoForwardCalls CefBrowser.CanGoForward and returns true if the browser can navigate forward.
IsPopUpCalls CefBrowser.IsPopUp and returns true if the window is a popup window.
WindowHandleCalls CefBrowserHost.GetWindowHandle and returns the window handle for this browser.
OpenerWindowHandleCalls CefBrowserHost.GetOpenerWindowHandle and returns the window handle of the browser that opened this browser.
BrowserHandle
WidgetHandle
RenderHandle
Handles of the child controls created automatically by CEF to show the web contents. These properties are only available in Windows.
FrameIsFocusedReturns true if CefBrowser.FocusedFrame has a valid value.
InitializedReturns true when the browser is fully initialized and it's not being closed.
RequestContextCacheReturns the cache value in CefRequestContext.CachePath.
RequestContextIsGlobalCalls CefRequestContext.IsGlobal to check if the request context is the global context or it's independent.
DocumentURLReturns the URL of the main frame.
ZoomLevel
ZoomPct
ZoomStep
Return the current zoom value. These properties are based on the CefBrowserHost.ZoomLevel value which can only be read in the CEF UI thread.
WindowlessFrameRateReturns the maximum rate in frames per second (fps) that OnPaint will be called for a browser in OSR mode.
CustomHeaderName
CustomHeaderValue
Properties to add a custom HTTP header name and value to all requests.
DoNotTrackSet to True if you want to send the DNT header.
SendReferrerSet to True if you want to send the referer header.
HyperlinkAuditingEnable hyperlink auditing.
AllowOutdatedPluginsAllow using outdated plugins.
AlwaysAuthorizePluginsAlways authorize plugins.
SpellCheckingSet to True if you want to enable the spell checker.
SpellCheckerDictsComma delimited list of language codes used by the spell checker, for example es-ES,en-US,fr-FR,de-DE,it-IT.
HasValidMainFrameReturns true if the main frame exists and it's valid.
FrameCountReturns the number of frames that currently exist.
DragOperationsReturns the TcefDragOperation value used during drag and drop.
AudioMutedReturns true if the browser's audio is muted.
SafeSearchForces the Google safesearch in the browser preferences.
YouTubeRestrictForces the YouTube restrictions in the browser preferences.
PrintingEnabledEnables printing in the browser preferences.
AcceptLanguageListSet the accept language list in the browser preferences.
AcceptCookiesSets the cookies policy value in the browser preferences.
Block3rdPartyCookiesBlocks third party cookies in the browser preferences.
MultiBrowserModeEnables the multi-browser mode that allows TChromiumCore to handle several browsers with one component. These browsers are usually the main browser, popup windows and new tabs.
DefaultWindowInfoExStyleDefault ExStyle value used to initialize the browser. A value of WS_EX_NOACTIVATE can be used as a workaround for some focus issues in CEF.
OfflineUses the Network.emulateNetworkConditions DevTool method to set the browser in offline mode.
NetworkPredictionsSets the network prediction options in the browser preferences.
QuicAllowedEnables the Quic protocol in the browser preferences.
JavascriptEnabledEnables JavaScript in the browser preferences.
LoadImagesAutomaticallyEnables automatic image loading in the browser preferences.
XDisplayGets the Xdisplay pointer in Linux.
WebRTCIPHandlingPolicy
WebRTCMultipleRoutes
WebRTCNonproxiedUDP
Sets the WebRTC settings in the browser preferences.
ProxyType
ProxyScheme
ProxyServer
ProxyPort
ProxyUsername
ProxyPassword
ProxyScriptURL
ProxyByPassList
Proxy configuration as described here.
MaxConnectionsPerProxySets the maximum connections per proxy value in the browser preferences.

Custom events in TChromiumCore

OnTextResultAvailableTriggered after a TChromiumCore.RetrieveHTML or TChromiumCore.RetrieveText call with the HTML or text results.
OnPdfPrintFinishedTriggered after a TChromiumCore.PrintToPDF call when the PDF has been created.
OnPrefsAvailableTriggered after a TChromiumCore.SavePreferences call when the preferences have been saved.
OnCookiesDeletedTriggered after a TChromiumCore.DeleteCookies call when the cookies have been deleted.
OnResolvedHostAvailableTriggered after a TChromiumCore.ResolveHost call with the host information.
OnNavigationVisitorResultAvailableTriggered after a TChromiumCore.GetNavigationEntries call with a navigation entry.
OnDownloadImageFinishedTriggered after a TChromiumCore.DownloadImage call when the download is complete.
OnCookiesFlushedTriggered after a TChromiumCore.FlushCookieStore call when the cookies are flushed.
OnCertificateExceptionsClearedTriggered after a TChromiumCore.ClearCertificateExceptions call when the exceptions are cleared.
OnHttpAuthCredentialsClearedTriggered after a TChromiumCore.ClearHttpAuthCredentials call when the credentials are cleared.
OnAllConnectionsClosedTriggered after a TChromiumCore.CloseAllConnections call when the connections are closed.
OnExecuteTaskOnCefThreadTriggered after a TChromiumCore.ExecuteTaskOnCefThread call in the context of the specified CEF thread.
OnCookiesVisitedTriggered after a TChromiumCore.VisitAllCookies call with cookie information.
OnCookieVisitorDestroyedTriggered after a TChromiumCore.VisitAllCookies call when the IcefCookieVisitor has been destroyed.
OnCookieSetTriggered after a TChromiumCore.SetCookie call when the cookie has been set.
OnZoomPctAvailableTriggered after a call to any of the procedures to increase, decrease or reset the zoom with the new zoom value.
OnMediaRouteCreateFinishedTriggered after a TChromiumCore.CreateRoute call when the route is created.
OnMediaSinkDeviceInfoTriggered after a TChromiumCore.GetDeviceInfo call with the device info.
OnBrowserCompMsg
OnWidgetCompMsg
OnRenderCompMsg
Triggered for all messages sent to the child controls created by CEF to show the web contents. These events are only available in Windows.

ICefClient events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefClient.

OnProcessMessageReceivedCalled when a new message is received from a different process.

ICefLoadHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefLoadHandler.

OnLoadStartCalled after a navigation has been committed and before the browser begins loading contents in the frame.
OnLoadEndCalled when the browser is done loading a frame.
OnLoadErrorCalled when a navigation fails or is canceled.
OnLoadingStateChangeCalled when the loading state has changed.

ICefFocusHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefFocusHandler.

OnTakeFocusCalled when the browser component is about to loose focus.
OnSetFocusCalled when the browser component is requesting focus.
OnGotFocusCalled when the browser component has received focus.

ICefContextMenuHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefContextMenuHandler.

OnBeforeContextMenuCalled before a context menu is displayed.
OnRunContextMenuCalled to allow custom display of the context menu.
OnContextMenuCommandCalled to execute a command selected from the context menu.
OnContextMenuDismissedCalled when the context menu is dismissed irregardless of whether the menu was empty or a command was selected.

ICefKeyboardHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefKeyboardHandler.

OnPreKeyEventCalled before a keyboard event is sent to the renderer.
OnKeyEventCalled after the renderer and JavaScript in the page has had a chance to handle the event.

ICefDisplayHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefDisplayHandler.

OnAddressChangeCalled when a frame's address has changed.
OnTitleChangeCalled when the page title changes.
OnFavIconUrlChangeCalled when the page icon changes.
OnFullScreenModeChangeCalled when web content in the page has toggled fullscreen mode.
OnTooltipCalled when the browser is about to display a tooltip.
OnStatusMessageCalled when the browser receives a status message.
OnConsoleMessageCalled to display a console message.
OnAutoResizeCalled when auto-resize is enabled via CefBrowserHost.SetAutoResizeEnabled and the contents have auto-resized.
OnLoadingProgressChangeCalled when the overall page loading progress has changed.
OnCursorChangeCalled when the browser's cursor has changed.

ICefDownloadHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefDownloadHandler.

OnBeforeDownloadCalled before a download begins.
OnDownloadUpdatedCalled when a download's status or progress information has been updated.

ICefJsDialogHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefJsDialogHandler.

OnJsdialogCalled to run a JavaScript dialog.
OnBeforeUnloadDialogCalled to run a dialog asking the user if they want to leave a page.
OnResetDialogStateCalled to cancel any pending dialogs and reset any saved dialog state.
OnDialogClosedCalled when the default implementation dialog is closed.

ICefLifeSpanHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefLifeSpanHandler.

OnBeforePopupCalled on the UI thread before a new popup browser is created.
OnAfterCreatedCalled after a new browser is created.
OnBeforeCloseCalled just before a browser is destroyed.
OnCloseCalled when a browser has received a request to close. This event corresponds to the CefLifeSpanHandler.DoClose method.

ICefRequestHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefRequestHandler.

OnBeforeBrowseCalled on the UI thread before browser navigation.
OnOpenUrlFromTabCalled on the UI thread before OnBeforeBrowse in certain limited cases where navigating a new or different browser might be desirable.
OnGetAuthCredentialsCalled on the IO thread when the browser needs credentials from the user. This event corresponds to the CefRequestHandler.GetAuthCredentials method.
OnQuotaRequestCalled on the IO thread when JavaScript requests a specific storage quota size via the webkitStorageInfo.
OnCertificateErrorCalled on the UI thread to handle requests for URLs with an invalid SSL certificate.
OnSelectClientCertificateCalled on the UI thread when a client certificate is being requested for authentication.
OnPluginCrashedCalled on the browser process UI thread when a plugin has crashed.
OnRenderViewReadyCalled on the browser process UI thread when the render view associated with |browser| is ready to receive/handle IPC messages in the render process.
OnRenderProcessTerminatedCalled on the browser process UI thread when the render process terminates unexpectedly.
OnGetResourceRequestHandler_ReqHdlrCalled on the browser process IO thread before a resource request is initiated. This event corresponds to the CefRequestHandler.GetResourceRequestHandler method.
OnDocumentAvailableInMainFrameCalled on the browser process UI thread when the window.document object of the main frame has been created.

ICefResourceRequestHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefResourceRequestHandler.

OnBeforeResourceLoadCalled on the IO thread before a resource request is loaded.
OnGetResourceHandlerCalled on the IO thread before a resource is loaded. This event corresponds to the CefResourceRequestHandler.GetResourceHandler method.
OnResourceRedirectCalled on the IO thread when a resource load is redirected.
OnResourceResponseCalled on the IO thread when a resource response is received.
OnGetResourceResponseFilterCalled on the IO thread to optionally filter resource response content. This event corresponds to the CefResourceRequestHandler.GetResourceResponseFilter method.
OnResourceLoadCompleteCalled on the IO thread when a resource load has completed.
OnProtocolExecutionCalled on the IO thread to handle requests for URLs with an unknown protocol component.

ICefCookieAccessFilter events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefCookieAccessFilter.

OnCanSendCookieCalled on the IO thread before a resource request is sent. This event corresponds to the CefCookieAccessFilter.CanSendCookie method.
OnCanSaveCookieCalled on the IO thread after a resource response is received. This event corresponds to the CefCookieAccessFilter.CanSaveCookie method.

ICefDialogHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefDialogHandler.

OnFileDialogCalled to run a file chooser dialog.

ICefRenderHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefRenderHandler.

OnGetAccessibilityHandlerReturn the handler for accessibility notifications. This event corresponds to the CefRenderHandler.GetAccessibilityHandler method.
OnGetRootScreenRectCalled to retrieve the root window rectangle in screen coordinates. This event corresponds to the CefRenderHandler.GetRootScreenRect method.
OnGetViewRectCalled to retrieve the view rectangle which is relative to screen coordinates. This event corresponds to the CefRenderHandler.GetViewRect method.
OnGetScreenPointCalled to retrieve the translation from view coordinates to actual screen coordinates. This event corresponds to the CefRenderHandler.GetScreenPoint method.
OnGetScreenInfoCalled to allow the client to fill in the CefScreenInfo object with appropriate values. This event corresponds to the CefRenderHandler.GetScreenInfo method.
OnPopupShowCalled when the browser wants to show or hide the popup widget.
OnPopupSizeCalled when the browser wants to move or resize the popup widget.
OnPaintCalled when an element should be painted.
OnAcceleratedPaintCalled when an element has been rendered to the shared texture handle.
OnStartDraggingCalled when the user starts dragging content in the web view. This event corresponds to the CefRenderHandler.StartDragging method.
OnUpdateDragCursorCalled when the web view wants to update the mouse cursor during a drag & drop operation. This event corresponds to the CefRenderHandler.UpdateDragCursor method.
OnScrollOffsetChangedCalled when the scroll offset has changed.
OnIMECompositionRangeChangedCalled when the IME composition range has changed.
OnTextSelectionChangedCalled when text selection has changed for the specified browser.
OnVirtualKeyboardRequestedCalled when an on-screen keyboard should be shown or hidden for the specified browser.

ICefDragHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefDragHandler.

OnDragEnterCalled when an external drag event enters the browser window.
OnDraggableRegionsChangedCalled whenever draggable regions for the browser window change.

ICefFindHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefFindHandler.

OnFindResultCalled to report find results returned by TchromiumCore.Find.

ICefRequestContextHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefRequestContextHandler.

OnRequestContextInitializedCalled on the browser process UI thread immediately after the request context has been initialized.
OnBeforePluginLoadCalled on multiple browser process threads before a plugin instance is loaded.
OnGetResourceRequestHandler_ReqCtxHdlrCalled on the browser process IO thread before a resource request is initiated. This event corresponds to the CefRequestContextHandler.GetResourceRequestHandler method.

ICefMediaObserver events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefMediaObserver.

OnSinksThe list of available media sinks has changed or TchromiumCore.NotifyCurrentSinks was called.
OnRoutesThe list of available media routes has changed or TChromiumCore.NotifyCurrentRoutes was called.
OnRouteStateChangedThe connection state of route has changed.
OnRouteMessageReceivedA message was received over route.

ICefAudioHandler events in TChromiumCore

Read the code comments in this file for all the details about ICefAudioHandler.

OnGetAudioParametersCalled on the UI thread to allow configuration of audio stream parameters. This event corresponds to the CefAudioHandler.GetAudioParameters method.
OnAudioStreamStartedCalled on a browser audio capture thread when the browser starts streaming audio.
OnAudioStreamPacketCalled on the audio stream thread when a PCM packet is received for the stream.
OnAudioStreamStoppedCalled on the UI thread when the stream has stopped.
OnAudioStreamErrorCalled on the UI or audio stream thread when an error occurred.

ICefDevToolsMessageObserver events in TChromiumCore

Read the code comments in this file for all the details about ICefDevToolsMessageObserver.

OnDevToolsMessageCalled on receipt of a DevTools protocol message with the parsed JSON text in the parameters.
OnDevToolsRawMessageCalled on receipt of a DevTools protocol message with the unparsed text in the parameters. If an application uses this event then the OnDevToolsMessage event won't be triggered.
OnDevToolsMethodResultCalled after attempted execution of a DevTools protocol function with the parsed JSON text in the parameters.
OnDevToolsMethodRawResultCalled after attempted execution of a DevTools protocol function with the unparsed text in the parameters. If an application uses this event then the OnDevToolsMethodResult event won't be triggered.
OnDevToolsEventCalled on receipt of a DevTools protocol event with the parsed JSON text in the parameters.
OnDevToolsRawEventCalled on receipt of a DevTools protocol event with the unparsed text in the parameters. If an application uses this event then the OnDevToolsEvent event won't be triggered.
OnDevToolsAgentAttachedCalled when the DevTools agent has attached.
OnDevToolsAgentDetachedCalled when the DevTools agent has detached.

ICefExtensionHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefExtensionHandler.

OnExtensionLoadFailedCalled if the TChromiumCore.LoadExtension request fails.
OnExtensionLoadedCalled if the TChromiumCore.LoadExtension request succeeds.
OnExtensionUnloadedCalled after the CefExtension.Unload request has completed.
OnExtensionBeforeBackgroundBrowserCalled when an extension needs a browser to host a background script specified via the background manifest key. This event corresponds to the CefExtensionHandler.OnBeforeBackgroundBrowser method.
OnExtensionBeforeBrowserCalled when an extension API (e.g. chrome.tabs.create) requests creation of a new browser. This event corresponds to the CefExtensionHandler.OnBeforeBrowser method.
OnExtensionGetActiveBrowserCalled when no tabId is specified to an extension API call that accepts a tabId parameter (e.g. chrome.tabs.*). This event corresponds to the CefExtensionHandler.GetActiveBrowser method.
OnExtensionCanAccessBrowserCalled when the tabId associated with target_browser is specified to an extension API call that accepts a tabId parameter (e.g. chrome.tabs.*). This event corresponds to the CefExtensionHandler.CanAccessBrowser method.
OnExtensionGetExtensionResourceCalled to retrieve an extension resource that would normally be loaded from disk (e.g. if a file parameter is specified to chrome.tabs.executeScript). This event corresponds to the CefExtensionHandler.GetExtensionResource method.

ICefPrintHandler events in TChromiumCore

Read this page and the code comments in this file for all the details about ICefPrintHandler.

All these events are only available on Linux.

OnPrintStartCalled when printing has started for the specified browser.
OnPrintSettingsSynchronize settings with client state.
OnPrintDialogShow the print dialog.
OnPrintJobSend the print job to the printer.
OnPrintResetReset client state related to printing.
OnGetPDFPaperSizeReturn the PDF paper size in device units. This event corresponds to the CefPrintHandler.GetPDFPaperSize method.

Copyright © 2021  Todos los derechos reservados.
Uso de cookies

Por el hecho de navegar en este sitio acepta usar nuestras cookies. Solo verá este mensaje una vez.
Más información
Cerrar