It turned out to be very doable, despite epiphany’s extension API lacking Vala bindings (Cosimo Cecchi, I’m looking at you ). Basically I did the following setup:
- Add the extension following the instructions in Writing Epiphany Extensions by Adam Hooper.
- Add a check for valac in
- Add a rule in the extension’s
Makefile.amto generate a C header file for all the Vala code, for use from C.
Then I started writing the actual extension. I did the minimal amount of work in C, trying to escape as soon as possible into Vala. In the few places I needed to call from Vala into C I would declare a delegate in Vala, and pass a function from Ci.
I call this new version BMS, for bookmark synchronisation. I have a patch for BMS that applies to epiphany 2.28.1. (The file also contain a
PKGBUILD in order to delight Arch users )
- The format of
.vapifiles are unknown to me, and I haven’t managed to find much documentation. Using function pointers seemed like an easier way, especially given that I needed this in exactly 3 places.[back]