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

BROWSER_ARGS in .env file is not working in Chrome 90 version (MAC OS) #11917

Open
Karthick-FK opened this issue Jan 13, 2022 · 4 comments · May be fixed by ayishagisel/create-react-app#119
Open

Comments

@Karthick-FK
Copy link

Karthick-FK commented Jan 13, 2022

I have tried the below method to start app in a web security disabled browser to avoid CORS issue. (Added in .env file)

BROWSER=google chrome
BROWSER_ARGS=--user-data-dir=/tmp/temporary-chrome-profile-dir --disable-web-security --disable-site-isolation-trials --ignore-certificate-errors --disable-features=SameSiteByDefaultCookies,CookiesWithoutSameSiteMustBeSecure --unsafely-treat-insecure-origin-as-secure=http://localhost:3000

When we do this in terminal (open chrome command with above args) - It is launching the browser with given browser args. But, BROWSER_ARGS is getting ignored if we provide inside .env file. It is launching in the normal chrome browser (wit security enabled)

Please update me if you need further details from my end.

@Karthick-FK Karthick-FK changed the title BROWSER_ARGS in .env file is not working in Chrome 90 version BROWSER_ARGS in .env file is not working in Chrome 90 version (MAC OS) Jan 13, 2022
@stacy-rendall
Copy link

I can confirm that BROWSER is also not working when placed in an .env file with react-scripts@5 (I'm using .env.local in this case), i.e. BROWSER=msedge used to work with react-scripts@4, now the default browser opens

@Karthick-FK
Copy link
Author

@stacy-rendall Am using "react-scripts": "3.4.1" in my package.json file

@arvigeus
Copy link
Contributor

I can confirm that BROWSER is also not working when placed in an .env

I noticed that too, but I thought I botched my recent system reinstall and was doing something wrong.

I believe the BROWSER_ARGS issue is somewhere around here /packages/react-dev-utils/openBrowser.js:#L77-L107, likely line 96 has to be changed to chromiumBrowser + " " + args. Since I don't have a Mac, I cannot confirm the solution.

@FloydJohn
Copy link

Hi @Karthick-FK, could you try to create a new project using the CRA version of the PR linked above? It should solve both the BROWSER and BROWSER_ARGS issue.

I tested the browser opening on Linux, testing on a Mac would be nice.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants