Plugin Development - Noob

103 views
Skip to first unread message

Lena Gieseke

unread,
Jun 12, 2014, 5:05:12 AM6/12/14
to zoter...@googlegroups.com
Hey everyone,
I would like to get into programming a Plugin for the Standalone Zotero Version. I am a fairly good programmer but have no experience with Java Script and/or serious web-programming.

Unfortunately I am currently failing to get the Hello World Plugin to run. I looked through the website but couldn't find any complete, noob-compatible information. So my first question is, and, yes, sorry in advance if I should know this myself, but I currently just don't:
How to install the hello-world-master code in zotero? I believe I need a .xpi file. How to write/create it?

Second question: any recommended resource that might help me on my way?

Thanks!
Lena

Dan Stillman

unread,
Jun 12, 2014, 5:25:55 AM6/12/14
to zoter...@googlegroups.com
On 6/12/14, 5:05 AM, Lena Gieseke wrote:
> Hey everyone,
> I would like to get into programming a Plugin for the Standalone
> Zotero Version. I am a fairly good programmer but have no experience
> with Java Script and/or serious web-programming.
>
> Unfortunately I am currently failing to get the Hello World Plugin to
> run. I looked through the website but couldn't find any complete,
> noob-compatible information. So my first question is, and, yes, sorry
> in advance if I should know this myself, but I currently just don't:
> How to install the hello-world-master code in zotero? I believe I need
> a .xpi file. How to write/create it?

An XPI is just a ZIP file, so if you clone the sample plugin from Git
and zip up that directory (e.g., 'zip ../zotero-hello-world.xpi *' from
within it), you should have a working XPI that you can install from the
Add-ons window in Zotero Standalone (at least, if that sample code still
works, which it might not — it's quite old).

But for actual development, you'll want to run from the local Git repo
directly. See the steps for Zotero for Firefox here:

https://www.zotero.org/support/dev/source_code#working_with_git_repositories

You can follow those steps for your own plugin, replacing
'zot...@chnm.gmu.edu' with the id of your plugin in the install.rdf
file. To do this in Zotero Standalone, you'll need to go into the Zotero
Standalone profile directory [1] instead of the Firefox profile
directory. If you've set it up properly, you'll see your extension
listed in the Add-ons window, and you'll be able to see changes just by
restarting Firefox/Standalone.

> Second question: any recommended resource that might help me on my way?

There's some documentation on the wiki [2], but your best bet (once
you've set up your overlay and include.js) is probably the Zotero
codebase itself, particularly the zoteroPane.js file, which operates
from the same scope you'll likely be using and includes many of the
UI-initiated operations in Zotero. You can also look at the code for
some other Zotero plugins [2] to see what they do, with the caveat that
they might not all follow best practices.

Feel free to ask specific questions you have while you work on this.

- Dan

[1] https://www.zotero.org/support/kb/profile_directory
[2] https://www.zotero.org/support/dev/client_coding/javascript_api
[3] https://www.zotero.org/support/plugins

Lena Gieseke

unread,
Jun 12, 2014, 7:06:13 AM6/12/14
to zoter...@googlegroups.com
Hi Dan,
thanks for your reply. I forgot to mention that I did actually try the xpi extension of the zipped folder and it gave me the following: 
The add-on "%S" could not be installed. It may be incompatible with this version of Zotero Standalone.
I tried changing the "maxVersion" fields in the install.rdf but that didn't help.

I will try to get the Git repo code working next. Thanks for the links!

Best,
Lena




--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+unsubscribe@googlegroups.com.
To post to this group, send email to zoter...@googlegroups.com.
Visit this group at http://groups.google.com/group/zotero-dev.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages