Allow other browser extensions to invoke Zotero Connector's save action

I'm developing Tabglutton, a tab-management WebExtension for Firefox/Zen and Chrome. I would like to add an optional integration that routes academic papers to Zotero rather than clipping them directly into a notes application (e.g. Obsidian).

The intended flow is:

1. Tabglutton decides that a tab should be sent to Zotero—for example, an arXiv,
OpenReview, PubMed, bioRxiv, journal, or paper PDF page.
2. It asks the installed Zotero Connector to save that tab.
3. The Connector performs its normal detection and save workflow, just as if the user
clicked its toolbar button.

I have looked at using `zotero/translate` directly and pinning the translation framework,
translators, utilities, and schema as submodules. That appears technically possible, but
the translation framework deliberately leaves its consumer to implement translator
storage, HTTP access, and item saving. For this use case Tabglutton would also have to
recreate the browser integration around it: authenticated page access, proxy behavior,
item-selection UI, attachments and snapshots, progress and error handling, and the final
handoff to Zotero.

That would amount to maintaining a partial second Connector. Calling the installed Connector would instead use the same translator state and save behavior as its toolbar
button, including the translator updates the user already receives from Zotero.

There was an earlier discussion of essentially this API in zotero-connectors issue #60:

- A Tridactyl developer asked whether another extension could invoke Zotero:

- A Zotero maintainer suggested `chrome.runtime.onMessageExternal` and said a PR could be
accepted:

- The follow-up suggested passing a tab ID and validating callers with an allowlist:


That discussion was never separated from the keyboard-shortcut issue, and I could not
find a subsequent implementation.

Would Zotero still be open to a small, generic cross-extension API around the Connector's
existing save action? A minimal request might look something like:


{
"action": "saveTab",
"tabId": 123
}


The Connector would:

- listen through `runtime.onMessageExternal` on Firefox and Chromium;
- validate `sender.id` using whatever authorization model Zotero considers appropriate;
- run the same save operation as the toolbar button for the supplied tab; and
- return a structured result indicating whether the request was accepted and, if
practical, whether the save ultimately succeeded.

Only other extensions should be able to call this, not arbitrary websites. Possible
authorization models might include an explicit user-managed allowlist, a first-use
approval prompt, or a maintained list of known extension IDs. I would be interested to
know which approach Zotero would consider acceptable.

The domain-routing policy would remain entirely in Tabglutton. The proposed Zotero API
would simply expose the generic operation "save this browser tab using the installed
Connector", so it could also be useful to other tab managers and browser automation
extensions.

I am asking before building the separate translation stack because a narrow external
entry point seems preferable to maintaining two implementations of the same save action.

If this approach still makes sense to the Zotero maintainers, I would be interested in
working on a proof of concept or PR once the API shape, authorization model, and response
semantics are agreed.
Sign In or Register to comment.