-
-
Notifications
You must be signed in to change notification settings - Fork 36
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 Support #26
Comments
Probably sending credentials via headless browser can help https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md For now, I think only below one can run on WSL |
@shamsalmon You can try to install vcxsrv Xserver on your machine to be able to start GUI apps. The app is starting but having other problems unfortunately |
I've been trying to fiddle with WSL2 to get this running but I need a bit more time. In the meantime, you should explore some options as mentioned on puppeteer/puppeteer#1837. It seems to be possible. I've also added the required configuration variables in order to change the executable path in case you can get it running based on the comments of the thread above. |
Alright, I got it working under WSL1 @shamsalmon, but not without its caveats!
Considering this, using Ubuntu 20.04 on WSL1 I had to:
Now, on the Windows host, install the recommended Chromium revision for the version of puppeteer bundled with gsts. Note this can change at any time, so you will need to make sure you keep the two in sync to avoid issues. Back to the WSL Terminal, the following step will eventually make it to a command-line argument, but for the sake of testing, edit const options = {
args: ['--disable-features=site-per-process', `--window-size=${device.viewport.width},${device.viewport.height}`],
defaultViewport: device.viewport,
headless: !argv.headful,
ignoreDefaultArgs: ['--enable-automation'],
userDataDir: 'C:\\Users\\User\\AppData\\Local\\Temp\\Chrome',
executablePath: '/mnt/c/Users/User/AppData/Local/Chromium/Application/chrome.exe'
}; Here, we customize Now, to the caveats:
It would be great if you could test similar approaches on WSL2. It's probably a lot better. |
Good news on WSL2. It's a lot easier than WSL1.
Let me know how it works for you! |
I get the following message in WSL2 because WSL does not support X-Windows. As you can interact with chrome via selenium server I figure the same must be possible with puppeteer. If we can configure it to connect to the browser remotely rather than trying to launch chromium it would probably work.
The text was updated successfully, but these errors were encountered: