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
Using latest dcef3 version - can not access DOMTree.
Solution from AlexZha doesn't work for me.
Does anyone know if and when this bug will be fixed?
Original comment by bones...@gmail.com
on 16 Apr 2015 at 12:25
Original issue reported on code.google.com by
adem.meda@gmail.com
on 24 Jan 2013 at 12:42