Documentation
¶
Index ¶
- Variables
- func GetRandomScreenSize(device_type string) (string, error)
- type Asset
- func (a *Asset) Backup(dir_root string, today string) (bool, error)
- func (a *Asset) Check() (bool, error)
- func (a *Asset) Copy(dir_profile string) (bool, error)
- func (a *Asset) FullPath() string
- func (a *Asset) Restore(dir_root string, today string) (bool, error)
- func (a *Asset) ToBackupDir(dir_root string, today string) string
- type Browser
- type Chameleon
- type Config
- type Device
- type FPManager
- func (m *FPManager) Check() (bool, error)
- func (m *FPManager) CreateFP(group string, id string, lang string, proxy_url string, os_family string, ...) (fp FingerPrint, err error)
- func (m *FPManager) DeleteFP(fp *FingerPrint) (bool, error)
- func (m *FPManager) DirOfProfile(fp *FingerPrint) string
- func (m *FPManager) FillProfile(fp *FingerPrint) (bool, error)
- func (m *FPManager) GetFP(id string) (FingerPrint, error)
- func (m *FPManager) InitChameleon() (Chameleon, error)
- func (m *FPManager) LoadFPs(f string) ([]FingerPrint, error)
- func (m *FPManager) RemoveProfile(fp *FingerPrint) (bool, error)
- func (m *FPManager) SaveFPs(f string, indent bool) (bool, error)
- func (m *FPManager) StartProfile(fp *FingerPrint) (bool, error)
- func (m *FPManager) StartProfileByID(id string) (bool, error)
- func (m *FPManager) UpdateFP(fp *FingerPrint, add bool)
- type FingerPrint
- type GeoAddr
- type Location
- type OperationSystem
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // profile folder: `{prefix}{seperator}{name}` // profile folder: `{group}{seperator}{id}` PROFILE_SEPERATOR string = "--" // firefox extensions file names EXTENSIONS = map[string]string{ "Chameleon": "{3579f63b-d8ee-424f-bbb6-6d0ce3285e6a}.xpi", "Dark Reader": "addon@darkreader.org.xpi", "Simple Translate": "simple-translate@sienori.xpi", "HypeStat Analyzer": "{6d930f30-aa68-421f-83b8-71322461bdaa}.xpi", "Vimium": "vimium-c@gdh1995.cn.xpi", } )
Functions ¶
func GetRandomScreenSize ¶
Types ¶
type Asset ¶
type Asset struct {
Kind string // exe|profile
DirParent string // dir_exe|dir_profile
DirSegments []string
FileName string // filename.ext
}
func DefaultAssets ¶
init default assets
func (*Asset) Backup ¶
backup Asset file into Cache dir date string, eg: `today := time.Now().Format(time.RFC3339)`
type Chameleon ¶
func (*Chameleon) UpdateByFP ¶
func (cs *Chameleon) UpdateByFP(fp *FingerPrint) bool
type Config ¶
type Config struct {
Debug bool `toml:"Debug"`
// Root dir of this project, auto resolved, Don't change this
DirRoot string `toml:"DirRoot"`
// profiles folder
DirProfiles string `toml:"DirProfiles"`
// Firefox Exeutable, eg `D:\Portable\FirefoxPortable\App\Firefox`
ExePath string `toml:"ExePath"`
// profile name = prefix + seperator + id
Seperator string `toml:"Seperator"`
}
func (*Config) ToDirAssets ¶
type Device ¶
type Device struct {
Browser Browser // `json:"Browser"`
OS OperationSystem // `json:"OS"`
Type string // `json:"Type"`
Language string // `json:"Language"`
ScreenSize string // `json:"ScreenSize"`
}
type FPManager ¶
type FPManager struct {
Config Config
Assets []Asset
FingerPrints []FingerPrint
}
Firefox FingerPrint Manager
func (*FPManager) CreateFP ¶
func (m *FPManager) CreateFP( group string, id string, lang string, proxy_url string, os_family string, br_family string, device_type string, ) (fp FingerPrint, err error)
create FingerPrint item, but no folders/files yet.
func (*FPManager) DeleteFP ¶
func (m *FPManager) DeleteFP(fp *FingerPrint) (bool, error)
delete FingerPrint item, without touch folders/files yet
func (*FPManager) DirOfProfile ¶
func (m *FPManager) DirOfProfile(fp *FingerPrint) string
get dir of Profile for FingerPrint
func (*FPManager) FillProfile ¶
func (m *FPManager) FillProfile(fp *FingerPrint) (bool, error)
fill Profile folder from demo profile folder
func (*FPManager) GetFP ¶
func (m *FPManager) GetFP(id string) (FingerPrint, error)
get FingerPrint by id
func (*FPManager) InitChameleon ¶
init Chameleon
func (*FPManager) LoadFPs ¶
func (m *FPManager) LoadFPs(f string) ([]FingerPrint, error)
load FingerPrint items from local file
func (*FPManager) RemoveProfile ¶
func (m *FPManager) RemoveProfile(fp *FingerPrint) (bool, error)
remove profile folder for FingerPrint item
func (*FPManager) StartProfile ¶
func (m *FPManager) StartProfile(fp *FingerPrint) (bool, error)
run shell command for FingerPrint
func (*FPManager) StartProfileByID ¶
run shell command for Profile by id
func (*FPManager) UpdateFP ¶
func (m *FPManager) UpdateFP(fp *FingerPrint, add bool)
update FingerPrint, or add it if not exist yet
type FingerPrint ¶
type OperationSystem ¶
func GetRandomOS ¶
func GetRandomOS(family string) (OperationSystem, error)
get random OS by family abbr, eg: `win`, `lin`, etc. see package chameleon for details
Click to show internal directories.
Click to hide internal directories.