Skip to content

Implement caching of the user-agent for headless UC Mode #2112

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

Closed
mdmintz opened this issue Sep 15, 2023 · 1 comment · Fixed by #2115
Closed

Implement caching of the user-agent for headless UC Mode #2112

mdmintz opened this issue Sep 15, 2023 · 1 comment · Fixed by #2115
Assignees
Labels
enhancement Making things better UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode

Comments

@mdmintz
Copy link
Member

mdmintz commented Sep 15, 2023

Implement caching of the user-agent for headless UC Mode

First the explanation of why this is needed:

The last release fixed a bug (#2106) where headless UC Mode stopped working on Chrome 117 because HeadlessChrome appeared in the user-agent string. This situation was fixed by first opening a regular headless browser, getting the user-agent string, replacing HeadlessChrome with just Chrome, and then opening a UC Mode browser with the modified user-agent string.

This led to opening more browsers than needed. Eg. If a pytest suite had 20 tests for headless UC Mode, that meant that each of those tests opened an extra browser for the user agent string, leading to 40 browsers opened. That action should only be needed once per suite run (probably much less often than that, but cannot predict when Chrome will be updated). So for 20 headless UC Mode tests, only 21 browsers should be needed (with the first one grabbing the user-agent string to be modified for the others).

@mdmintz mdmintz added enhancement Making things better UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode labels Sep 15, 2023
@mdmintz mdmintz self-assigned this Sep 15, 2023
@mdmintz
Copy link
Member Author

mdmintz commented Sep 15, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Making things better UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant