Zotero Plugin Development
This page is a work in progress.
Introduction to Zotero Plugins
Alternatives to Zotero Plugins
The Zotero Plugins page (which takes an expansive view of the term “plugin”) can be very helpful in helping you develop your own Zotero-based tools.
Setting Up a Plugin Development Environment
When developing a Zotero client plugin, it's helpful to have Zotero run the plugin directly from source. After creating your plugin's source directory with sample code, you can tell Zotero to load the plugin by creating an extension proxy file. (This is a technique that used to be possible for Firefox extension development, though it's since been discontinued in Firefox.)
- Close Zotero.
- Create a text file in the 'extensions' directory of your Zotero profile directory named after the extension id (e.g., firstname.lastname@example.org). The file contents should be the absolute path to the root of your plugin source code directory, where your install.rdf file is located.
- Open prefs.js in the Zotero profile directory in a text editor and delete the lines containing
extensions.lastAppVersion. Save the file and restart Zotero. This will force Zotero to read the 'extensions' directory and install your plugin from source, after which you should see it listed in Tools → Add-ons. This is only necessary once.
- Whenever you start up Zotero after making a change to your extension code, start it from the command line and pass the
-purgecachesflag to force Zotero to re-read any cached files. (You'll likely want to make an alias or shell script that also includes the
-jsconsoleflags and perhaps
-p <Profile>, where
<Profile>is the name of a development profile.)