browserrender

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package browserrender is memcode's OPTIONAL local browser-render capability: the last-resort fetch tier for JavaScript-rendered pages that raw GET and the server-side web_fetch (both no-JS) cannot read. It is NOT bundled — it drives a Chrome/Chromium already on the machine via headless --dump-dom (no Node, no new dependency). A managed, on-demand-downloaded browser can be added later under ~/.memcode/tools/browser-render without changing callers.

Rendering executes the page's JavaScript locally, so callers MUST gate it behind explicit user consent — use only for pages the user trusts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Available

func Available() bool

Available reports whether a browser renderer is usable right now.

func Find

func Find() (string, bool)

Find returns the path to a usable Chrome/Chromium and whether one was found. It checks a managed install first, then PATH, then the OS's standard locations.

func ManagedDir

func ManagedDir() string

ManagedDir is where an on-demand-installed browser would live (future installer).

func Render

func Render(ctx context.Context, url string) (string, error)

Render loads url in headless Chrome via the DevTools protocol — executing the page's JavaScript and WAITING for the client render to settle — and returns the rendered DOM HTML. (A plain `--dump-dom` captures the empty shell before SPA content loads, so we drive it properly with chromedp.) The caller must obtain user consent first, since this runs arbitrary page JS locally.

Types

This section is empty.

Jump to

Keyboard shortcuts

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