diff --git a/README.md b/README.md index 5670a76..d5fdd62 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The Notte CLI brings the full power of [notte.cc](https://notte.cc?ref=github) t ## Features - **AI agents** - run and monitor AI-powered browser functions -- **Browser sessions** - headless or headed Chrome/Firefox with full control +- **Browser sessions** - headless or headed Chromium/Chrome with full control - **Files** - upload and download files to notte.cc - **Output formats** - human-readable text or JSON for scripting - **Personas** - create and manage digital identities with email, phone, and SMS @@ -118,7 +118,7 @@ notte sessions code # Get Python script for session steps ```bash notte sessions start \ - --browser-type chromium|chrome|firefox # Browser type (default: chromium) + --browser-type chromium|chrome # Browser type (default: chromium) --headless # Run in headless mode (default: true) --idle-timeout-minutes # Idle timeout (closes after inactivity) --max-duration-minutes # Maximum session lifetime diff --git a/internal/cmd/sessions_test.go b/internal/cmd/sessions_test.go index b39a389..6d49b94 100644 --- a/internal/cmd/sessions_test.go +++ b/internal/cmd/sessions_test.go @@ -130,7 +130,7 @@ func TestRunSessionsStart(t *testing.T) { }) SessionStartHeadless = false - SessionStartBrowserType = "firefox" + SessionStartBrowserType = "chrome" SessionStartIdleTimeoutMinutes = 5 sessionsStartProxy = true SessionStartSolveCaptchas = true diff --git a/internal/cmd/validation_test.go b/internal/cmd/validation_test.go index 1b54a4f..aa4436a 100644 --- a/internal/cmd/validation_test.go +++ b/internal/cmd/validation_test.go @@ -65,8 +65,11 @@ func TestValidateBrowser(t *testing.T) { wantErr bool }{ {"chromium", "chromium", false}, - {"firefox", "firefox", false}, - {"webkit", "webkit", false}, + {"chrome", "chrome", false}, + {"chrome-nightly", "chrome-nightly", false}, + {"chrome-turbo", "chrome-turbo", false}, + {"firefox", "firefox", true}, + {"webkit", "webkit", true}, {"invalid", "safari", true}, {"empty", "", true}, } diff --git a/internal/errors/errors_test.go b/internal/errors/errors_test.go index ec9a0ee..c218402 100644 --- a/internal/errors/errors_test.go +++ b/internal/errors/errors_test.go @@ -37,11 +37,11 @@ func TestAPIError_Unwrap(t *testing.T) { func TestValidationError_Error(t *testing.T) { err := &ValidationError{ Field: "browser", - Message: "expected chromium|firefox|webkit, got 'chrome'", + Message: "expected chromium|chrome, got 'firefox'", } got := err.Error() - want := "validation error: browser: expected chromium|firefox|webkit, got 'chrome'" + want := "validation error: browser: expected chromium|chrome, got 'firefox'" if got != want { t.Errorf("got %q, want %q", got, want) diff --git a/internal/validate/validate.go b/internal/validate/validate.go index 12b7669..0ded044 100644 --- a/internal/validate/validate.go +++ b/internal/validate/validate.go @@ -45,16 +45,23 @@ func JSON(s string) error { return nil } -// Browser validates browser type +// Browser validates browser type. +// +// Notte runs Chromium-family browsers only. Firefox and WebKit are not +// supported - the API rejects a Firefox session with "Firefox sessions are not +// supported. Please use 'chromium' or 'chrome' as `browser_type`" - and +// `chrome` is valid despite an earlier version of this list omitting it. +// chrome-nightly and chrome-turbo are accepted as legacy aliases for chrome. func Browser(s string) error { valid := map[string]bool{ - "chromium": true, - "firefox": true, - "webkit": true, + "chromium": true, + "chrome": true, + "chrome-nightly": true, + "chrome-turbo": true, } if !valid[s] { - return fmt.Errorf("invalid browser: expected chromium|firefox|webkit, got %q", s) + return fmt.Errorf("invalid browser: expected chromium|chrome, got %q", s) } return nil diff --git a/internal/validate/validate_test.go b/internal/validate/validate_test.go index fc07537..c954dc2 100644 --- a/internal/validate/validate_test.go +++ b/internal/validate/validate_test.go @@ -59,10 +59,12 @@ func TestBrowser(t *testing.T) { wantErr bool }{ {"chromium", false}, - {"firefox", false}, - {"webkit", false}, - {"chrome", true}, // Not valid - should be chromium - {"safari", true}, // Not valid - should be webkit + {"chrome", false}, + {"chrome-nightly", false}, // legacy alias for chrome + {"chrome-turbo", false}, // legacy alias for chrome + {"firefox", true}, // the API rejects Firefox sessions outright + {"webkit", true}, // never supported + {"safari", true}, {"", true}, } diff --git a/scripts/gen-flags/types.go b/scripts/gen-flags/types.go index 47e961d..d1f8602 100644 --- a/scripts/gen-flags/types.go +++ b/scripts/gen-flags/types.go @@ -62,7 +62,7 @@ var FlattenWithoutPrefix = map[string]map[string]bool{ // whose OpenAPI metadata is currently flattened away before flag generation. var FieldDescriptionOverrides = map[string]map[string]string{ "SessionStart": { - "browser_type": "The browser type to use. Can be chromium, chrome or firefox.", + "browser_type": "The browser type to use. Supported values are chromium and chrome.", }, } diff --git a/tests/integration/errors_test.go b/tests/integration/errors_test.go index dbf2714..63bc2e0 100644 --- a/tests/integration/errors_test.go +++ b/tests/integration/errors_test.go @@ -142,7 +142,7 @@ func TestErrorParsing_ValidationErrorContainsDetails(t *testing.T) { stderr := result.Stderr // Check that error mentions at least one valid browser type - validBrowsers := []string{"chromium", "chrome", "firefox"} + validBrowsers := []string{"chromium", "chrome"} foundValidBrowser := false for _, browser := range validBrowsers { if containsString(stderr, browser) {