profiles

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package profiles ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFlavour

func GetFlavour(pm ProfileManager, baseDir string) string

GetFlavour Returns flavour of browser given a normalized browser base dir TEST: DEAD:

Types

type BrowserDef

type BrowserDef = browsers.BrowserDef

type CustomProfile added in v1.2.0

type CustomProfile struct {
	Name    string
	Path    string
	Flavour string
}

type INIProfileLoader

type INIProfileLoader struct {
	// The absolute path to the directory where profiles.ini is located
	BasePath     string
	ProfilesFile string
}

func (*INIProfileLoader) GetPath

func (pg *INIProfileLoader) GetPath() string

func (*INIProfileLoader) SetBaseDir

func (pg *INIProfileLoader) SetBaseDir(dir string)

type PathResolver

type PathResolver interface {
	GetPath() string
	SetBaseDir(string)
}

PathResolver allows custom path resolution for profiles

type Profile

type Profile struct {
	// Unique identifier for the profile
	ID string

	// Name of the profile
	// This is usually the name of the directory where the profile is stored
	Name string

	// path to profile
	// relative when IsRelative is true
	Path string

	IsRelative bool

	// Base dir of the profile
	BaseDir string

	IsCustom bool
}

func FromCustom added in v1.2.0

func FromCustom(list []CustomProfile, flavour string) []*Profile

func (Profile) AbsolutePath

func (p Profile) AbsolutePath() (string, error)

func (Profile) ShortBaseDir added in v1.2.0

func (p Profile) ShortBaseDir() string

returns shortcut for path

type ProfileManager

type ProfileManager interface {

	// Returns all profiles for a given flavour
	GetProfiles(flavour string) ([]*Profile, error)

	// If should watch all profiles
	WatchAllProfiles() bool

	// Notifies the module to use a custom profile and flavour
	UseProfile(p *Profile, f *BrowserDef) error

	// Get current active profile
	GetProfile() *Profile

	// Returns all flavours supported by this module
	ListFlavours() []BrowserDef

	// Get current active flavour
	GetCurFlavour() *BrowserDef
}

ProfileManager is any module that can detect or list profiles, usually a browser module. One profile manager should be created for each browser flavour.

Jump to

Keyboard shortcuts

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