Mono Extensions for Epiphany

I attempted to demo Mono extensions at the summit, but it seems that I really hate public speaking, and went through everything way too fast.

Basically, Epiphany has extensions, which at the moment can be written
in either python of C. It can also dynamically load new ‘loaders’
which can implement support for other types of plugins. I have now written a loader for Mono extensions. An example extension is:

using Epiphany

namespace Example
{
   public class Plugin : EphyExtension {

   public override void DetachTab (EphyWindow window, EphyTab tab)
   {
      System.Console.WriteLine ("Mono Extension: Detach tab");
   }

   public override void AttachTab (EphyWindow window, EphyTab tab)
   {
      System.Console.WriteLine ("Mono Extension: Attach tab");
   }

   public override void DetachWindow (EphyWindow window)
   {
      System.Console.WriteLine ("Mono Extension: Detach window");
   }

   public override void AttachWindow (EphyWindow window)
   {
      System.Console.WriteLine ("Mono Extension: Attach window");
   }
}

These 4 functions are the callbacks from epiphany to the
extension. Using these, you can insert menu items, and basically do
anything other types of extensions can do. The entire Epiphany public
API is exposed, allowing you to do complex things.

What I tried to demo was a simple plugin that added a menu item that
simply loaded the web page when it was clicked on. This has caused me
all sorts of headaches as the documentation for calling mono from C is
almost non-existent. Miguel has promised to send me what they have
got, so I’ll take a look at that.

There are still some problems with the reference counting, and I think
there may be some memory leaks, but those sort of details can be
sorted out later. In the meantime, you can use the epiphany-mono
module in GNOME CVS to try (and write) the mono extensions.

Comments are closed.