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

chore: ignore GitHub Codespaces BROWSER env var #3068

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mxschmitt
Copy link
Member

@mxschmitt mxschmitt commented Nov 25, 2024

e.g. /vscode/bin/linux-x64/f1a4fb101478ce6ec82fe9627c43efbf9e98c813/bin/helpers/browser.sh which prevents customers from running the getting started on GitHub Codespaces.

We respect the BROWSER env var for legacy reasons.

Fixes #2847

@@ -40,7 +40,8 @@ public static string BrowserName
get
{
var browserFromEnv = Environment.GetEnvironmentVariable("BROWSER")?.ToLowerInvariant();
if (!string.IsNullOrEmpty(browserFromEnv))
// GitHub Codespaces sets the BROWSER environment variable, ignore it if its bogus.
if (!string.IsNullOrEmpty(browserFromEnv) && !browserFromEnv!.StartsWith("/vscode/"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch! I don't like hardcoding this.

Perhaps we should change the error below into a warning and run chromium, if we consider BROWSER to be a legacy thing?

@mxschmitt mxschmitt closed this Nov 26, 2024
@mxschmitt mxschmitt reopened this Nov 27, 2024
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

Successfully merging this pull request may close these issues.

[BUG] Fresh Playwright for .NET Install Throws 'Invalid browser name'
2 participants