Chrome, Safari: Cannot use unapi when DOI or embedded metadata present

I am running into problems on Chrome and Safari using the unapi interface to get publication metadata. I have submitted reports with the following numbers via the extension's respective interfaces: Report ID:1430974671 for Chrome, and Report ID:2108466827 for Safari. I am on the latest Firefox, Safari, and Chrome, with a fully updated Mac running Mavericks, using Zotero standalone.

I am rebuilding a site right now (public qa is here: https://pubs-test.er.usgs.gov) and just added an unapi interface for some publications so that I can populate all of the relevant Zotero fields using the bibliontology format.

However, I have discovered that in the latest version of Chrome and Safari on Mac, the Zotero standalone connectors don't seem to be picking up the unapi endpoint, instead trying to use either the DOI if it is there or the embedded google scholar metadata.

From my understanding, (based on https://www.zotero.org/support/dev/translators/priority ), unapi should be used preferentially to either DOI or embedded metadata, as the unapi translator has a priority of 300 (https://github.com/zotero/translators/blob/master/unAPI.js , line 8) while DOI has a priority of 320 (https://github.com/zotero/translators/blob/master/DOI.js, line 8) and Embedded metadata has a priority of 400 (https://github.com/zotero/translators/blob/master/Embedded Metadata.js, line 8)

On Firefox, using the Zotero Extension, I see the appropriate behavior based on the above priorities.

On this page, which has the unapi <abbr> tag enabled(along with DOI and embedded metadata), the Firefox Zotero extension grabs data from unapi
http://pubs-test.er.usgs.gov/publication/sir20145213


Similarly, on this link, where there is unapi and embedded metadata (but no DOI), Firefox Zotero extension also gets the unapi data.
http://pubs-test.er.usgs.gov/publication/ofr20101263

and on this page, where there is a DOI and embedded metadata (but no unapi), the Firefox Zotero extension uses the DOI as expected:
http://pubs-test.er.usgs.gov/publication/70135619

and on this page, where there is only embedded metadata, the embedded metadata is used by the Firefox Zotero extension:
http://pubs-test.er.usgs.gov/publication/1003996

On Chrome and Safari, it seems like the unapi endpoint just isn't there. On the first link (http://pubs-test.er.usgs.gov/publication/sir20145213 ) the Zotero connector instead goes for the DOI information, and on the second one (http://pubs-test.er.usgs.gov/publication/ofr20101263 ), it uses the embedded metadata.


Looking at the Javascript console in developer tools on both Chrome and Safari, I am getting the same error, and only on pages that have the unapi <abbr> tag (the first and second links)

ReferenceError: Invalid left-hand side in assignment at chrome-extension://ekhagklcjbdpajgpjgmbionohlpdbjgc/inject/translate_inject.js:50
chrome-extension://ekhagklcjbdpajgpjgmbionohlpdbjgc/zotero.js:144 logError

which is pointing to this bit of javascript that is shared between both connectors, and which from the name, looks rather suspect.

https://github.com/zotero/zotero-connectors/blob/master/src/common/inject/translate_inject.js

Unfortunately, I do not have the javascript chops to actually diagnose and fix the problem, but hopefully I have given enough information that it can be fixed without me building a site-specific translator for no good reason. Thanks!
  • Versions:
    Zotero: 4.0.23
    Chrome: Version 39.0.2171.95 (64-bit)
    Chrome Connector: 4.0.21
    Safari: Version 7.1.2 (9537.85.11.5)
    Safari Connector: 4.0.21
    Firefox: 34.0
  • Just out of curiosity, I created a new translator with scaffold by tweaking the existing unAPI translator just for pubs-test, but with a priority of 100. That works perfectly on Firefox, but causes the same javascript error in Chrome and Safari.
  • Update your translators via Preferences -> General -> Update Now, restart browser and try again.

    The Bibliontology RDF translator was not compatible with Chrome/Safari, but it should be now.
  • Works a treat! Thank you much for solving the problem! I had actually already written another translator to generate zotero rdf (which incidentally does work) but I will pull that out and focus on expanding the bibliontology format instead.
Sign In or Register to comment.