Does anybody know whether it is possible to script Tor Browser with Marionette (https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette)?

If I pass the -marionette argument to start-tor-browser, Tor browser listens locally on the port 2828 for Marionette/webdriver connections.

I have installed marionette_client in a venv as described at marionette-client.readthedocs.org.

However, if I try to follow the instructions at http://marionette-client.readthedocs.org/en/latest/#getting-started I get an error message:

>>> client = Marionette(host='localhost', port=2828)
>>> client.start_session()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "[...]/marionette/venv/local/lib/python2.7/site-packages/marionette/marionette.py", line 811, in start_session
    self.session = self._send_message('newSession', 'value')
  File "[...]/marionette/venv/local/lib/python2.7/site-packages/marionette/decorators.py", line 35, in _
    return func(*args, **kwargs)
  File "[...]/marionette/venv/local/lib/python2.7/site-packages/marionette/marionette.py", line 611, in _send_message
    response = self.client.send(message)
  File "[...]/marionette/venv/local/lib/python2.7/site-packages/marionette_transport/transport.py", line 85, in send
  File "[...]/marionette/venv/local/lib/python2.7/site-packages/marionette_transport/transport.py", line 79, in connect
    self.actor = response['id']
KeyError: 'id'

Has anybody had any success using Tor Browser with Marionette?


Has anybody had any success using Tor Browser with Marionette?

It was possible up to (at least) 52.3.0.

  1. start the browser:

    cd tor-browser_en-US/Browser
    ./start-tor-browser -marionette
  2. connect

    from marionette_driver.marionette import Marionette
    client = Marionette('localhost', port=2828)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.