Unable to load plugin from source by following instructions in documentation

I tried to load an unpacked extension from its source code by following the instructions here: https://www.zotero.org/support/dev/client_coding/building_the_standalone_client

Specifically, this part: "You can run Firefox extensions from source code in Zotero the same way you could in Firefox. Create an extensions directory in the Zotero profile directory and create a file named after the id in the extension's install.rdf (e.g. zotplugin@example.com) containing the path to the extension source code. The extension will then be automatically installed when you start Zotero."

It does not appear to even try to load the extension. I've checked the debug log and the error window and neither one gives any indication that the extension was loaded or tried and failed to load.

Has this feature been removed?
  • Sorry about that — newer versions of Firefox, on which Zotero is based, have made this a little more finicky, but it still works. I've created a documentation page with the current instructions for doing this, and changed the above section to point to there.
  • Great—thank you.
  • Just tried it out. Easy and works a treat—thanks again! Now if only I were any good at coding...
  • Hi. I followed the updated indications and I can't get it to work. Am I missing something? Did something change?
  • edited December 7, 2022
    Ok. I found the issue. The path to the add-on folder specified in the text file should not be absolute, but relative to the extensions folder.

    Zotero's error log was telling me that C:/…/Zotero/…/extensions/D:/Codes/my-addon doesn't exist.

    That's a bit annoying since my app data (including the extensions folder) is on C: and the code I work on D:. I tried with a link / shortcut to the folder of the add-on I'm working on, but Zotero doesn't follow it and considered that the folder doesn't exist. But hey… Not a huge deal. I'll move files around when I'm done.

    (Also, if anyone is wondering, the text file must not have a .txt suffix. The whole name including the file extension if any must match the add-on id declared in install.rdf.)
  • edited December 7, 2022
    The path to the add-on folder specified in the text file should not be absolute, but relative to the extensions folder.
    That's…not correct? This is ancient Firefox extension functionality, and using the absolute path has always been the documented way to do this. It's possible a relative path works too, but it's certainly not necessary. Are you using slashes instead of backslashes?
  • edited December 7, 2022
    … It… does work. Now.

    I had tried with / and \, with or without a tailing slash, nothing was working. No, remove the add-on, remove the text file… start over with an absolute path, it works. Try with something on D:, it works. (I must have done something wrong then. Something else.)

    I guess the error log with …/extensions/D:/… was because it checks as an absolute path, then relative, then raise the error (while failing with a relative path).

    Thank you anyway. And now I can code in the right directory. :)
  • PS: I feel like it would be nice to add the last link you shared in your “Zotero Plugin Development” page. I have a hard time finding explanations on how to build an add-on, and this page seems like a nice introduction. (Because such tutorials are not valid for Firefox anymore, it's pretty hard to find them and understand they are relevant when you just start out.)
  • No, too much of it is isn't relevant to Zotero plugin development. The best source of information is our documentation and the source code of existing Zotero plugins.

    If you're starting from scratch, make sure you've reviewed Zotero 7 for Developers.

    Post to zotero-dev if you have questions.
Sign In or Register to comment.