There is a procedure DOMVisitor_OnDocAvailable(const browser: ICefBrowser;
const frame: ICefFrame; const document: ICefDomDocument); in uDOMVisitor.pas
When called, you can get for example: "document.Title" or "document.BaseUrl" or "document.Head.ElementInnerText" and output via
Code: Select all
TempMessage.ArgumentList.SetString(0, document.Head.ElementInnerText);
But this requires rewriting and recompiling the program every time.
It's clear that "document.Title" is a field and you can't just substitute "Title" or "BaseUrl" or "ElementInnerText", but if:
Code: Select all
if gDocType = 0 then
TempMessage.ArgumentList.SetString(0, document.Title);
If gDocType = 1 then
TempMessage.ArgumentList.SetString(0, document.BaseUrl);
If gDocType = 2 then
TempMessage.ArgumentList.SetString(0, document.Head.ElementInnerText);
Code: Select all
procedure TMain.Button2Click(Sender: TObject);
begin (* get DOM *)
gDocType:=SpinEdit1.Value;
crm.SendProcessMessage(PID_RENDER,
TCefProcessMessageRef.New(RETRIEVEDOM_MSGNAME_PARTIAL));
end;
Code: Select all
if gDocType = 0 then
TempMessage.ArgumentList.SetString(0, document.Title);
If it is possible, please point out the way
Thank you.