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
[Question] Access browser binaries from node_modules/playwright directory? #4808
Comments
The directory name is In your code snippet process.env.PLAYWRIGHT_BROWSERS_PATH = 0 is done too late, by that time browser types would already be initialized with the default path. But looking at your traces it looks like you did pass the env variable differently. Can you post here complete snippet that doesn't work? |
Thanks @yury-s.
Logs while using
Logs when using
main process (Node) import { BrowserWindow, app } from 'electron'
process.env.PLAYWRIGHT_BROWSERS_PATH = 0 // <-- setting the environment variable inside the main (Node) process
const win = new BrowserWindow({ width: 800, height: 600 });
if (isDev) win.loadURL(DEV_SERVER_URL);
else win.loadFile(INDEX_PATH); // bundled web app |
Closing since the issue seems resolved. |
Hi, I'm trying access the browser binaries (e.g. Firefox, WebKit), but am not seeing the expected files after running
PLAYWRIGHT_BROWSERS_PATH=0 yarn add playwright
andyarn install
with the same. I expect to see a.browsers-local
directory within./node_modules/playwright/
, as does the error message.script.js (FYI: this runs within Electron)
Error logs
npx cross-env PLAYWRIGHT_BROWSERS_PATH=0 yarn add playwright -S
PLAYWRIGHT_BROWSERS_PATH=0
environment variable is mentioned in the docs herenode_modules/playwright
, expecting to see a.browsers-local
directory, but found nothing like thatQuestion
How can I reliably access the browser binaries directory? It seems like it should be as simple as installing the package and running the package using the env variable
PLAYWRIGHT_BROWSERS_PATH=0
, however I am not able to see the downloaded browser directories.(My end goal is to be able to launch the browsers installed in
.node_modules/playright
from an Electron app. IfPLAYWRIGHT_BROWSERS_PATH=0
still works as intended, that appears to be the easies way to achieve this.)Similar issues I've looked at:
The text was updated successfully, but these errors were encountered: