zotero / translators

Zotero Translators
http://www.zotero.org/support/dev/translators
1.3k stars 761 forks source link

Emerald Insight: Use new (?) API endpoint for RIS #3332

Closed dstillman closed 2 months ago

dstillman commented 4 months ago

https://forums.zotero.org/discussion/115744/emerald-insight-translator-issus-wrong-year-of-publication-first-online-date-instead-is-captured

AbeJellinek commented 4 months ago

I'm not totally sure that we can do this on MV3. The new endpoint requires a XSRF token that's stored in a cookie, and AFAICT we don't have access to doc.cookie on MV3.

@mrtcode: Would it be possible to copy cookies into the sandbox?

dstillman commented 4 months ago

That would be @adomasven. But I think we have cookies. Otherwise all sorts of things (e.g., any gated site that required a subsequent HTTP request) wouldn't be working. (It might not work in Safari, though.)

AbeJellinek commented 4 months ago

Sorry, getting mixed up with my mentions…

We have cookies, but I don’t think a translator can programmatically access them, which is what we need here. We need to get the value of a cookie and add it as a query param on a request, in addition to sending it as a cookie along with the request. The site wants both.

adomasven commented 3 months ago

doc.cookie not available with MV3, but trivial to expose. On other platforms it's already accessible. Should I expose it on the MV3 Connector?

AbeJellinek commented 3 months ago

Yeah, that would be helpful.

adomasven commented 3 months ago

Done on master.