mjs at apple.com
Wed Feb 3 16:15:36 PST 2010
On Feb 3, 2010, at 3:55 PM, Brian J. Tarricone wrote:
> For a specialized application, I need to add new event classes to the browser's JS context, and I want to make them subclasses of the DOM-defined Event and UIEvent classes. However, I'm not sure how to do this. The JSClassDefinition struct has a parentClass member, but I don't see anything in the API that allows me to look up an existing JSClassRef.
> The closest I can think to do is to get the global object from the JSContextRef, look up the class name as a property, and then get the class' prototype, but I'm not sure where to go from there (or even if that's a workable approach).
> The idea is to hook into the WebKitWebView::window-object-cleared signal (I'm using webkit-gtk) and add the new classes to the passed JSGlobalContextRef.
More information about the webkit-help