[webkit-dev] Add custom event into Webkit

Darin Adler darin at apple.com
Thu Apr 9 09:15:46 PDT 2009


On Apr 9, 2009, at 9:11 AM, Ross Lillie wrote:

> The next piece of the puzzle, however, is dispatching events  
> generated by my
> external code into the Javascript/DOM environment.  These events  
> ideally
> require special data to be attached.  From my admittedly limited
> understanding of WebKit internals, it would appear that I can't do  
> this
> without bypassing the public interfaces.

If the special data only needs to be seen by JavaScript code, you can  
just add JavaScript properties to the event object. With the Mac OS X  
DOM bindings a clean way to do this is by taking the Objective-C DOM  
object and calling the JSObject method, giving you a JSObjectRef that  
you can then use to add additional properties to.

     -- Darin



More information about the webkit-dev mailing list