[webkit-help] having trouble getting simple extensions working (C++)

Aeva Palecek aeva at lunarfracking.com
Fri Mar 25 13:21:47 PDT 2016


I'm attempting to use WebKit2GTK+ to allow me to write behaviors in C 
and expose bindings for those functions to a JavaScript environment.

I've put together a very minimal base code for this here 
https://github.com/Aeva/webkit2gtk-experiment.  Everything seems to 
build ok, but I am unable to find any evidence that the extension is 
actually getting loaded.  Nothing is being written to stdout by the 
extension, nor does "myCFunction" appear in the 'window' object of the 
page's javascript environment as expected.

I've been able to find an igalia blog post that talk about extensions 
and it was helpful getting this far, though it only contains very 
partial sources so I had to guess on how it should all fit together.  I 
also found a simple web browser that has one extension, and I used it 
as a reference https://github.com/vain/lariza but in building and 
tinkering with the browser, I'm not 100% convince the extensions are 
loading there either.

So I guess, what I'm hoping to find out:

 1) is there a simple canonical example somewhere of how to write and 
use extensions and verify that they are working?

 2) if anyone has the time to look at a very small base code, is there 
anything obviously wrong with the code in my repository linked above?

 3) if I'm completely on the wrong track, is there a simpler way to 
expose C functions to js in webkit2gtk+?

Thanks for your time,
Aeva Palecek

More information about the webkit-help mailing list