Zotero 4.0.12 does not respect "Always ask" action for PDF files

Hello,

I'm using Zotero 4.0.12 with Firefox 23 on Linux x86_64.

As the title says, Zotero 4.0.12 does not respect the "Always ask" action for PDF files. It actually works for the current session but not after I restart Firefox.

Steps to reproduce:
1. Set the action for PDF documents to "Always ask" (using the Firefox preferences dialog).
2. Restart Firefox
3. Double-click on a document in the Zotero library.

Result: Zotero opens the document in the default document viewer or previews the document in Firefox using the internal pdf viewer (observation: It actually executes the last non-"Always ask" action).

Expected result: Zotero should popup the "You have chosen to open..” dialog.

Cheers!
  • Zotero doesn't do anything with that setting. It either opens files in Firefox or, if there's no internal viewer for the file type or extensions.zotero.launchNonNativeFiles is set to true in about:config, it sends them to the OS for opening. It's possible that that setting has some effect on Zotero's test for whether there's a plugin for the file type, but it's not something we check directly.
  • I can reproduce this, though.

    Basically, that dialog is never supposed to show up to begin with—it doesn't really make sense, since it offers an option to save the file, and even the absurd option to save the file back into Zotero. So the fact that you're seeing it all is the actual bug here.

    I think what's happening is that when the setting is changed from viewing internally to Always Ask, Firefox doesn't update the list of internally supported file types, so Zotero checks that, thinks that the file is supported internally, and opens the file in Firefox, which triggers that dialog. When you restart, the list of supported file types is refreshed, Zotero sees that the file type isn't supported internally, and it launches the file via the OS as it's supposed to.
  • Hello Dan,

    I see how it is supposed to work now. What I'd like to do is to somehow be able choose the PDF viewer at runtime. I have Evince and Xournal installed and, although I primarily use Evince, I sometimes want to use Xournal (for annotating the document).

    So, for now I've settled with this : I preview the document in Firefox by default (set as default action) and use the little download arrow in pdf.js to display the "You have chosen to open..” dialog. That way I can take any action I want.

    Do you see any other way of achieving the same result but with fewer clicks?

    Thanks!
  • Show File --> right-click --> Open with...
  • edited September 11, 2013
    I just tried that but it actually "hanged" my Firefox. I guess it needs a file manager, but not all users have one :) I guess there isn't a better way of doing what I want in my particular case, but that's OK. Thank you very much for helping me :)
  • You can try playing with extensions.zotero.fallbackLauncher.unix (default: /usr/bin/xdg-open).
  • edited September 21, 2013
    I modified the xdg-open script to fit my needs but I was treated to an unexpected discovery : xdg-open isn't called because "file.launch();" at https://github.com/zotero/zotero/blob/master/chrome/content/zotero/xpcom/zotero.js:1146 actually succeeds and launches the file using glib [1][2].

    EDIT: I ended up installing Thunar which seems the most practical thing to do.

    [1] https://mxr.mozilla.org/mozilla-central/source/xpcom/io/nsLocalFileUnix.cpp
    [2] https://git.gnome.org/browse/glib/tree/gio/gdesktopappinfo.c
Sign In or Register to comment.