[webkit-gtk] Extending JavascriptCore

Martin Robinson martin.james.robinson at gmail.com
Fri Feb 22 12:39:04 PST 2013


On Fri, Feb 22, 2013 at 4:28 AM, Christian Frost <cf at cfrost.dk> wrote:

> However, 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:

In WebKit2, the DOM lives in a different process, so if you want to
inject JavaScript objects you need to write a WebKitWebExtension [1].
There's very little documentation around this subject, so I suggest
looking at the unit tests we have for it in the WebKit source
repository [2].

1. http://webkitgtk.org/reference/webkit2gtk/unstable/WebKitWebExtension.html
2. http://trac.webkit.org/browser/trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestWebExtensions.cpp

--Martin


More information about the webkit-gtk mailing list