[webkit-dev] Fwd: WebKit2 Extending Javascript

Dominik Röttsches dominik.rottsches at intel.com
Mon Apr 8 05:51:44 PDT 2013


On 04/04/2013 10:33 AM, Christian Frost wrote:

> My problem is that I have to extend Javascript in WebKit2. That is, I
> have to add a set of global variables and functions. Potentially I
> also need to add custom classes. However, this doesn't seem to be
> possible in WebKit2 since it is not yet supported. Can you help me on
> this matter?

If you're looking for adding custom JavaScript API at compile time and 
make it available for all scripting contexts, there is no problem with 
that (and there's not a big difference between WebKit1 and 2 for that 
matter). You can start by familiarizing yourself with an IDL file that's 
similar to your purposes, and look at the related .cpp and *Custom.cpp 
files that implement the API that corresponds to that IDL file.

Dominik


More information about the webkit-dev mailing list