MCPcopy Create free account
hub / github.com/diillson/chatcli / preparePage

Function preparePage

cli/plugins/webfetch_render.go:334–339  ·  view source on GitHub ↗

preparePage applies the UA override and installs the SSRF hijack before any navigation happens.

(page *rod.Page)

Source from the content-addressed store, hash-verified

332// preparePage applies the UA override and installs the SSRF hijack before
333// any navigation happens.
334func preparePage(page *rod.Page) error {
335 if err := page.SetUserAgent(&proto.NetworkSetUserAgentOverride{UserAgent: browserUA()}); err != nil {
336 return fmt.Errorf("setting user agent: %w", err)
337 }
338 return hijackPageRequests(page)
339}
340
341// navigateAndSerialize drives the actual navigation and returns the
342// settled DOM, capped at maxRenderedHTMLBytes.

Callers 1

renderPageHTMLFunction · 0.85

Calls 3

browserUAFunction · 0.85
hijackPageRequestsFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected