I've never used this library, but it looks to me like you need to do the following:
- Define a class that derives from
TCefRenderProcessHandlerOwn
. - Override the method you are interested in customising. In this case
OnBeforeNavigation
. - At initialization time, instantiate your class and assign that to the
CefRenderProcessHandler
global variable.
type
TMyRenderProcessHandler = class(TCefRenderProcessHandlerOwn)
protected
function OnBeforeNavigation(const browser: ICefBrowser;
const frame: ICefFrame; const request: ICefRequest;
navigationType: TCefNavigationType; isRedirect: Boolean): Boolean;
override;
end;
function TMyRenderProcessHandler.OnBeforeNavigation(const browser: ICefBrowser;
const frame: ICefFrame; const request: ICefRequest;
navigationType: TCefNavigationType; isRedirect: Boolean): Boolean;
begin
.... your code goes here
end;
initialization
CefRenderProcessHandler := TMyRenderProcessHandler.Create;
The project comes with demo programs that illustrate this technique. I suggest that you study those demos to learn more about this very powerful component.