Feature request: click on doi link opens local files (if they exist)

edited November 15, 2022
A common practice in my field (astronomy) is to have each bibliography item point to its DOI with a regular URL (e.g. https://doi.org/10.1093/mnras/stx2744).

Would it be possible to add a handler for doi.org URLs with the following behaviour:
- if the corresponding DOI exists in the library, open the local file in a new tab,
- else, open the URL with the browser?

This would allow navigating the library more efficiently than manually searching each citation's name/title/doi into Zotero.

Or should it be instead be provided through a plugin?
  • Intercepting https links is definitely not something Zotero would do -- even if pref'ed, I'd argue that borders on malicious behavior. I'm not even sure a browser will *let* you add a custom handler for a standard URL, but if that's possible then yes, it'd definitely have to be an add-on.
  • While intercepting links in a normal browser presents issues, couldn't this still be allowed in the Zotero application* itself?

    (* even if it is built on ~top~ of a browser engine, it's not exposing a normal web browsing user interface)
  • I'm not even sure what the request is here. Intercept what links where?

    We're certainly not going to intercept DOI links in the browser using the Zotero Connector. The Zotero app isn't going to (and can't) intercept links elsewhere on the system. And within Zotero we control the functionality, so there wouldn't be any need to intercept anything — if something should select an item, that should be a distinct UI element.
  • Whether or not it was what the original poster meant, I was envisioning something like:

    In the Zotero desktop app itself (not 'Zotero Connector'), if an item had a 'doi:' URI within a metadata field (such as 'extra:similar:' or perhaps a list of them in the item 'notes'), and Zotero already contained an item matching that exact DOI, that item would be selected without opening a web browser and loading from the network.
    - (This could provide an almost wiki-like/hypertext linking between items that would work even if offline. A list of related DOIs could be copied in from a notepad or e-mail, for example. Also, if the data is ever copied or exported out of Zotero, useful context might be preserved, compared to a Zotero-specific link structure.)


    If this was implemented, it should still probably be controlled by an 'off-by-default' preference such as "When a matching item exists in My Library (or in a Shared Library), clicking a DOI link selects that item in Zotero instead of opening in a web browser."
  • I would also be more than happy to have such a function! Any news since then?
  • edited July 21, 2023
    The zotero-reference addon has a version of that type of functionality.

    It first gets a list of a paper's cited references list (either by API call to Crossref, or text parsing of the PDF), which it places under the (new) References tab in the right pane. Then in the background it checks each reference (by DOI) to see if it is already in the library (such references can be made to appear in darker text in the list). When you hover your mouse over such a reference in the list, a pop-up window will open that has more information on the reference, and also a red 'Zotero' button. Click on that button and you are taken to that reference's item, in the current collection if it exists there, or the main library if not. If you instead hover over a reference that is not in your library (or the lookup has failed even though you have that reference - lookup is not 100% foolproof, eg if no DOI), then the window may instead have a yellow 'DOI' button that you can click on. That will open your browser at the URL for that DOI (where of course the Zotero Connector can download it).

    Some discussion of the addon here:
    https://forums.zotero.org/discussion/103205/is-it-possible-to-extract-references-from-article-pdfs-webpage

    The Cita addon also has some similar functionality.
Sign In or Register to comment.