Documentation
¶
Overview ¶
Package provision finds and installs a verified browser without weakening its sandbox.
Index ¶
- Constants
- func DownloadSupport(cfg Config) error
- func Ensure(ctx context.Context, cfg Config, progress func(Progress)) (string, error)
- func EnvNoSandbox() bool
- func Find(cfg Config) (path, snap string, err error)
- func InstallCommand(release string) string
- func LibrariesCommand(release string) string
- func Mode(requested string) string
- func Retain(chrome string) (io.Closer, error)
- func SandboxArgs(extra []string, noSandbox *bool) []string
- func SandboxHelp(chrome string) string
- type Config
- type Diagnostic
- type Inspection
- type Progress
Constants ¶
const Version = "157.0.8103.38"
Version is pinned with the hashes below; tools/update-browser-checksums.sh downloads every archive before hashing.
Variables ¶
This section is empty.
Functions ¶
func DownloadSupport ¶
DownloadSupport lets machine checks explain unsupported or offline installs without starting a download.
func Ensure ¶
Ensure serializes installations across profiles and runtime processes. Interrupted transfers restart from zero.
func EnvNoSandbox ¶
func EnvNoSandbox() bool
EnvNoSandbox reports whether RUNTIME_BROWSER_CHROME_ARGS turns Chrome's sandbox off for this deployment.
func Find ¶
Find never downloads or starts Chrome. Snap candidates are returned separately for a pipe probe.
func InstallCommand ¶
InstallCommand suggests a native browser, including its libraries, for the detected distribution.
func LibrariesCommand ¶
LibrariesCommand avoids Ubuntu's chromium snap wrapper when only shared libraries are missing.
func Mode ¶
Mode reports the display the host will choose; lack of Xvfb is a supported headless configuration.
func Retain ¶
Retain prevents an upgrade from removing resources a running Chrome may still load. Hosts and probes hold this lease until Chrome exits; system installations need no lease.
func SandboxArgs ¶
SandboxArgs applies an explicit preference over manual environment flags. Nil preserves legacy environment configuration for deployments without a preference.
func SandboxHelp ¶
SandboxHelp preserves the sandbox by making every privilege-changing remedy an explicit choice.
Types ¶
type Config ¶
type Config struct {
DataDir, Chrome, URL, GOOS, GOARCH string
Download bool
LookPath func(string) (string, error)
// contains filtered or unexported fields
}
Config captures environment settings once so concurrent profiles use the same installation.
type Diagnostic ¶
type Diagnostic struct{ Message, Command string }
Diagnostic separates a copyable repair command from the human explanation.
func (*Diagnostic) Error ¶
func (d *Diagnostic) Error() string
Error keeps the repair detail available to both tools and the panel.
type Inspection ¶
type Inspection struct{ Chrome, Version, Mode, Sandbox string }
Inspection is safe to display in a machine check; no browsing data or Chrome log is returned.
func Probe ¶
func Probe(ctx context.Context, chrome, data string) (Inspection, error)
Probe verifies the real debugging pipe and creates a renderer, so sandbox failures are not mistaken for readiness.
func ProbeWithSandbox ¶
func ProbeWithSandbox(ctx context.Context, chrome, data string, noSandbox *bool) (Inspection, error)
ProbeWithSandbox checks Chrome with the same explicit preference as a new host.