[webkit-help] New to webkit

Jack Wootton jackwootton at gmail.com
Mon Aug 3 01:59:33 PDT 2009


Hello,

If you mean add a new JavaScript object, then here is a reply I wrote
some time ago (copied and pasted).

Here is the API:

http://gemma.apple.com/documentation/Carbon/Reference/WebKit_JavaScriptCore_Ref/index.html#//apple_ref/doc/framework/javascriptcore_fw

If this is what you wish to do, then the following is a rough guide of
what you need to do:

1. Create an empty class definition, you can create an empty class
definition using kJSClassDefinitionEmpty.
2. Use the class definition with the JSCoreAPI method "JSClassCreate"
to create your class.
3. Use your new class with JSObjectMake to create your new JSObject
(this will be your widget object).
4  Use JSObjectSetProperty to add your new JSObject as a property of
the Window object.

It maybe useful to look at the following files in the
JavaScriptCore (Although, personally I didn't find them particularly
easy to understand.)

JavaScriptCore\API\testapi.c
testapi.js


There are also some example programs that do what you want to do, only
with different objects.

JSPong: http://developer.apple.com/SampleCode/JSPong/index.html

JSInterpreter: http://developer.apple.com/samplecode/JSInterpreter/index.html

More programs can be found here:

http://developer.apple.com/SampleCode/Cocoa/idxInternetWeb-date.html

On Mon, Aug 3, 2009 at 5:34 AM, LG<lgmagic at gmail.com> wrote:
> Hi all,
>
> i am new to webkit and i need to add an new object/api to javascript core
> can someone share and example and tell me how to compile it in webkit
>
> anyhelp would be useful
> thanks a lot
>
>
> --
> Ganesh
>
> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help
>
>



-- 
Regards
Jack


More information about the webkit-help mailing list