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

Doesn't work on macOS (wrong manifest directory) #43

Open
thepaul opened this issue Sep 11, 2020 · 9 comments
Open

Doesn't work on macOS (wrong manifest directory) #43

thepaul opened this issue Sep 11, 2020 · 9 comments

Comments

@thepaul
Copy link

thepaul commented Sep 11, 2020

Everything seems to install correctly, but the bt command-line tool can't find any clients to talk to (empty output from bt clients and bt list).

After some debugging I found that the tool is installing the native-messaging manifest in the wrong directory. ~/.mozilla/native-messaging-hosts is the directory for Firefox on Linux. For Firefox on Mac, it should be in ~/Library/Application Support/Mozilla/NativeMessagingHosts. Moving the manifest file into the correct directory and reloading the extension makes everything work. Yay!

I don't know the correct directories for native messaging manifests under Chrome or Brave, but it looks like they need similar changes to work on macOS.

@felciano
Copy link

I've got this issue as well. Is there a recommended solution for Mac across Firefox, Chrome and Safari?

@twisst
Copy link

twisst commented Dec 16, 2020

@thepaul's solution to this problem worked for me as well. I only had to create that directory myself. Restarted Firefox and it worked!

@minamotorin
Copy link

minamotorin commented Jan 21, 2021

I had same issue on macOS with Brave Browse, but I could solve the issue with the comment. It work fine for me after run following commands and reload brotab's background page:

$ bt install 
$ mkdir -p ~/Library/Application\ Support/BraveSoftware/Brave-Browser/NativeMessagingHosts
$ cp -i ~/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/brotab_mediator.json ~/Library/Application\ Support/BraveSoftware/Brave-Browser/NativeMessagingHosts

@mskar
Copy link

mskar commented Mar 1, 2021

I ran the code below but still no luck with either Firefox, Brave, or Chrome, even after restart.

bt install 
mkdir -p ~/Library/Application\ Support/BraveSoftware/Brave-Browser/NativeMessagingHosts
cp -i ~/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/brotab_mediator.json ~/Library/Application\ Support/BraveSoftware/Brave-Browser/NativeMessagingHosts
mkdir -p ~/Library/Application\ Support/Mozilla/NativeMessagingHosts
cp -i ~/.mozilla/native-messaging-hosts/brotab_mediator.json ~/Library/Application\ Support/Mozilla/NativeMessagingHosts

There is still no output from bt list...
Update: Firefox is working...

@minamotorin
Copy link

minamotorin commented Mar 8, 2021

Is your brotab‘s extension page‘s url chrome-extension://mhpeahbikehnfkfnmopaigggliclhmnc/ ? If you installed brotab extension manually, you should add your brotab‘s extension page‘s url to brotab_mediator.json .

@jswent
Copy link

jswent commented Jul 13, 2022

If anyone is still having an issue with Brave not working, putting the brotab_mediator.json file in the Chrome NativeMessagingHosts directory (~/Library/Application Support/Google/Chrome/NativeMessagingHosts) solved the issue for me.

EDIT: Fix for Brave on MacOS:

bt install
mkdir -p ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts
cp -i ~/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/brotab_mediator.json ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts

@rickallauigan
Copy link

This works on me:

Note: Replace <HOME_FOLDER> with your home folder

Microsoft Edge:

  1. Run bt install
    bt install

  2. Create directory for Microsoft Edge/NativeMessagingHosts if not exists

    mkdir -p "/Users/<HOME_FOLDER>/Library/Application Support/Microsoft Edge/NativeMessagingHosts"
  3. Copy brotab_mediator.json file from chromium to Microsoft Edge/NativeMessagingHosts

    cp /Users/<HOME_FOLDER>/.config/chromium/NativeMessagingHosts/brotab_mediator.json "/Users/<HOME_FOLDER>/Library/Application Support/Microsoft Edge/NativeMessagingHosts"
  4. Re-install brotab chrome extension (this also works on Microsoft Edge):

  5. Run bt clients, results should be (if you also have firefox):
    image

For Mozilla:

Brotab mediator location: ~/.mozilla/native-messaging-hosts/brotab_mediator.json
Target directory: /Users/<HOME_FOLDER>/Library/Application Support/Mozilla/NativeMessagingHosts

For Google Chrome:

Brotab mediator location: ~/.config/google-chrome/NativeMessagingHosts/brotab_mediator.json
Target directory: /Users/<HOME_FOLDER>/Library/Application Support/Google/Chrome/NativeMessagingHosts

@grandkrav
Copy link

I have the same issue on macOS with Firefox and Chrome - bt clients return nothing.
I have tried to change the mediator location - but it does not help.

OS: macOS 13.4
Firefox: 121.0.1
Chrome: Version 120.0.6099.199 (Official Build) (arm64)

@grandkrav
Copy link

I have the same issue on macOS with Firefox and Chrome - bt clients return nothing. I have tried to change the mediator location - but it does not help.

OS: macOS 13.4 Firefox: 121.0.1 Chrome: Version 120.0.6099.199 (Official Build) (arm64)

Found the root cause: bt_mediator return error:

Traceback (most recent call last):
  File "/opt/homebrew/bin/bt_mediator", line 5, in <module>
    from brotab.mediator.brotab_mediator import main
  File "/opt/homebrew/lib/python3.11/site-packages/brotab/mediator/brotab_mediator.py", line 15, in <module>
    from brotab.mediator.http_server import MediatorHttpServer
  File "/opt/homebrew/lib/python3.11/site-packages/brotab/mediator/http_server.py", line 7, in <module>
    from flask import Flask
  File "/opt/homebrew/lib/python3.11/site-packages/flask/__init__.py", line 7, in <module>
    from .app import Flask as Flask
  File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 28, in <module>
    from . import cli
  File "/opt/homebrew/lib/python3.11/site-packages/flask/cli.py", line 18, in <module>
    from .helpers import get_debug_flag
  File "/opt/homebrew/lib/python3.11/site-packages/flask/helpers.py", line 16, in <module>
    from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/opt/homebrew/lib/python3.11/site-packages/werkzeug/urls.py)

It looks like the Flask version is not compatible with the Werkzeug.

pip uninstall werkzeug && pip install werkzeug==2

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

No branches or pull requests

8 participants