Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.
procedure TMiniBrowserFrm.Chromium1ProcessMessageReceived(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
sourceProcess: TCefProcessId; const message: ICefProcessMessage;
out Result: Boolean);
Var
TempFrame : ICefFrame;
TempVisitor : TCefFastDomVisitor2;
begin
Memo1.Lines.Add('TMiniBrowserFrm.Chromium1ProcessMessageReceived');
Result := False;
if (message = nil) or (message.ArgumentList = nil) then exit;
if message.Name = MSG1 then
begin
Memo1.Lines.Add(message.ArgumentList.GetString(0));
Memo1.Lines.Add(MSG1);
TempFrame := browser.MainFrame;
if (TempFrame <> nil) then
begin
TempVisitor := TCefFastDomVisitor2.Create(browser, TempFrame, DOMVisitor_OnDocAvailable);
TempFrame.VisitDom(TempVisitor);
// error here
SimpleNodeSearch(TempVisitor, 'link-ajax j-v-contacts-expand-link');
end;
end;
Result := True;
end;
MiniBrowserFrm.Memo1 can only be accessed from the browser process.
You need to use a process message to send information from the DOMVisitor_OnDocAvailableSearch procedure in the render process to the browser process like this : https://github.com/salvadordf/CEF4Delph ... r.pas#L250