Get HTML Source from Chromium Embedded

user1647411 picture user1647411 · Nov 10, 2012 · Viewed 11.8k times · Source

How to do this with Delphi Chromium Embedded Component i know how to do this with TWebBrowser. But since no docs are present for this I am sure someone else had same problem.

Thanks

Answer

user1647411 picture user1647411 · Nov 10, 2012

Here is how you do it..

procedure TCustomLoad.OnLoadEnd(const browser: ICefBrowser;
  const frame: ICefFrame; httpStatusCode: Integer);
  var
  data:tstringlist;
begin
  data:=tstringlist.create;
  if frame.IsMain then
  data.text:=frame.Source; // HTML Source    
end;
  data.free;
end;