Introduce XDG basedir spec-compliant location for native-messaging-hosts in home directory
Categories
(WebExtensions :: General, enhancement, P2)
Tracking
(Not tracked)
People
(Reporter: nazar, Unassigned)
References
Details
(Whiteboard: [addons-jira])
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:148.0) Gecko/20100101 Firefox/148.0
Steps to reproduce:
I switched to .config/mozilla once https://bugzilla.mozilla.org/show_bug.cgi?id=259356 was resolved, but noticed that browser extension for KeepassXC can't communicate with the desktop app
Actual results:
Turns out Firefox is still looking at .mozilla/native-messaging-hosts
Expected results:
Firefox should be looking at .config/mozilla/native-messaging-hosts if the rest of the data is in .config/mozilla or maybe check both just in case
Comment 1•3 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'WebExtensions::Untriaged' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•3 months ago
|
||
I think it was on purpose?
Upstream keepassxc bug for the reference: https://github.com/keepassxreboot/keepassxc/issues/12779
Updated•3 months ago
|
Updated•3 months ago
|
Comment 4•3 months ago
|
||
The documented locations for the native messaging manifests are here:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_manifests#linux
We cannot just change the location, because that would break the ability for extensions to communicate with hosts that had been registered in the "old" locations. The best we can do is to add it as one of the fallback options. Even if we do so, it would take a while before users can get rid of the "old" directory, because third-party applications need to register themselves in the new location.
There have been a request before about relocating the system location (e.g. bug 1986219), where I expressed similar concerns about the dependencies between Firefox and third parties.
If we change the lookup order, we should also update portals used by snap/flatpak to account for the new location (bug 1955255).
If I read https://specifications.freedesktop.org/basedir/latest/ , then it sounds like the native messaging manifests fits the following definition:
There is a single base directory relative to which user-specific configuration files should be written. This directory is defined by the environment variable $XDG_CONFIG_HOME.
... in which case ~/.config/mozilla/native-messaging-hosts/ would be the desired location (as suggested in the report here).
Comment 5•2 months ago
|
||
The question of native messaging location also came up in bug 1974186.
I discussed this bug with a team member (Luca), and we are in favor of adding another path in the lookup for native messaging hosts. This "new standard" location should have the highest priority in the lookup.
That extra path should be added here: https://searchfox.org/firefox-main/rev/911b3eec6c5e58a9a49e23aa105e49aa76e00f9c/toolkit/components/extensions/NativeManifests.sys.mjs#38-45
Patches are welcome!
What will happen if it's a fresh set up, will the new location be created with this idea?
Updated•2 months ago
|
Description
•