Enumerando Nós DOM no TChromium
Eu estou tentando enumerar nós DOM usando o seguinte código (em XE2).
Tomei emprestado a maior parte das respostas dadas aqui no SO, mas por alguma razão não está fazendo nada.
IOW, ProcessDOM () nunca é chamado.
E eu estou no meu juízo final.
Alguém poderia me mostrar o que estou fazendo de errado aqui.
Desde já, obrigado.
procedure ProcessNode(ANode: ICefDomNode);
var
Node1: ICefDomNode;
begin
if Assigned(ANode) then begin
Node1 := ANode.FirstChild;
while Assigned(Node1) do begin
{Do stuff with node}
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: ICefABrowser; const AFrame: ICefAFrame; AStatus: Integer);
begin
if Assigned(AFrame) then AFrame.VisitDomProc(ProcessDOM);
end;