playwright-community / playwright-go

Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
https://playwright-community.github.io/playwright-go/
MIT License
1.94k stars 144 forks source link

[Bug]: hardwareConcurrency is limited to 4 #451

Closed twolao closed 2 months ago

twolao commented 2 months ago

Environments

Bug description

hardwareConcurrency is limited to 4. No relevant settings are seen in the code. It cannot be modified using javascript in the started browser. https://browserleaks.com/javascript

How can to modify and adjust hardwareConcurrency setting?

To Reproduce Please provide a mini reproduction rather than just a description. For example:

Additional context Add any other context about the problem here.

canstand commented 2 months ago

You mean this? It's read-only and depends on environment.

The navigator.hardwareConcurrency read-only property returns the number of logical processors available to run threads on the user's computer.

twolao commented 2 months ago

You mean this? It's read-only and depends on environment.

The navigator.hardwareConcurrency read-only property returns the number of logical processors available to run threads on the user's computer.

The hardwareConcurrency and languages of the browser started using playwright do not match those of the actual system. They seem to be fixed settings. You can try to modify these two properties of navigator using javascript. It can take effect in the chrome environment, but the browser started using playwright does not matter whether it is chromium or not. Still in Firefox, these two properties cannot be modified successfully. You can use this URL to check navigator information https://browserleaks.com/javascript