cztomczak / cefpython

Python bindings for the Chromium Embedded Framework (CEF)
Other
3.08k stars 473 forks source link

Feature to run Python code in the renderer process and call synchronously CEF API such as V8/DOM and others #320

Open cztomczak opened 7 years ago

cztomczak commented 7 years ago

Materials for embedding Python using C++:

BrenBarn commented 7 years ago

Would this feature allow manipulation of the DOM directly from Python? Right now the need to constantly shunt everything through JavaScript kind of undercuts the utility of being able to embed the browser. It would be nice to be able to do all the actual DOM manipulation in Python, without having to sully ourselves with JS at all :-).

cztomczak commented 7 years ago

CEF DOM API is very limited, many things are still required to be done using Javascript. CEF DOM API functions can be found in cef_dom.h header file: https://github.com/cztomczak/cefpython/blob/master/src/include/cef_dom.h

Most of Python code is running in application's main process. The Python code running in the Renderer process can communicate only asynchronously with the Python code in the main process.