target

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package target resolves a <target> spec against the live set of Chrome tabs.

Grammar (live-resolved, no stale cache):

<idprefix>      unique prefix of the CDP target id (canonical, case-insensitive)
url:<substr>    case-insensitive substring match on the tab URL
title:<substr>  case-insensitive substring match on the tab title
@N              1-based index into the current list order (ephemeral)

Index

Constants

View Source
const NoCurrentTargetMsg = `no target given and no current tab set — run "chrome-cdp list", then "use <target>" or pass --target`

NoCurrentTargetMsg is the message used when no target is given and none is sticky. Shared so the CLI's pre-connect guard and Resolve stay in sync.

Variables

This section is empty.

Functions

func Resolve

func Resolve(spec string, targets []Info) (Info, *Error)

Resolve maps a spec to exactly one target, or returns an *Error whose Code is one of: no_current_target, target_not_found, ambiguous_target.

Types

type Error

type Error struct {
	Code    string
	Message string
}

Error is a resolution failure carrying a stable error.code.

func (*Error) Error

func (e *Error) Error() string

type Info

type Info struct {
	ID    string
	Title string
	URL   string
}

Info identifies a resolvable tab.

Jump to

Keyboard shortcuts

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