This is Christian Frost's Typepad Profile.
Join Typepad and start following Christian Frost's activity
Christian Frost
Recent Activity
Hi,
I use WebKit2 which may cause that my WebKitWebView does not
have the "window-object-cleared" signal. Therefore it cannot be
connected. I have tried to "hook" it to the "resource-load-started"
with the following callback function:
static void resource_load_started_cb(WebKitWebView *web_view,
WebKitWebResource *resource, WebKitURIRequest *request, gpointer
user_data)
{
JSGlobalContextRef * context
=webkit_web_view_get_javascript_global_context(web_view);
JSClassRef classDef = JSClassCreate(&class_def);
JSObjectRef classObj = JSObjectMake(context, classDef, context);
JSObjectRef globalObj = JSContextGetGlobalObject(context);
JSStringRef str = JSStringCreateWithUTF8CString("CustomClass");
JSObjectSetProperty(context, globalObj, str, classObj,
kJSPropertyAttributeNone, NULL);
}
However, when I use my CustomClass in Javascript, WebKit cannot find the class.
Can someone guide me how to do this? Currently I use the Minibrowser
as a sample program to implement it.
WebKit: Extending JavaScript (I)
In recent years, JavaScript has become a very popular language. Google has promoted rich web applications which compete with desktop programs: Gmail, Google Maps and Google Docs are rivals of Outlook, Google Earth and Office. Today HTTP, HTML, CSS and JavaScript are key technologies in which com...
Christian Frost is now following The Typepad Team
Feb 21, 2013
Subscribe to Christian Frost’s Recent Activity