Hi!
I'm contributing to Cita, a citation management plugin for Zotero, which fetches references from sources like OpenAlex and Semantic Scholar and allows the user to edit the fetched citations/references. These citations are stored as "virtual" Zotero.Item elements in an item's note, in JSON format. To edit these citations, the user clicks on them in the item pane, which opens our custom `citationEditor.xhtml` dialog. The dialog relies on Zotero's custom <info-box> (formerly <item-box>) to display the "virtual" item's values and edit them.
Amongst others, the dialog's loading script adds the <info-box> element to the window's DOM and adds a React component below it for our needs. In order to make this work, the window's XHTML source first loads the following scripts:
- chrome://zotero/content/include.js
- chrome://zotero/content/customElements.js
- chrome://__addonRef__/content/scripts/dialogs/editor/index.js
The relevant files at the time of writing are:
The whole setup works really well, but we've run into an obscure bug (which doesn't seem to affect functionality). When the user clicks on the "..." toolbar button next to title-like fields (title, book title, etc.) within this dialog (or makes the relevant context menu appear by right-clicking), a slew of error messages appear in the console:
- Uncaught TypeError: this.delayConnectedCallback is not a function
connectedCallback menupopup.js:56
triggerPopup itemBox.js:689
openEditor citationsBox.tsx:86
- Uncaught TypeError: el.render is not a function
<anonymous> menu.js:170
handlePopupOpening itemBox.js:2658
triggerPopup itemBox.js:693
openEditor citationsBox.tsx:86
3. Uncaught TypeError: this.ensureInitialized is not a function MozMenuPopup menupopup.js:49
handlePopupOpening itemBox.js:2658
triggerPopup itemBox.js:693
openEditor citationsBox.tsx:86
(I've trimmed the call stack to the openEditor function, which is called from the item pane and opens the editor).
As I mentioned, the title casing commands related to these context menus work, but it's not ideal to have the log "polluted" by errors. It seems to me that the menupopup that is created when clicking on that button is of the wrong "type", respectively does not contain the relevant Moz mixins. It's been very hard to track down since this is part of the Mozilla code Zotero is absed on, not Zotero's own code.
In summary: is there a JS file that I'm missing somewhere?
Thanks in advance!