Here is ceflib.pas code CEFLIB.PAS
So in TCefRenderProcessHandlerOwn
class, declared OnBeforeNavigation
function.
As we can see, it returns False everytime and its bad, because if Link was opened by MouseWheelClick
it will not open this link in New Tab, i want to fix it.
The question is: How to rewrite this function?
TNX
I've never used this library, but it looks to me like you need to do the following:
TCefRenderProcessHandlerOwn
.OnBeforeNavigation
.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.