Skip to content

Commit 43c2acb

Browse files
committed
fix: make sure Playwright works in DevContainers
This patch fixes Invalid browser name exception when Playwright is used in a DevContainer context Fixes [#3174](https://github.com/CurlyFire/playwright-dotnet/issues/3174)
1 parent 22c8156 commit 43c2acb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Playwright.TestAdapter/PlaywrightSettingsProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static string BrowserName
4141
{
4242
var browserFromEnv = Environment.GetEnvironmentVariable("BROWSER")?.ToLowerInvariant();
4343
// GitHub Codespaces and DevContainers sets the BROWSER environment variable, ignore it if its bogus.
44-
if (!string.IsNullOrEmpty(browserFromEnv) && browserFromEnv!.StartsWith("/vscode/"))
44+
if (!string.IsNullOrEmpty(browserFromEnv) && !browserFromEnv!.StartsWith("/vscode/"))
4545
{
4646
ValidateBrowserName(browserFromEnv!, "'BROWSER' environment variable", "\nTry to remove 'BROWSER' environment variable for using default browser");
4747
return browserFromEnv!;

0 commit comments

Comments
 (0)