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

Chrome remote support #78

Open
alissonws opened this issue Jul 25, 2021 · 4 comments
Open

Chrome remote support #78

alissonws opened this issue Jul 25, 2021 · 4 comments

Comments

@alissonws
Copy link
Contributor

Hello! First of all, awesome work on this project. It is being really usefull for me. I am migrating my project to Docker and went from chrome client to remote client. I then noticed that there appears to be no support for Chrome since it loads Firefox configurations by default when selecting remote client.

...
elif client == 'remote':
            if self._profile_path is not None:
                self._profile = webdriver.FirefoxProfile(self._profile_path)
            else:
                self._profile = webdriver.FirefoxProfile()

            options = Options()

            if headless:
                options.headless = True
            
            capabilities = DesiredCapabilities.FIREFOX.copy()
...

The only thing I'd like to know is if there is for that or it is just a feature that was not added yet. If it is just a matter of adding chrome options and profile to remote, I could try do develop something to solve this problem.

@mrodal
Copy link
Collaborator

mrodal commented Jul 26, 2021

Hey @alissonws! its true, it assumes remote is firefox. This is legacy code, and I never worked with remote browsers, but I believe its because at the start the whole project was meant for use with firefox and chrome was added after. As you say, it should work adding the options for chrome.

It would be great if you could come with something for this! maybe there will have to be a remote_chrome and remote_firefox clients?

@alissonws
Copy link
Contributor Author

alissonws commented Jul 30, 2021

I think that maybe a better solution would be maintaining chrome and firefox clients and adding an argument called remote. So the user would choose the client and, if needed, it would be set up as remote by parsing remote = True. I believe that it is a better approach if a requirement of adding more clients comes up (like edge). I could also update the docs to show how to use this option, but it would be nice to know if the client="remote" is used anywhere else besides __init__() method. If we would have to rewrite a lot of methods, then we should go for remote_chrome and remote_firefox, but if it is just a matter of updating the if client == "remote" if-block, then I think we should go for client="chrome", remote=True.

@mrodal
Copy link
Collaborator

mrodal commented Jul 30, 2021

Indeed, I like that solution better! And yes, the client="remote" is only used to configure the browser in the __init__ method. Then it is also used in some example files (new_messages_observer.py and remote.py).
Thanks for your contribution!

@alissonws
Copy link
Contributor Author

Pushing this new feature at #80

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

2 participants