На англоязычном форуме нашел подсказку
Доступ к DOM возможен только в процессе рендеринга, необходимо использовать:
TCustomRenderProcessHandler = class(TCefRenderProcessHandlerOwn)
private
procedure ProcessDOM(const ADocument: ICefDomDocument);
procedure ProcessNode(ANode: ICefDomNode);
protected
function OnProcessMessageReceived(const browser: ICefBrowser;
sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean; override;
public
end;
function TCustomRenderProcessHandler.OnProcessMessageReceived(
const browser: ICefBrowser; sourceProcess: TCefProcessId;
const message: ICefProcessMessage): Boolean;
begin
if (message.Name = 'visitdom') then
begin
browser.MainFrame.VisitDomProc(ProcessDOM);
Result := True;
end
else
Result := False;
end;
CefRenderProcessHandler := TCustomRenderProcessHandler.Create;
TCustomRenderProcessHandler(CefRenderProcessHandler).bFinish := False;
procedure TMainForm.Chrome1LoadEnd(Sender: TObject; const ABrowser: ICefBrowser; const AFrame: ICefFrame; AStatus: Integer);
begin
if (AStatus = 200) and (ABrowser<>nil) and AFrame.IsMain then
ABrowser.SendProcessMessage(PID_RENDERER, TCefProcessMessageRef.New('visitdom'));
end;
procedure ProcessNode(ANode: ICefDomNode);
var
Node1: ICefDomNode;
begin
if Assigned(ANode) then begin
Node1 := ANode.FirstChild;
while Assigned(Node1) do begin
ProcessNode(Node1);
Node1 := Node1.NextSibling;
end;
end;
end;
procedure ProcessDOM(const ADocument: ICefDomDocument);
begin
ProcessNode(ADocument.Body);
end;
procedure TMainForm.Chrome1LoadEnd(Sender: TObject; const ABrowser: ICefBrowser; const AFrame: ICefFrame; AStatus: Integer);
begin
if Assigned(AFrame) then AFrame.VisitDomProc(ProcessDOM);
end;
как это интернесно в форме выглядеть будет