Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:client_coding:plugin_development [2020/09/27 05:18] dstillmandev:client_coding:plugin_development [2023/11/14 03:41] (current) – [Introduction to Zotero Plugins] dstillman
Line 5: Line 5:
 ===== Introduction to Zotero Plugins ===== ===== Introduction to Zotero Plugins =====
  
-Zotero plugins run within the Zotero desktop app and are built on the same technologies as legacy (pre-WebExtension) Firefox extensions and interact with Zotero's internal [[dev/client_coding/javascript_api|JavaScript API]]. +Zotero plugins run within the Zotero desktop app and interact with Zotero's internal [[dev/client_coding/javascript_api|JavaScript API]] and internal Firefox APIs.
- +
-If you plan to write a plugin, you can start by taking a look at [[:plugins|existing plugins]] such as [[https://github.com/jlegewie/zotfile|ZotFile]]. (The official [[dev/sample_plugin|Hello World Zotero plugin]] is currently extremely dated.)+
  
 +If you plan to write a plugin, you can start by taking a look at the [[https://github.com/zotero/make-it-red|official sample plugin]] as well as [[:plugins|existing third-party plugins]].
 ===== Alternatives to Zotero Plugins ====== ===== Alternatives to Zotero Plugins ======
  
Line 20: Line 19:
  
   - Close Zotero.   - Close Zotero.
-  - Create a text file in the 'extensions' directory of your [[kb:profile_directory|Zotero profile directory]] named after the extension id (e.g., myplugin@mydomain.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.+  - Create a text file in the 'extensions' directory of your [[kb:profile_directory|Zotero profile directory]] named after the extension id (e.g., myplugin@mydomain.org). The file contents should be the absolute path to the root of your plugin source code directory, where your install.rdf or bootstrap.js file is located.
   - Open prefs.js in the Zotero profile directory in a text editor and delete the lines containing ''extensions.lastAppBuildId'' and ''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.   - Open prefs.js in the Zotero profile directory in a text editor and delete the lines containing ''extensions.lastAppBuildId'' and ''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 ''-purgecaches'' flag to force Zotero to re-read any cached files. (You'll likely want to make an alias or shell script that also includes the ''-ZoteroDebugText'' and ''-jsconsole'' flags and perhaps ''-p <Profile>'', where ''<Profile>'' is the name of a development profile.)+  - Whenever you make changes to your plugin code, start up Zotero from the command line and pass the ''-purgecaches'' flag to force Zotero to re-read any cached files. (This may no longer be necessary with Zotero 7.) You'll likely want to make an alias or shell script that also includes the ''-ZoteroDebugText'' and ''-jsconsole'' flags and perhaps ''-p <Profile>'', where ''<Profile>'' is the name of a development profile.
dev/client_coding/plugin_development.1601198335.txt.gz · Last modified: 2020/09/27 05:18 by dstillman