Open GoogleCodeExporter opened 9 years ago
[deleted comment]
In dcef3 access to DOM only in the rendering process.
Use:
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;
Original comment by AlexZha...@gmail.com
on 1 Feb 2013 at 6:26
Original issue reported on code.google.com by
adem.meda@gmail.com
on 24 Jan 2013 at 12:42