Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Add possibility to pass your own MitmProxy (backend) to webdriver #529

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

drforse
Copy link

@drforse drforse commented Apr 11, 2022

Why to implement the feature:
When you want to connect to a running browser instance, you need to run the browser giving him the proxy params. Some browsers (like Dolphin) will fail to run the instance if they can't ping the proxy, so the proxy should be already running before running the browser.
I am starting an instance of Dolphin in my code, so basically I needed to create proxy first, than start Dolphin and only after that create a webdriver that will connect to Dolphin.

@wkeeling
Copy link
Owner

Many thanks for raising the PR.

I had a question regarding:

so the proxy should be already running before running the browser

Selenium Wire by default does start the proxy first, which is what the self._setup_backend() call does in the webdriver initializer (it's the final super().__init__() call that starts the browser instance).

Which webdriver type do you use for connecting to Dolphin? Wondering if we need a new webdriver.Dolphin class creating?

@drforse
Copy link
Author

drforse commented Apr 11, 2022

Yes, I understand that it does start the proxy first. But I can't do anything between proxy starting and initializing webdriver, so it doesn't help (in my case webdriver doesn't start the browser instance, it connects to a started instance).
I use Chrome webdriver.

@ChronoBrake
Copy link

Anything new in this case?

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

Successfully merging this pull request may close these issues.

None yet

3 participants