chromium

package
v0.0.0-...-fcc6260 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package chromium 通过 CDP 管理共享浏览器及每次渲染的独立上下文。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Factory

func Factory(executable string) func() (htmlrender.Backend, error)

Factory 使多个并行任务槽共享同一个 browser;每个任务仍使用独立页面。

func New

func New(executable string) (htmlrender.Backend, error)

New 启动浏览器;executable 为空时由 chromedp 查找浏览器程序。

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend 持有共享浏览器;每次 Render 创建独立页面上下文。

func (*Backend) Close

func (b *Backend) Close() error

Close 关闭共享浏览器,并保留第一次关闭的结果。

func (*Backend) Render

func (b *Backend) Render(ctx context.Context, doc htmlrender.Document) (image.Image, error)

Render 等待页面、字体与图片就绪,返回整页、viewport 或指定元素的截图。

Jump to

Keyboard shortcuts

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