由于我的技能有限,我无法弄清楚如何在Delphi 7中做同样的事情,因为它不支持匿名方法!
答案 0 :(得分:2)
procedure TheProcThatHandlesItAll(const doc: ICefDomDocument)
var
q: ICefDomNode;
begin
// "q" is the ID of the text input element
q := doc.GetElementById('q');
if Assigned(q) then
q.SetElementAttribute('value', 'Hello, world');
end
procedure TMainForm.actDomExecute(Sender: TObject);
begin
crm.Browser.MainFrame.VisitDomProc(TheProcThatHandlesItAll);
end;