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

fix: fix changing user agent issue on headless mode #2156

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

Conversation

Amirmahdikahdouii
Copy link

Fix not changing navigator.userAgent property on headless mode

Problem

The problem was that by setting headless=True, navigator.webdriver is equal to False so the changes on navigator.userAgent couldn't commit due to it is under the condition that navigator.webdriver should return True.

Solution

I separated the modification part of navigator.userAgent and put it in a separated method and then call it at top of configure headless method.

Note

My Chrome version is 134.0.0 and I'm using Python 3.12

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

Successfully merging this pull request may close these issues.

1 participant