Documentation
¶
Overview ¶
Package render is the headless Chrome step: it finds the user's installed Chrome or Chromium. refetch never downloads a browser.
Index ¶
Constants ¶
const ( OutcomeSkippedOff = "skipped_off" // render = "off" OutcomeSkippedByCall = "skipped_by_call" // fetch_page(render: false) OutcomeNoChrome = "no_chrome" // no Chrome or Chromium found OutcomeSkippedRoot = "skipped_root" // running as root outside Linux, where Chrome's sandbox cannot run )
Outcomes for a step 2 that was needed but did not run.
const Client = "headless"
Client is the attempt client name of the headless Chrome step.
const DefaultTimeout = 15 * time.Second
DefaultTimeout is render_timeout's default: Chrome start included.
Variables ¶
var ( ErrNoChrome = errors.New("no Chrome or Chromium found") ErrRoot = errors.New("running as root: headless Chrome needs its sandbox, which does not run as root (on Linux, refetch runs it as nobody instead)") ErrTimeout = errors.New("headless Chrome timed out") ErrSandbox = errors.New("headless Chrome cannot start its sandbox here: the container blocks the user namespaces it needs (Docker's default seccomp profile does)") )
Errors Render returns.
Functions ¶
func FindChrome ¶
func FindChrome() string
FindChrome returns the Chrome to run: REFETCH_CHROME if set, then the macOS app paths (also under ~/Applications), then PATH, then Playwright's Chromium. Empty means none.
func Name ¶
Name describes the installed Chrome for the stats header, like "Google Chrome 155"; "" when not found.
func UnsafePlaywrightChrome ¶ added in v0.2.0
func UnsafePlaywrightChrome() string
UnsafePlaywrightChrome is a Playwright Chromium that FindChrome passed over because others can write to it, as in Playwright's Docker images; "" when there is none.
Types ¶
type Renderer ¶
type Renderer struct {
Chrome string // binary; FindChrome() when empty
Timeout time.Duration // hard cap, Chrome start included; DefaultTimeout when zero
// contains filtered or unexported fields
}
Renderer runs the user's Chrome headless, behind a local proxy on the public-only dialer, and returns the DOM after the page's scripts ran.