session

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package session manages page-scoped CDP target sessions for the HTML driver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Info target.Info
	Conn *rpcc.Conn
	CDP  *cdp.Client

	ID       target.SessionID
	TargetID target.ID
	// contains filtered or unexported fields
}

func (*Client) Close

func (c *Client) Close() error

type Event

type Event struct {
	Client *Client
	Kind   EventKind
}

type EventKind

type EventKind int
const (
	EventAttached EventKind = iota + 1
	EventDetached
)

type Listener

type Listener func(Event)

type ListenerID

type ListenerID int64

type Manager

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

func New

func New(
	ctx context.Context,
	browserConn *rpcc.Conn,
	browserClient *cdp.Client,
	rootTargetID target.ID,
) (*Manager, error)

func (*Manager) AddListener

func (m *Manager) AddListener(listener Listener) ListenerID

func (*Manager) ClientByTarget

func (m *Manager) ClientByTarget(targetID target.ID) (*Client, bool)

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) RemoveListener

func (m *Manager) RemoveListener(id ListenerID)

func (*Manager) Root

func (m *Manager) Root() *Client

func (*Manager) Snapshot

func (m *Manager) Snapshot() []*Client

Jump to

Keyboard shortcuts

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