zotero/translators — pull request #442 by simonster (2012-08-19 23:26:32+00:00)
Title: Fix saving PDFs in Wiley Online Library when translation occurs via connectors

On each abstract/full text pages, Wiley Online Library includes a link that points to a PDF. This URL is the same across browsers, but the content served from it is not. In most browsers, Wiley serves an HTML page with an iframe that contains the PDF. However, for the browsers whose User-Agent string contains "Safari/", Wiley instead serves the PDF directly, with no iframe. The same URL thus points to different content depending on the browser.

This patch takes this behavior into account by inspecting the browser's User-Agent string. If it contains "Safari/", it directly attaches the PDF link URL. Otherwise, it loads the iframe and pulls the PDF link out of it.

To work properly with Zotero Standalone, this requires a current 3.0 branch build (post-c81c9478d9fc3cb71b482edcd89e5ec6ce19d923), so that Zotero Standalone uses the browser's User-Agent when retrieving the PDF.

First reported at http://forums.zotero.org/discussion/22409/wiley-online/#Item_9

(New pull request because the commit message was truncated in the previous one.)