Documentation
¶
Overview ¶
Package browser drives a real headless Chrome through the DevTools Protocol so JavaScript-built pages are captured as they actually render. kage always goes through here: navigate, let the page settle, then serialise the final DOM — the same markup a human would have seen — which the rest of the pipeline then strips of scripts and localises.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LookChrome ¶
LookChrome reports the path of a usable Chrome/Chromium binary and whether one was found, checking KAGE_CHROME, CHROME_BIN, rod's own lookup, and the common system install locations. Tests use it to skip when no browser is present.
Types ¶
type Options ¶
type Options struct {
Headless bool // run Chrome without a window
Workers int // max concurrent pages
Settle time.Duration // network-idle quiet period after load
RenderTimeout time.Duration // hard cap per page render
Scroll bool // auto-scroll to trigger lazy-loaded media
ChromeBin string // explicit binary; empty = autodetect
ControlURL string // attach to an existing Chrome instead of launching
}
Options configure a Pool.
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns the baseline render settings.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool owns one Chrome process shared across a run and bounds the number of pages open at once.
type RenderResult ¶
type RenderResult struct {
HTML string // the serialised final DOM
FinalURL string // URL after any client-side redirects
Title string
}
RenderResult is the outcome of rendering one page.