[webkit-dev] Adding Javascript object to Webkit

Lee Ka Yuk kylee at astri.org
Thu Apr 3 03:01:24 PDT 2008


Hi all,
 
I'm using the WebKit project for webpage rendering on Qtopia.
I would like to add some Javascript objects that can be accessed in the
webpage and implemented with C/C++.
 
I studied JavaScriptCore/kjs/math_object.* and successfully added a
object in JavaScriptCore/kjs.
But I doubt if this is the "correct" way of doing so.
And this method is not at all useful if I would like to access the SAME
C/C++ object in the main application.
Say I added a foo object with member var, I would like to modify and
retrieve foo.var in BOTH QtLauncher and Javascript (synchronization put
aside first).
 
There are some test apps in JavaScriptCore/bindings/ that seems to do
what I wanted.
But I'm again confused what are the different between C-binding in
JavaScriptCore/bindings/c and those code in JavaScriptCore/bindings/.
JavaScriptCore/bindings/NP_jsobject.h seems to be yet another API.
 
Then I noticed WebCore also provide some binding in WebCore/bindings/js.
How is it different from that in JavaScriptCore/bindings?
 
Which binding should I use that would fit the architecture best?
Must I understand JavaScriptCore/API in order to add the object? What is
the life cycle of the Javascript objects?
 
I can hardly find any information concering the implementation of
JavaScriptCore, could someone giva me a pointer?
(A "JavaScriptCore" search in the list yields too little info while
"JavaScript" yeilds too much.)
 
Thanks a lot,
LEE


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This message (including any attachments) is for the named
addressee(s)'s use only. It may contain sensitive, confidential,
private proprietary or legally privileged information intended for a
specific individual and purpose, and is protected by law. If you are
not the intended recipient, please immediately delete it and all copies
of it from your system, destroy any hard copies of it
and notify the sender. Any use, disclosure, copying, or distribution of
this message and/or any attachments is strictly prohibited.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.webkit.org/pipermail/webkit-dev/attachments/20080403/68e3f004/attachment.html


More information about the webkit-dev mailing list