zotero://select links not working with many items

  • @dstillman, it seems Zotero select links don't work correctly if they have more than about 223-227 item keys in them.

    I just tested this in Zotero 5.0.88 on Windows 7, by selecting all items in Zotero and extracting their keys:

    let selectedItems = ZoteroPane.getSelectedItems();
    let keys = "";

    for (i = 0; i < selectedItems.length; i++) {
    keys = [keys, ZoteroPane.getSelectedItems()[i].libraryKey].join(",");

    return keys.replace(/1\//g,"").replace(/^,/,"");

    For my library with >2400 items, entering the zotero://select/library/items?itemKey= link in the Firefox 78.0.2 address bar only selects the first 227 items in the string. With Google Chrome 84.0.4147.89, the link silently fails (Zotero doesn't come to the foreground), unless the link is truncated to 223 items or fewer (a 223 item select string is 2044 characters).

    Do you think this is a Zotero issue? https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers suggests most modern browsers can handle longer URLs.

    If this can't be fixed easily I can always modify Reference Extractor to chop up big select links in multiple links that each select no more than ca. 200 items.
  • It works for me on macOS with 7000+ items.

    Can you provide a Debug ID for clicking on a select link that doesn't work?
  • @Rintze: Well, wait, are you just talking about trying this from browser address bars? I'm testing from a Zotero note, which works fine.
  • But, no, 7000+ items also works fine from Firefox and Chrome on macOS.
  • Yeah, it works for me as well with Safari/Firefox/Chrome on macOS 10.14.6. Maybe it's a Windows thing. I received this as user feedback, so it's not just me.

    I'll try the Debug ID when I'm back on Windows.

    (and yes, I offer users in-browser select links: https://twitter.com/rintzezelle/status/1143315626079006722)
  • edited July 20, 2020
    @dstillman: D1895881691 (pasted the select link into the address bar of Firefox on Windows 7, which selected the first 227 items)

    P.S. The user who first reported the issue used Windows 10 and Google Chrome, and they also experienced silent failure (Zotero doesn't pop to the front and no items are selected).
  • Same problem here on Windows 10. Had to fire up my old MacBook Air and install Zotero on it in order to select my references (498 references). Good thing I had a Mac...
Sign In or Register to comment.