Help us shape the future of Go! Take the 2026 Go Developer Survey

render

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package render estimates how much of a page depends on JavaScript, which most AI agents do not execute.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyze

func Analyze(body []byte) *types.JSInfo

Analyze inspects a raw (unrendered) HTML response.

func Compare

func Compare(raw, rendered []byte) *types.RenderResult

Compare measures how much visible text only exists after JavaScript runs.

func Headless

func Headless(ctx context.Context, url string, opts Options) ([]byte, error)

Headless loads url in a local headless Chrome and returns the rendered HTML. Chrome or Chromium must be installed.

Types

type Options

type Options struct {
	// Timeout bounds the whole render.
	Timeout time.Duration
	// Wait is how long to let scripts run after the DOM is ready.
	Wait time.Duration
	// UserAgent is sent by the headless browser. Empty keeps Chrome's own.
	UserAgent string
}

Options configures headless rendering.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL