titusfortner / webdrivers

Keep your Selenium WebDrivers updated automatically
MIT License
593 stars 110 forks source link

Change the way the library uses to detect WSL to detect only WSL v1 #199

Closed urubatan closed 3 years ago

urubatan commented 3 years ago

Uses the kernel version to detect if the current kernel version is V1 or V2

This is the correct implementation for https://github.com/titusfortner/webdrivers/pull/196 and all the description there applies here

Fixes #192 and #197

This PR #187 changed WSL detection to detect both WSLv1 and WSLv2 as running in WSL and use Chrome on Windows for both versions. But it doesn't work on WSLv2 out of the box.

WSL2 networking is different from WSL1 and you can't connect from the WSL2 Linux on Chromedriver running on Windows using 127.0.0.1:9515, see: microsoft/WSL#4619

This PR changes the wsl detection to be explicity about v1 and only uses Chromedriver on Windows if it is WSLv1, as it doesn't work on WSLv2.

urubatan commented 3 years ago

@titusfortner I also added tests to check if it wont identify WSL2 by mistake

kapoorlakshya commented 3 years ago

Closing at user's request.