This repository has been archived by the owner on Jan 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.go
80 lines (64 loc) · 1.55 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package screenshot
import (
"time"
)
// Config - options for URL screenshot function.
type Config struct {
CMD string
Host string
ProfileDir string
URL string
AcceptLanguage string
UserAgent string
Flags []string
FullPage bool
RandomProfileDir bool
Port int
WindowWidth int
WindowHeight int
PaddingTop int
PaddingBottom int
PaddingLeft int
PaddingRight int
Wait time.Duration
ContextDeadline time.Duration
}
// DefaultConfig - creates structure with default values.
func DefaultConfig() Config {
return Config{
CMD: "/usr/bin/google-chrome-stable",
Host: "127.0.0.1",
RandomProfileDir: true,
WindowWidth: 1920,
WindowHeight: 1080,
URL: "https://google.com",
AcceptLanguage: "*",
Wait: 5 * time.Second,
ContextDeadline: 300 * time.Second,
// https://peter.sh/experiments/chromium-command-line-switches/
Flags: []string{
"--autoplay-policy=document-user-activation-required",
"--disable-client-side-phishing-detection",
"--disable-cloud-import",
"--disable-default-apps",
"--disable-dinosaur-easter-egg",
"--disable-gpu",
"--disable-logging",
"--disable-new-tab-first-run",
"--disable-offer-upload-credit-cards",
"--disable-signin-promo",
"--disable-sync",
"--disable-translate",
"--headless",
"--hide-scrollbars",
"--ignore-certificate-errors",
"--mute-audio",
"--no-default-browser-check",
"--no-first-run",
"--no-pings",
"--no-referrers",
"--no-sandbox",
"--password-store=basic",
},
}
}