[webkit-dev] GTK+ Javascript return value

Mark Rowe mrowe at apple.com
Thu Apr 24 13:01:36 PDT 2008


On 24/04/2008, at 12:50, Sean Hignett wrote:

> Apologies if this is the wrong place for this sort of discussion.  I  
> have been developing an application using WebKit/GTK+, and I noticed  
> that the GTK+ wrapper does not contain a means to get the return  
> value from a javascript call (from C).
>
> Not at all patch worthy, but it works, and now I can call into  
> javascript and get return values - I am wondering if there are any  
> plans to implement something like this (but well written) in the  
> future?

A function that attempts to return all values as strings seems  
limiting.  For anything non-trivial I would suggest using  
webkit_web_frame_get_global_context to retrieve the frame's  
JSContextRef then using the JavaScriptCore API directly.  The GTK port  
may like to provide convenience APIs for conversion between the  
platforms string representation and the JavaScriptCore string, similar  
to the CoreFoundation variants in JSStringRefCF.h.  If convenience  
methods like those were added then it would only be a handful of lines  
of code to do what you request using the existing API.

Kind regards,

Mark

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2413 bytes
Desc: not available
Url : http://lists.webkit.org/pipermail/webkit-dev/attachments/20080424/f4051c19/smime.bin


More information about the webkit-dev mailing list