Documentation
¶
Overview ¶
Package profiles holds the built-in browser profiles, one embedded JSON file per browser version and platform, taken from captures of the real browser. Every accessor returns a fresh copy. Chrome, Firefox and Safari track each browser's newest version on macOS; an accessor named for the browser and another platform, such as ChromeWindows, tracks the newest on that platform and exists once that platform has a profile (decision 0047). Versioned accessors (Chrome156MacOS) stay fixed. The accessors are generated by cmd/profilegen (go generate ./profiles).
Index ¶
- func ByName(name string) (*profile.Profile, error)
- func Chrome() *profile.Profile
- func Chrome155MacOS() *profile.Profile
- func Chrome156MacOS() *profile.Profile
- func Chrome156Windows() *profile.Profile
- func ChromeWindows() *profile.Profile
- func Firefox() *profile.Profile
- func Firefox158MacOS() *profile.Profile
- func Names() []string
- func Safari() *profile.Profile
- func Safari26MacOS() *profile.Profile
- func Safari27MacOS() *profile.Profile
- func Supported() []string
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByName ¶
ByName returns a fresh copy of the built-in profile called name, for example "chrome-155-macos".
Example ¶
Pick the profile a task names in its configuration. Each call returns a fresh copy.
package main
import (
"fmt"
"log"
"github.com/roachadam/mimicry"
"github.com/roachadam/mimicry/profiles"
)
func main() {
p, err := profiles.ByName("safari-27-macos")
if err != nil {
log.Fatal(err)
}
fmt.Println(p.Browser, p.Version, p.Platform)
if _, err := mimicry.NewClient(mimicry.Config{
Profile: p,
}); err != nil {
log.Fatal(err)
}
_, err = profiles.ByName("chrome-133")
fmt.Println(err)
}
Output: safari 27 macos profiles: "chrome-133" is not a built-in profile
func Chrome ¶
Chrome returns a fresh copy of the newest chrome profile, now chrome-156-macos (chrome 156 on macos). It moves to each new version as that version is added; use a versioned accessor where a version must stay fixed.
func Chrome155MacOS ¶
Chrome155MacOS returns a fresh copy of the chrome-155-macos profile (chrome 155 on macos).
func Chrome156MacOS ¶
Chrome156MacOS returns a fresh copy of the chrome-156-macos profile (chrome 156 on macos).
func Chrome156Windows ¶
Chrome156Windows returns a fresh copy of the chrome-156-windows profile (chrome 156 on windows).
func ChromeWindows ¶
ChromeWindows returns a fresh copy of the newest chrome profile on windows, now chrome-156-windows (chrome 156 on windows). It moves to each new version as that version is added; use a versioned accessor where a version must stay fixed.
func Firefox ¶
Firefox returns a fresh copy of the newest firefox profile, now firefox-158-macos (firefox 158 on macos). It moves to each new version as that version is added; use a versioned accessor where a version must stay fixed.
func Firefox158MacOS ¶
Firefox158MacOS returns a fresh copy of the firefox-158-macos profile (firefox 158 on macos).
func Safari ¶
Safari returns a fresh copy of the newest safari profile, now safari-27-macos (safari 27 on macos). It moves to each new version as that version is added; use a versioned accessor where a version must stay fixed.
func Safari26MacOS ¶
Safari26MacOS returns a fresh copy of the safari-26-macos profile (safari 26 on macos).
func Safari27MacOS ¶
Safari27MacOS returns a fresh copy of the safari-27-macos profile (safari 27 on macos).
Types ¶
This section is empty.