onBeforeBrowse event in Delphi Chromium component

…衆ロ難τιáo~ 提交于 2020-02-07 00:00:30

问题


I'm trying to use following procedure in Delphi XE2 with Chromium component (version 306):

procedure TForm1.Chromium1BeforeBrowse(Sender: TObject;
  const browser: ICefBrowser; const frame: ICefFrame;
  const request: ICefRequest; navType: TCefHandlerNavtype; isRedirect: Boolean;
  out Result: Boolean);

but it's not working. Delphi doesn't recognize onBeforeBrowse event. Chromium seems to be correctly installed, samples are working, and I'm trying to add onBeforeBrowse event handling in GuiClient sample... Is there that event in Delphi Chromium component ?


回答1:


Since you've described your problem like not working, go through the all steps:

  • Step 1 - Where to check or create event handler
  • Step 2 - What happens when you don't have source paths configured
  • Step 3 - How to configure paths to the Chromium library source code
  • Step 4 - Don't forget to include the binaries into a project's visible place



回答2:


Yes.. this event exists. You can find its usage in unit cefvcl. Its type is declared in cefgui, TOnBeforeBrowse.

I'll probably remove my answer later.. just to share the screenshot...

I open the Demo project... double-click on the event OnBeforeBrowse and added the showmessage you can see

Regarding the screenshot.. do not trust the TEdit.. I only change the DefaultUrl property of the TChromium itself ;o)



来源:https://stackoverflow.com/questions/10642520/onbeforebrowse-event-in-delphi-chromium-component

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!