playwright

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendUnsupportedTopLevel

func AppendUnsupportedTopLevel(cfg *Config, unsupported *[]string)

func FlagChanged

func FlagChanged(cmd *cobra.Command, name string) bool

func IsSupportedBrowserName

func IsSupportedBrowserName(name string) bool

func NormaliseVideoSize

func NormaliseVideoSize(value string) (string, bool)

func NormalizeCDPHeaders

func NormalizeCDPHeaders(raw map[string]string) (map[string]string, []string)

func NormalizeChromiumLaunchArg

func NormalizeChromiumLaunchArg(arg string) (string, bool)

func NormalizeConsoleConfigLevel

func NormalizeConsoleConfigLevel(raw string) (string, bool)

func NormalizeServiceWorkersEnv

func NormalizeServiceWorkersEnv(raw string) (string, bool)

func NormalizeServiceWorkersMode

func NormalizeServiceWorkersMode(raw string) (string, bool)

func NumberLike

func NumberLike(value any) (int, bool)

func ParseEnvBool

func ParseEnvBool(raw string) (bool, bool)

func ParseSaveVideoSize

func ParseSaveVideoSize(value any) (string, bool)

func ParseViewportSize

func ParseViewportSize(raw string) (width int, height int, ok bool)

func PositiveInt

func PositiveInt(value string) (int, bool)

func ProxyURLWithAuth

func ProxyURLWithAuth(server string, username string, password string) string

func ResolveConfigPath

func ResolveConfigPath(baseDir string, path string) string

func ResolveConfigPermissions

func ResolveConfigPermissions(permissions []string) (mapped []string, unknown []string)

func SplitCSV

func SplitCSV(raw string) []string

func StringListFromConfigValue

func StringListFromConfigValue(value any) ([]string, bool)

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"`
	SharedBrowserContext        *bool             `json:"sharedBrowserContext"`
	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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL