问题
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