[webkit-dev] How would one call a JavaScript function from C++ using WebKit?

Geoffrey Garen ggaren at apple.com
Thu May 24 23:14:47 PDT 2007

> Does anyone know what class/function I should use in WebKit to execute
> a JavaScript function from C++?

KJS::JSObject::call invokes a function object as a function. You will  
need to retrieve the appendMessage function object from the global  
object in order to call it.

If you're asking about API, not internal code, there's  
JSObjectCallAsFunction in the C API. I'm not sure how the GDK port of  
WebKit interacts with the C API, though.


More information about the webkit-dev mailing list