As a GObject, the extension requires some actual code. The copy-template script will generate the basic structure for ephy-foo-extension.c, but you must fill in the details to make this extension actually do something. What to fill in is the focus of the rest of this document.
Before you continue, feel free to remove all the property setting/getting code if it's unneeded.
If your GObject implements the EphyExtension interface (and it should), it may implement the following functions. These are the hooks through which the extension can attach signals to accomplish pretty much anything.
Called when a new window is created. Passed the EphyExtension and EphyWindow.
Called when a window is being finalized. Passed the EphyExtension and EphyWindow.
Called when a new tab is created. Passed the EphyExtension, the EphyWindow and the EphyTab.
Called before a tab is finalized. Passed the EphyExtension, the EphyWindow and the EphyTab.
The template file will contain empty impl_attach_window and impl_detach_window when it is first created.
Python extensions may use these same functions. When using Python, the EphyExtension argument is never passed (just store data structures as globals in the Python module).