Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show PDF icon for page with PDF iframe and no translator #155

Closed
dstillman opened this issue Jul 28, 2017 · 8 comments
Closed

Show PDF icon for page with PDF iframe and no translator #155

dstillman opened this issue Jul 28, 2017 · 8 comments

Comments

@dstillman
Copy link
Member

#152 (comment)

@dstillman
Copy link
Member Author

(If there are multiple we can save the first one, but that will almost never happen.)

@dstillman
Copy link
Member Author

The downside, I guess, is that we would have to run a document.querySelector('iframe') call on every page without a translator, but hopefully that would be very fast.

@dstillman
Copy link
Member Author

The implementation in c379343 seems way more complicated than I was thinking — I was assuming we would just look for an iframe with a URL with a path (not counting query string) that ended in .pdf and hope for the best.

But it also doesn't seem to be working for me. E.g., I'm not seeing a PDF icon on either https://www.cs.tut.fi/~jkorpela/html/iframe-pdf.html or https://pdfobject.com/static.html.

The latter page also shows a couple other techniques (object and embed) that can be used for PDF embedding, both using type="application/pdf", that I imagine we could easily look for with querySelector from the main page.

@dstillman dstillman reopened this Aug 12, 2017
@adomasven
Copy link
Member

Both pages work for me on Chrome, Firefox and Safari.

@dstillman
Copy link
Member Author

Working for me now. I guess maybe I was testing with Zotero closed? To support that I guess we'd have start sending URLs and cookies up to the API (and hoping sites don't have same-IP restrictions on cookies)?

@adomasven
Copy link
Member

Detection works fine with Zotero closed. We don't support saving standalone PDFs to server now regardless of whether they are in a frame or not.

@dstillman
Copy link
Member Author

PDF detection does not work for me in either Chrome or Firefox with Zotero closed. (It works if I just close Zotero while it's already showing a PDF icon and reload, but not if I close the tab and reopen it.)

@adomasven
Copy link
Member

adomasven commented Aug 15, 2017

Detection works fine with Zotero closed.

Ok, so detection actually doesn't work, but it doesn't really matter, because PDF saving to zotero.org doesn't either. We will revisit this once PDF saving to zotero.org is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants