Using CefDOMDocument Class

199 views
Skip to first unread message

Patryk Sowa

unread,
May 4, 2015, 8:12:27 AM5/4/15
to cefs...@googlegroups.com
Hello, I am using CEF from few days. Browser works perfectly, but can not use CefDOMDocument class. Do I have to add other references other than cefsharp.dll, cefsharp.core.dll ?

Alex Maitland

unread,
May 4, 2015, 8:27:54 AM5/4/15
to cefs...@googlegroups.com
Not supported. `CEF` DOM API is considered deprecated and won't be implemented in `CefSharp`.

http://magpcss.org/ceforum/viewtopic.php?f=6&t=10652&p=16750&hilit=dom+deprecated#p16750

You can use a combination of JavaScript binding and `EvaluateScriptAsync` to do most things. See the FAQ for some examples.

https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions#2-how-do-you-call-a-javascript-method-that-return-a-result

If you absolutely must have access to the `DOM API` then `CefGlue` might be a better fit for you.

Patryk Sowa

unread,
May 4, 2015, 9:20:41 AM5/4/15
to cefs...@googlegroups.com
I want to find element by id and then click on it. Can you help me with this?

Alex Maitland

unread,
May 4, 2015, 5:22:34 PM5/4/15
to cefs...@googlegroups.com
Hook the `NavStateChanged` event, when it's finished loading (the event args has an `IsLoading` property) execute your javascript as per normal.

Basic example
https://github.com/cefsharp/CefSharp/wiki/Frequently-asked-questions#1-how-do-you-call-a-javascript-methods-from-net
Reply all
Reply to author
Forward
0 new messages