Adding pdf via connector - how is the PDF detected?

When you use the browser connector, how is the PDF detected? Is this a function of the connector, or a function of Zotero?
  • what exactly do you mean by this? Both "the PDF" and "detected" arent' quite clear to me in this context. You mean when you're looking at a PDF in the browser or when it auto-downloads a PDF during import?
  • edited July 30, 2018
    Suppose you're on a page for a paper, which (somewhere) has a link to the paper's PDF. When you click the Zotero button, the browser extension does some work, then sends data via http to Zotero, and then Zotero does some work. The end result is an entry, with metadata and a PDF attachment.

    My question is:
    (1) Does the browser extension pass the link (to the PDF) to Zotero?
    Or
    (2) does Zotero just receive the metadata (without link to the PDF), and then downloads the html page (of the paper) to determine the link to the PDF?

    I was assuming that it would be (1), but having looked at the standalone translation-server, I suspect it might be (2).

    Hope that's makes sense - sorry for being vague!

  • It's basically 1) or more specifically, the browser extension makes a GET request and passes the file on to Zotero, which evaluates the mimeType and discards the file if it has the wrong mimeType (e.g. when it gets a login page instead of a PDF)

    A good way to understand how these things happen is just to read through the debug logs for a translation process.
  • edited July 30, 2018
    How does the browser extension know where the PDF is? From the page metadata? Or does it look for a prominent link to a PDF?

    > A good way to understand how these things happen is just to read through the debug logs for a translation process.

    That's helpful - thanks!

    (Edit: Actually, having thought about it, it's obvious that it's the connector fetches the PDF - the browser has the login/cookies, so Zotero wouldn't always be able to retrieve the file.)
  • That depends on the specific translator being used on the page: https://github.com/zotero/translators/
Sign In or Register to comment.