Is this page on the setting of the development environment outdated?

135 views
Skip to first unread message

le zhang

unread,
Aug 8, 2023, 6:27:09 PM8/8/23
to zotero-dev
Hi, there

I followed the Setting Up a Plugin Development Environment part of this [document](https://www.zotero.org/support/dev/client_coding/plugin_development), but only to find that the text file named after my extension ID disappeared after I restarted Zotero (as stated in the second step). 

In the file named after the extension ID is one line containing only the absolute path directing to the bootstrap.js file of the make-it-right 2.0: 

> /Users/myname/absolute/directory/make-it-red/src-2.0

I am suspecting that the above content should be not enough, but that is all what is described in the documentation. 

What am I missing? Or the documentation is outdated?

Best, 

Lerner

le zhang

unread,
Aug 8, 2023, 7:54:43 PM8/8/23
to zotero-dev
The problem is not only that the text file was removed but also that the plugin directly from the source directory was not installed at all. 

Dan Stillman

unread,
Aug 8, 2023, 8:01:14 PM8/8/23
to zoter...@googlegroups.com
On 8/8/23 10:01 AM, le zhang wrote:
> In the file named after the extension ID is one line containing only
> the absolute path directing to the bootstrap.js file of the
> make-it-right 2.0:
>
> > /Users/myname/absolute/directory/make-it-red/src-2.0
>
> I am suspecting that the above content should be not enough, but that
> is all what is described in the documentation.
>
> What am I missing? Or the documentation is outdated?
>

No, those steps definitely still work.

Can you explain exactly what you're doing, step by step, in your own words?

You can also check the error console or terminal output for potential
warnings — usually something is logged when it removes an extension.

le zhang

unread,
Aug 8, 2023, 8:13:26 PM8/8/23
to zotero-dev
Here are the relevant steps in the documentation: 
  1. Close Zotero.
  2. Create a text file in the 'extensions' directory of your Zotero profile directory named after the extension id (e.g., mypl...@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.
  3. 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.
and here is my process: 
1. I closed Zotero 7 beta
2. I created a text file in the 'extensions' directory of my Zotero profile directory named after the extension id: myproj...@mydomain.com. I copy-pasted `/Users/myname/absolute/directory/make-it-red/src-2.0` to the text file and saved it. 
3. Opened prefs.js in the Zotero profile directory in vim and deleted the lines containing extensions.lastAppBuildId and extensions.lastAppVersion . Saved the file and restarted Zotero. 

Then I saw nothing on the Zotero add-ons manager pane, and the file containing only the absolute path was removed. 

Best,
Lerner

Dan Stillman

unread,
Aug 8, 2023, 8:26:50 PM8/8/23
to zoter...@googlegroups.com
On 8/8/23 8:13 PM, le zhang wrote:
> 2. I created a text file in the 'extensions' directory of my Zotero
> profile directory named after the extension id:
> myproj...@mydomain.com. I copy-pasted
> `/Users/myname/absolute/directory/make-it-red/src-2.0` to the text
> file and saved it.

If you're setting myproj...@mydomain.com and pointing it to
make-it-red, that's not going to work (and it will log a warning about
that). The id has to match what's in manifest.json.

le zhang

unread,
Aug 8, 2023, 9:31:15 PM8/8/23
to zotero-dev
Here is the modified manifest.json: 
```
{
"manifest_version": 2,
"name": "myproject",
"version": "2.0",
"description": "my description",
"homepage_url": "https://github.com/myname/myproject",
"applications": {
"zotero": {
"id": "mypr...@mydomain.com",
"update_url": "https://zotero-download.s3.amazonaws.com/tmp/myproject/updates-0.1.json",
"strict_min_version": "6.999",
"strict_max_version": "7.0.*"
}
}
}
```

Sorry the myproj...@mydomain.com file was not removed, but the plugin does not appear on the add-ons manager pane. 

XY Wong

unread,
Aug 8, 2023, 9:45:29 PM8/8/23
to zotero-dev
If you are on Windows, be aware that the path uses the separator `\`, not `/`.

le zhang

unread,
Aug 8, 2023, 9:49:07 PM8/8/23
to zotero-dev
I see nothing related to my issue in the Tools > Developer > Error Console, and an additional error occurred after a click: 

> TypeError: this.gViewSourceUtils is undefined

Message has been deleted

le zhang

unread,
Aug 8, 2023, 9:51:30 PM8/8/23
to zotero-dev
No, my OS is macOS Monterey with its chip as Apple M2

XY Wong

unread,
Aug 8, 2023, 9:58:01 PM8/8/23
to zotero-dev
That error is not related.

Please make sure you are using `Cmd+Q` or Zotero -> Quit to quit Zotero. Simply closing the main window won't quit Zotero.

le zhang

unread,
Aug 8, 2023, 10:24:14 PM8/8/23
to zotero-dev
Thanks for reminding me of that. Unfortunately it's not about how I quit Zotero. I followed your suggestion, but the error persists. And I've not changed any code except the manifest.json. 

Dan Stillman

unread,
Aug 8, 2023, 11:30:13 PM8/8/23
to zoter...@googlegroups.com
Did you test with one of the Make It Red versions and make-...@zotero.org?

le zhang

unread,
Aug 9, 2023, 1:44:31 AM8/9/23
to zotero-dev
That's the exact debug process I should have conducted, but I didn't test that way since I had succeeded in dragging the original and the modified Make It Red to the add-ons pane and making them both work. 

I gave that method a try, but it was of no avail. 

Message has been deleted

le zhang

unread,
Aug 9, 2023, 3:56:50 AM8/9/23
to zotero-dev
Thanks! It works. 

Here is how I make it work: 

1. when I asked the question the text file was located in the wrong directory
2. but when I relocated the file it still didn't work; tried many times
3. I uninstalled the Zotero and removed the profiles directory under Application Support
4. installed the 7 beta; and mkdir of the extensions directory
5. follow the documentation, and it works now

Reply all
Reply to author
Forward
0 new messages