[webkit-gtk] Proposal for Gobject Javascript Bridge for WebKitGtk

Martin Robinson mrobinson at webkit.org
Tue Aug 16 12:32:16 PDT 2011


On Tue, Aug 16, 2011 at 12:18 PM, siraj razick
<siraj.razick at collabora.co.uk> wrote:
> void webkit_web_frame_add_gobject_to_js_window_object (WebkitWebFrame
> *frame, const char *name, GObject *object); // add a already instantiated
> gobject into the webframe's js context
> void webkit_web_frame_import_namespace_to_js_window_object(WebkitWebFrame
> *frame, const char *name, const gchar *namespace); // introduces a gir
> namespace into the frame js context

If an API existed or exists in libseed to inject GIR namespaces and
GObjects into any JSGlobalContextRef or JSContextRef, then the API in
WebKit isn't necessary at all. One simply has to grab the context
during window-object-cleared and inject away. This also removes all
the ugliness of handling situations where clients call
webkit_web_frame_add_gobject_to_js_window_object at the wrong time
(any time before window-object-cleared).

> us to use it inside webkit. How ever this will create a circular dependency
> since libseed depends on Webkit to build, To remerdy this
> we will try to reuse only the utility methods in libseed, either by directly
> copying over the utility mehods or by spiting libseed into two
> as libseed and libseed-util (Something I'll have to talk with seed dev's
> about). The reason for this is as follows

Hopefully this isn't an issue now. libwebkitgtk has been split into
libwebkitgtk and libjavascriptcoregtk. libseed shouldn't need to link
against libwebkitgtk.

> So what do you think ?. comments, reviews, idea's, and corrections a are
> really appreciated :)

To summarize, I think there should be no new API in WebKitGTK+.
Perhaps I'm wrong here, but it doesn't feel like the correct layer to
have this.

--Martin


More information about the webkit-gtk mailing list