[Zotero 7.0.8]: Firefox is default PDF viewer, but Zotero opens PDFs into wrong profile
I'm using Zotero 7.0.8 on Windows 10, with Firefox Developer Edition as the system default PDF viewer.
When I open a PDF from Zotero, it opens in Firefox Developer Edition, but not in the profile that I've set as my default.
Instead, it always opens in the profile called "dev-edition-default" (the 'default default' profile if you like), which isn't what I want. Even if I already have an instance of Firefox running with my default profile, then opening a PDF from Zotero creates a new instance with the 'default default' profile.
This isn't a problem when opening URL links (as opposed to PDFs) from Zotero: those use my actual default profile, as they should. i.e. invoking Firefox as the default *browser* is OK, it's specifically invoking Firefox as the default *PDF viewer* that's the problem.
It isn't a problem when opening PDFs from outside Zotero (e.g. from Windows Explorer). It also wasn't a problem with Zotero 6 (which I only just updated from). In Zotero 6, PDFs opened into Firefox with my default profile, and reused a running Firefox instance if it existed.
This somewhat resembles the issue here: https://forums.zotero.org/discussion/112945/zotero-7-beta-invoking-firefox-over-zotero-uses-non-default-profile
But there are several differences:
a) That seems to be an issue with certain Linux builds; my issue is on Windows.
b) That issue arises when opening URL links, whereas my issue is only when opening PDFs.
c) That issue can be worked around by deleting the 'default default' profile, whereas mine can't. If I delete it, then open a PDF from Zotero, then the Firefox instance recreates the 'default default' and uses that.
When I open a PDF from Zotero, it opens in Firefox Developer Edition, but not in the profile that I've set as my default.
Instead, it always opens in the profile called "dev-edition-default" (the 'default default' profile if you like), which isn't what I want. Even if I already have an instance of Firefox running with my default profile, then opening a PDF from Zotero creates a new instance with the 'default default' profile.
This isn't a problem when opening URL links (as opposed to PDFs) from Zotero: those use my actual default profile, as they should. i.e. invoking Firefox as the default *browser* is OK, it's specifically invoking Firefox as the default *PDF viewer* that's the problem.
It isn't a problem when opening PDFs from outside Zotero (e.g. from Windows Explorer). It also wasn't a problem with Zotero 6 (which I only just updated from). In Zotero 6, PDFs opened into Firefox with my default profile, and reused a running Firefox instance if it existed.
This somewhat resembles the issue here: https://forums.zotero.org/discussion/112945/zotero-7-beta-invoking-firefox-over-zotero-uses-non-default-profile
But there are several differences:
a) That seems to be an issue with certain Linux builds; my issue is on Windows.
b) That issue arises when opening URL links, whereas my issue is only when opening PDFs.
c) That issue can be worked around by deleting the 'default default' profile, whereas mine can't. If I delete it, then open a PDF from Zotero, then the Firefox instance recreates the 'default default' and uses that.
Namely, the launched Firefox instance seems to inherit the environment variable MOZ_LEGACY_PROFILES=1.
Steps to replicate / diagnose:
1) Restart Zotero with debug logging enabled.
2) Open a PDF - it opens in a new FIrefox in the undesired profile.
3) From the logs, find the shell command that Zotero issued to start Firefox.
4) In a command prompt, execute that same shell command. The issue isn't replicated: the PDF opens in the expected default profile this time.
5) In the command prompt, execute: set MOZ_LEGACY_PROFILES=1
6) In the command prompt, execute the same shell command as in (4) to open the PDF. This time, it replicates the issue, i.e. the PDF opens in the 'default default' profile, like it does from Zotero.