What is the path for Native Messaging on Linux?


Description of the issue:

Unable to get extension which requires a config file in “native-messaging-hosts” working in Brave

How can this issue be reproduced?

I’ve spent some time getting Brave approved for use in my customer’s corporate environment. Unfortunately a new browser extension, which is required for authentication, does not seem to work because I’m unable to identify where to symlink configuration required for the native-messaging-hosts folder.

In Google Chrome, the json configuration file needs to be linked in to /etc/opt/chrome/native-messaging-hosts/.

I’ve tried symlinking the file in to:

  1. A new directory named native-messaging-hosts under /etc/brave
  2. /etc/chromium/native-messaging-hosts/
  3. ~/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts

but the extension fails to load its configuration. The source file which is being symlinked is readable by the user as well as root.

Expected result:

The extension would work, correctly loading the JSON configuration file.

Brave Version( check About Brave): Latest available for Linux, from deb package. Running on Ubuntu 22.04

Additional Information: None

I found this page

which is helpful for confirmation of what I have tested.

I also found a stackexchange answer which lead me to starting Brave on Linux with verbose logging. Unfortunately the output related to the extension only shows it connecting to the native message host only to disconnect 3 seconds later without getting the necessary configuration from the json file.

brave-browser --enable-logging=stderr —v=1 &> /tmp/brave.log

Although I’d still like to confirm the path for Native Messaging in Brave, it turns out that my problem is related to the extension itself.

The developers somehow pinned the extension against Google Chrome only. I’ve asked if they will consider supporting Brave.

This means that my tests to try to identify the native messaging directory are invalid. Any one of the 3 paths in my first post may work, I don’t know.