Documentation
¶
Overview ¶
Package playwright holds the Playwright-CLI compatibility contract that is independent of ghostchrome's own command surface: the shape of a Playwright CLI config file and the rules that turn its raw values into ghostchrome settings.
Applying those values to the CLI flags is deliberately NOT here. That step writes internal/surface/cli's flag globals and stays with the cobra tree.
Index ¶
- func AppendUnsupportedTopLevel(cfg *Config, unsupported *[]string)
- func FlagChanged(cmd *cobra.Command, name string) bool
- func IsSupportedBrowserName(name string) bool
- func NormaliseVideoSize(value string) (string, bool)
- func NormalizeCDPHeaders(raw map[string]string) (map[string]string, []string)
- func NormalizeChromiumLaunchArg(arg string) (string, bool)
- func NormalizeConsoleConfigLevel(raw string) (string, bool)
- func NormalizeServiceWorkersEnv(raw string) (string, bool)
- func NormalizeServiceWorkersMode(raw string) (string, bool)
- func NumberLike(value any) (int, bool)
- func ParseEnvBool(raw string) (bool, bool)
- func ParseSaveVideoSize(value any) (string, bool)
- func ParseViewportSize(raw string) (width int, height int, ok bool)
- func PositiveInt(value string) (int, bool)
- func ProxyURLWithAuth(server string, username string, password string) string
- func ResolveConfigPath(baseDir string, path string) string
- func ResolveConfigPermissions(permissions []string) (mapped []string, unknown []string)
- func SplitCSV(raw string) []string
- func StringListFromConfigValue(value any) ([]string, bool)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSupportedBrowserName ¶
func NormaliseVideoSize ¶
func NormalizeCDPHeaders ¶
func NumberLike ¶
func ParseEnvBool ¶
func ParseSaveVideoSize ¶
func PositiveInt ¶
func ProxyURLWithAuth ¶
func ResolveConfigPath ¶
Types ¶
type Config ¶
type Config struct {
Browser *struct {
BrowserName string `json:"browserName"`
Isolated *bool `json:"isolated"`
UserDataDir string `json:"userDataDir"`
CDPEndpoint string `json:"cdpEndpoint"`
CDPHeaders map[string]string `json:"cdpHeaders"`
CDPTimeout int `json:"cdpTimeout"`
RemoteEndpoint string `json:"remoteEndpoint"`
InitPage any `json:"initPage"`
InitScript any `json:"initScript"`
LaunchOptions *struct {
Channel string `json:"channel"`
Headless *bool `json:"headless"`
ExecutablePath string `json:"executablePath"`
Args []string `json:"args"`
Proxy *struct {
Server string `json:"server"`
Bypass string `json:"bypass"`
Username string `json:"username"`
Password string `json:"password"`
} `json:"proxy"`
} `json:"launchOptions"`
ContextOptions *struct {
Viewport *struct{ Width, Height int } `json:"viewport"`
Locale string `json:"locale"`
UserAgent string `json:"userAgent"`
StorageState string `json:"storageState"`
Permissions []string `json:"permissions"`
ServiceWorkers string `json:"serviceWorkers"`
} `json:"contextOptions"`
} `json:"browser"`
OutputDir string `json:"outputDir"`
OutputMode string `json:"outputMode"`
OutputMaxSize int `json:"outputMaxSize"`
Console *struct{ Level string } `json:"console"`
Network *struct {
AllowedOrigins []string `json:"allowedOrigins"`
BlockedOrigins []string `json:"blockedOrigins"`
} `json:"network"`
Timeouts *struct {
Action int `json:"action"`
Navigation int `json:"navigation"`
Expect int `json:"expect"`
} `json:"timeouts"`
Extension *bool `json:"extension"`
SaveVideo any `json:"saveVideo"`
SaveSession *bool `json:"saveSession"`
Snapshot any `json:"snapshot"`
ImageResponses string `json:"imageResponses"`
Secrets map[string]string `json:"secrets"`
TestIDAttribute string `json:"testIdAttribute"`
AllowUnrestrictedFileAccess *bool `json:"allowUnrestrictedFileAccess"`
Codegen string `json:"codegen"`
}