chromium

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBrowserType

func NewBrowserType(ctx context.Context) api.BrowserType

NewBrowserType returns a new Chrome browser type. Before returning a new browser type: - Initializes the extension-wide context - Initializes the goja runtime.

Types

type Browser

type Browser struct {
	common.Browser
}

Browser is the public interface of a CDP browser.

type BrowserType

type BrowserType struct {
	Ctx      context.Context
	CancelFn context.CancelFunc
	// contains filtered or unexported fields
}

BrowserType provides methods to launch a Chrome browser instance or connect to an existing one. It's the entry point for interacting with the browser.

func (*BrowserType) Connect

func (b *BrowserType) Connect(opts goja.Value)

Connect attaches k6 browser to an existing browser instance.

func (*BrowserType) ExecutablePath

func (b *BrowserType) ExecutablePath() (execPath string)

ExecutablePath returns the path where the extension expects to find the browser executable.

func (*BrowserType) Launch

func (b *BrowserType) Launch(opts goja.Value) api.Browser

Launch allocates a new Chrome browser process and returns a new api.Browser value, which can be used for controlling the Chrome browser.

func (*BrowserType) LaunchPersistentContext

func (b *BrowserType) LaunchPersistentContext(userDataDir string, opts goja.Value) api.Browser

LaunchPersistentContext launches the browser with persistent storage.

func (*BrowserType) Name

func (b *BrowserType) Name() string

Name returns the name of this browser type.

type DataStore added in v0.3.0

type DataStore struct {
	Dir string // path to the data storage directory
	// contains filtered or unexported fields
}

DataStore manages data storage for the extension and user specific data.

func (*DataStore) Cleanup added in v0.3.0

func (d *DataStore) Cleanup()

Cleanup removes the temporary directory. it is named as Cleanup because it can be used for other features in the future.

func (*DataStore) Make added in v0.3.0

func (d *DataStore) Make(tmpDir string, dir interface{}) error

Make creates a new temporary directory in tmpDir, and stores the path to the directory in the Dir field. When the Dir argument is not empty, no directory will be created.

Jump to

Keyboard shortcuts

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