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

Add "Save to Zotero (PDF)" to context menu when right-clicking on a framed PDF #152

Open
dstillman opened this issue Jul 24, 2017 · 11 comments

Comments

@dstillman
Copy link
Member

This is useful when viewing a framed PDF that isn't recognized by a translator, since it avoids having to do This Frame -> Show Only This Frame in Firefox (and that's not even an option in Chrome?).

@dstillman dstillman changed the title Add "Save to Zotero (PDF)" to Zotero Connector submenu when right-clicking on a framed PDF Add "Save to Zotero (PDF)" to context menu when right-clicking on a framed PDF Jul 24, 2017
@dstillman
Copy link
Member Author

This is fx-parity due to the removal of the open/save dialog modification. Previously, you could just click the download icon in the PDF viewer and save to Zotero that way.

@adomasven
Copy link
Member

Do we have any example URLs?

@dstillman
Copy link
Member Author

@adomasven
Copy link
Member

Seems like we need to talk upstream if we want this. Chrome does not show addon context-menus in PDFs completely. Firefox does, but the finest way you can filter these are either by showing to all frames or matching url regex.

Although if we're taking this upstream we may as well just ask for #83

@dstillman
Copy link
Member Author

dstillman commented Jul 24, 2017

Chrome does not show addon context-menus in PDFs completely

I have a 1Password menu item when right-clicking on a framed PDF in Chrome (but probably for all frames).

Although if we're taking this upstream we may as well just ask for #83

I already did — they're very unlikely to do something tied to the current UI in that way. But there might be other options involving download notifications (which may or may not work for us).

Can we tell whether there's a PDF in an iframe from the parent page? What about adding a "Save to Zotero (PDF)" option to our own context menu in that case?

@adomasven
Copy link
Member

I have a 1Password menu item when right-clicking on a framed PDF in Chrome (but probably for all frames).

Oh yeah, that actually works.

Can we tell whether there's a PDF in an iframe from the parent page? What about adding a "Save to Zotero (PDF)" option to our own context menu in that case?

We could check for frames with content-type application/pdf with web request intercepting. We could then add a "Save to Zotero (PDF)" with context set to frames, but that would add that context-menu option to all frames, including non-pdf ones. (Seems like we could actually do this properly in safari)

I'm not really a huge fan of adding the context option to all frames, but you'd have to, since there may be multiple frames with pdfs and you need to know which one to get.

@dstillman
Copy link
Member Author

To be clear, I mean adding an option to the save button context-menu when there's a PDF iframe on the page, so that even if the main icon was for Web Page you'd still have PDF as an option. (I'm not worried about there being multiple. We could just grab the first one.)

@adomasven
Copy link
Member

Alternative plan. Chrome contextMenu.onClicked event provides frameId and frameUrl, so we can just add Save frame to Zotero as Snapshot context-menu option for frames.

@dstillman
Copy link
Member Author

I mean adding an option to the save button context-menu when there's a PDF iframe on the page, so that even if the main icon was for Web Page you'd still have PDF as an option

Actually, thinking about this more, If there's an iframe with a PDF and a translator isn't triggering on the page, we should just show the PDF icon. That's almost always what people will want.

@adomasven
Copy link
Member

Actually, thinking about this more, If there's an iframe with a PDF and a translator isn't triggering on the page, we should just show the PDF icon. That's almost always what people will want.

The alternative plan is super elegant and easy to implement, so let's start with that one and if people are still very confused/annoyed we'll do this.

@dstillman
Copy link
Member Author

The alternative plan is super elegant

Right-clicking on a page and talking to users about "frames" is not remotely super elegant. The elegant solution here is make the action that people are going to want the vast majority of the time the default button click. That's the priority here.

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

No branches or pull requests

2 participants