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

WSL2 should give precedence to Chrome installed on Linux #250

Open
igorakkerman opened this issue Oct 24, 2021 · 4 comments
Open

WSL2 should give precedence to Chrome installed on Linux #250

igorakkerman opened this issue Oct 24, 2021 · 4 comments

Comments

@igorakkerman
Copy link

igorakkerman commented Oct 24, 2021

In WSL2, chrome-launcher running on Linux starts the Chrome instance installed on Windows, even if Chrome is also installed on Linux. IMO the precedence should be changed to prioritize the installation inside of the WSL when no additional arguments are given.

I use WSL2/Ubuntu on Windows 11 and have installed Chrome inside of the WSL. It is on the PATH and I can launch it in the shell using google-chrome.

I tested using the script provided here: https://github.com/GoogleChrome/chrome-launcher#launching-chrome
chrome-launcher version: 0.14.1
Node.js: 17.0.1 / 16.12.0
npm: 8.1.0

@igorakkerman igorakkerman changed the title WSL2 on Windows 11 should give precedence to Chrome on Linux WSL2 should give precedence to Chrome on Linux Oct 24, 2021
@igorakkerman igorakkerman changed the title WSL2 should give precedence to Chrome on Linux WSL2 should give precedence to Chrome installed on Linux Oct 30, 2021
@lucacataldo
Copy link

For those looking at a temporary solution to this, you can set the CHROME_PATH environment variable to point to your linux install's chrome binary to override the default behaviour which launches the windows executable.

I do agree that when running in WSL, a linux install of Chromium should take precedence by default.

@lucacataldo
Copy link

lucacataldo commented Aug 25, 2022

For those looking at a temporary solution to this, you can set the CHROME_PATH environment variable to point to your linux install's chrome binary to override the default behaviour which launches the windows executable.

I do agree that when running in WSL, a linux install of Chromium should take precedence by default.

Actually this doesn't seem to work on WSL2 on Windows 11.

I would say that having a non-null CHROME_PATH environment variable should indicate the user has a preferred chromium binary, especially since Win11 now supports GUI applications natively on WSL.

A simple check for the existence of process.env.CHROME_PATH in chrome-finder.ts should override the check for windows installations.

@avblink
Copy link

avblink commented Sep 15, 2022

Bumping this.

@unpWn4bl3
Copy link

bump for this

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

4 participants