Question

I'm trying to package up an npapi into a firefox add-on I'm writing. If i have the plugin installed into ~/Library/Internet Plug-ins/ it all works correctly, but i cant get it to install with the xpi. I have the plugin at the root level of the plugin directory, but I can't figure out how to tell firefox to install it with the xpi.

Any tips?

Was it helpful?

Solution

sadly the new firefox SDK doesn't allow for npapi plugins to be auto-installed. add-ons that are "bootstrappable" wont be valid plugin sources. From what I can tell, bootstrappable means that they are just loaded from a script which dynamically injects elements into the browser. You need to use the old overlays method, where you just define the overlays or something, but to be honest I've never used the old method.

OTHER TIPS

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.

If you want want to add your plugin to an SDK addon, i'm afraid that's not possible, as msfeldstein pointed out. Even if you you create the plugin directory and set <em:unpack>true</em:unpack> in the install.rdf, firefox won't load plugins if <em:bootstrap>true</em:bootstrap> is set.

As a workaround you can make a bundle xpi as described here containing your addon and another xpi that would be only a container for the plugin . That way you would have both the sdk addon and the plugin installed simultaneously.

I use this guide: http://devilsworkshop.org/shortest-tutorial-for-firefox-extensiontoolbar-development/, use an example of plugin http://pub.rtcamp.com/firefox/extensions/googbar.zip (change zip to xpi). For npPlugin.dll create folder plugins and put your plugin library there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top