Documentation
¶
Overview ¶
Package browser manages headless Chrome/Chromium for rendering themes.
Package browser - headless rendering using Chrome DevTools Protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnsupportedPlatform is returned for unsupported OS/arch combinations. ErrUnsupportedPlatform = errors.New("unsupported platform") // ErrBrowserNotFound is returned when the browser binary is not found. ErrBrowserNotFound = errors.New("browser not found") // ErrDownloadFailed is returned when browser download fails. ErrDownloadFailed = errors.New("browser download failed") )
Functions ¶
func BrowserPath ¶
BrowserPath returns the path to the Chrome binary if installed.
func GetChromePath ¶
GetChromePath returns the path to Chrome, preferring cached version. Falls back to system Chrome if cached version is not available.
func IsInstalled ¶
func IsInstalled() bool
IsInstalled checks if Chrome is installed in the cache directory.
func SystemChromePath ¶
SystemChromePath tries to find a system-installed Chrome/Chromium.
Types ¶
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer manages a headless Chrome instance for rendering themes.
func NewRenderer ¶
NewRenderer creates a new headless browser renderer.
func (*Renderer) CaptureToFile ¶
CaptureToFile takes a screenshot and saves it to a file.
func (*Renderer) SendSensorData ¶
SendSensorData sends sensor data to the theme via JavaScript.
func (*Renderer) ServerPort ¶
ServerPort returns the port the theme server is running on.