Putting the plugin into your XPI package as plugins/plugin.dylib
or something like that is exactly what you need to do. Firefox will not do anything special to install this plugin, it will stay in the extension directory - but it should be picked up there. You can open about:plugins
page (or the Plugins tab of the Add-ons Manager) to see whether the plugin is really installed.
One other thing is important: your install manifest (install.rdf
) needs to contain the following line:
<em:unpack>true</em:unpack>
This advises Firefox to unpack your XPI package when it is installed. By default it would be installed as a single compressed file rather than a directory - a plugin cannot be loaded from a compressed file however.
See documentation for more details.