balta2ar / brotab

Control your browser's tabs from the command line
MIT License
395 stars 28 forks source link

bt not working until firefox was restarted #11

Closed gagomes closed 4 years ago

gagomes commented 4 years ago

I'm not sure this is a bug, but the documentation doesn't reflect the need to restart firefox, so I'm leaning towards this possibility. Just thought I'd call it out that restarting firefox after installing the brotab extension may be necessary. After restarting firefox, bt list worked immediately.

balta2ar commented 4 years ago

If bt and mediator are already installed by the time extension is activated, you should be fine, I'm not sure what could be the problem here, but thanks for letting me know anyway, I'll keep that in mind. By any chance, do you still have logs for that event in /tmp/brotab_mediator.log?

gagomes commented 4 years ago

bt and extension were installed, but I am not sure about the mediator.

The first lines of the log read like:

2019-12-15 00:03:56,149 10871 INFO       BrowserRemoteAPI has been created
2019-12-15 00:03:56,176 10871 INFO       Starting mediator on 127.0.0.1:4625...
2019-12-15 00:03:56,179 10871 INFO       Custom bind called: (('127.0.0.1', 4625),), {}
2019-12-15 00:04:00,965 10871 INFO       getting browser name
2019-12-15 00:04:00,966 10871 INFO       SENDING: {'name': 'get_browser'}
2019-12-15 00:04:00,971 10871 INFO       RECEIVED: b'"firefox"'
2019-12-15 00:04:00,981 10871 INFO       SENDING: {'name': 'list_tabs'}
(...)

And the time stamps match those at which firefox was restarted:

goncalo 10462 4.6 2.0 4144304 681092 ? Sl 00:03 30:17 /usr/lib/firefox/firefox

balta2ar commented 4 years ago

mediator is installed with the rest of bt commands when you do pip install brotab, but it should also be added to browser's native extension configuration with bt install command. hm, maybe there is a way to specify custom hook in setup.py, so that users don't have to do bt install manually.. but that's unrelated.

anyway, since right now I have no ideas about what could be the problem here and given that a simple Firefox restart solves the issue, I think I will let it slide for now unless there are more similar reports. I appreciate your input though, and of course feel free to comment if there is anything new about this case.

dufferzafar commented 4 years ago

This happened with me as well. I installed the firefox extension first, and then the brotab cli. Had to disable / enable the extension to get the mediator started.