browserstore

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSourceChanged   = errors.New("browser source kind cannot change")
	ErrProfileMissing  = errors.New("browser profile does not exist")
	ErrExternalRestore = errors.New("external browser tabs are not restorable by URL")
)

Functions

This section is empty.

Types

type Entry

type Entry struct {
	URL                 string `json:"url"`
	Title               string `json:"title"`
	Visits              int    `json:"visits,omitempty"`
	LastVisitedAtUnixMs int64  `json:"last_visited_at_unix_ms,omitempty"`
}

type Preference

type Preference struct {
	ProfileID      string `json:"profile_id"`
	InstallationID string `json:"installation_id,omitempty"`
}

Preference references library identity only. It carries no target, endpoint, command, credential or authority that could be replayed after a restart.

type Profile

type Profile struct {
	ID   string     `json:"id"`
	Name string     `json:"name"`
	Kind SourceKind `json:"kind"`
}

type SourceKind

type SourceKind string
const (
	Managed   SourceKind = "managed"
	CDP       SourceKind = "cdp"
	Extension SourceKind = "extension"
)

type Store

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

func Open

func Open(path string) (*Store, error)

func (*Store) Bookmarks

func (s *Store) Bookmarks(ctx context.Context, owner, profileID string) ([]Entry, error)

func (*Store) ClearHistory

func (s *Store) ClearHistory(ctx context.Context, owner, profileID string) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) DeleteBookmark

func (s *Store) DeleteBookmark(ctx context.Context, owner, profileID, rawURL string) error

func (*Store) History

func (s *Store) History(ctx context.Context, owner, profileID, query string, limit int) ([]Entry, error)

func (*Store) Preference

func (s *Store) Preference(ctx context.Context, owner string) (*Preference, error)

func (*Store) Profiles

func (s *Store) Profiles(ctx context.Context, owner string) ([]Profile, error)

func (*Store) PutBookmark

func (s *Store) PutBookmark(ctx context.Context, owner, profileID string, entry Entry) error

func (*Store) PutProfile

func (s *Store) PutProfile(ctx context.Context, owner string, profile Profile) error

func (*Store) SaveTabs

func (s *Store) SaveTabs(ctx context.Context, owner, profileID string, tabs []Tab) error

func (*Store) SetPreference

func (s *Store) SetPreference(ctx context.Context, owner string, value Preference) error

func (*Store) SetZoom

func (s *Store) SetZoom(ctx context.Context, owner, profileID, rawOrigin string, zoom float64) error

func (*Store) Tabs

func (s *Store) Tabs(ctx context.Context, owner, profileID string) ([]Tab, error)

func (*Store) UpdateVisitTitle

func (s *Store) UpdateVisitTitle(ctx context.Context, owner, profileID string, entry Entry) error

A later source title update is metadata, not another navigation or visit.

func (*Store) Visit

func (s *Store) Visit(ctx context.Context, owner, profileID string, entry Entry) error

func (*Store) Zoom

func (s *Store) Zoom(ctx context.Context, owner, profileID, rawOrigin string) (float64, error)

type Tab

type Tab struct {
	URL      string `json:"url"`
	Title    string `json:"title"`
	Pinned   bool   `json:"pinned"`
	Selected bool   `json:"selected"`
}

Jump to

Keyboard shortcuts

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