Documentation
¶
Index ¶
Constants ¶
const ( ProfileChromeWinUS = "chrome-win-uhd620" ProfileChromeWinRU = "chrome-win-ru" ProfileChromeMacUS = "chrome-macos-intel-iris" ProfileChromeLinuxUS = "chrome-linux-mesa-uhd620" ProfileChromeLinuxRU = "chrome-linux-ru" )
Variables ¶
var PatchJS []byte
Functions ¶
func DefaultRegionForEngine ¶
func LoadProfilesFromJSON ¶
func NormalizeEngine ¶
func NormalizeRegion ¶
Types ¶
type BrandVersion ¶
type Profile ¶
type Profile struct {
ID string `json:"id"`
UserAgent string `json:"user_agent"`
UACHBrands []BrandVersion `json:"uach_brands"`
UACHFullVerList []BrandVersion `json:"uach_full_version_list"`
Platform string `json:"platform"`
PlatformVersion string `json:"platform_version"`
Architecture string `json:"architecture"`
Bitness string `json:"bitness"`
Mobile bool `json:"mobile"`
AcceptLanguage string `json:"accept_language"`
Locale string `json:"locale"`
Timezone string `json:"timezone"`
Viewport Viewport `json:"viewport"`
WebGLVendor string `json:"webgl_vendor"`
WebGLRenderer string `json:"webgl_renderer"`
Tags []string `json:"tags"`
Weight int `json:"weight"`
}
func ProfileByID ¶ added in v0.7.13
ProfileByID looks up a profile by exact ID. Returns (profile, true) when found, (zero, false) when the ID is not in the catalog. Unlike the internal profileByID, it does not fall back to a default; the caller decides what to do on miss.
func SelectProfile ¶
SelectProfile returns a deterministic profile for the given engine and region. It respects lane_profile_ids overrides and falls back to the OS-preferred default. Used by tests and single-instance callers; internally delegates to SelectProfileForSession with empty salt.
func SelectProfileForSession ¶ added in v0.7.13
SelectProfileForSession picks a profile for (engine, region, salt). If a lane_profile_ids override exists it is always honoured. Empty salt picks the first eligible profile (same as SelectProfile). Non-empty salt uses weighted selection seeded by FNV-1a hash of salt, giving each session a stable but varied profile.