zotero/zotero-connectors — pull request #23 by aurimasv (2014-05-24 04:17:57+00:00)
Title: Expose doHead to connectors

This is to complement zotero/zotero#441 and to allow (at this point) Airiti translator to resolve DOIs to Airiti URLs for metadata retrieval.

Resolving DOI URLs only works in Chrome/Opera and requires the webRequest API, which will only work from the background page. Thus, I moved the other do* requests to the background page as well, since there is no downside to this (that I know of) for Chrome.

For Safari, I don't know if it's possible to figure out the final URL of an HTTP request, so the responseUrl will simply always remain the requestUrl and translators will have to deal with it (i.e. fail). The doGet and doPost methods remain as they were (content by default and background if it's cross-origin). I _have not_ tested this in Safari.

You might think this approach is hackish, in which case, I would gladly take a different approach that you may suggest.