[webkit-help] [ webkit-help ] Calling JSCallBack function on Asynchronous event from C++

anil v anil.vemulapally at gmail.com
Wed Aug 26 05:47:30 PDT 2009

Hi All,

     I am trying to call JavaScript function from C/C++ on asynchronous
event. Is it possible with webkit ? Because  I have written sample code as
mentioned below but it is crashing after some time.
Sample code*

    JSStringRef functionName        =
    WebkitWebFrame *frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW
    JSGlobalContextRef jsCtx = webkit_web_frame_get_global_context (frame);
    JSValueRef jsArgs[1];

    jsString = JSStringCreateWithUTF8CString((const char *)buf);
    jsArgs[0] = JSValueMakeString(jsCtx, jsString);

    JSValueRef functionValue        = JSObjectGetProperty(jsCtx,
JSContextGetGlobalObject(jsCtx), functionName, &exception);

    JSObjectRef jsFunctionObject = JSValueToObject(jsCtx, functionValue,

    JSObjectCallAsFunction(jsCtx,jsFunctionObject, NULL, 1, jsArgs,

Please any one help me to call JS Callback functions from C/C++.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20090826/df935282/attachment.html>

More information about the webkit-help mailing list