Skip to content

Commit

Permalink
fix(engine): add --incognito flag to chrome & update user-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
hbollon committed Oct 26, 2021
1 parent 083a8be commit a20c0eb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,21 @@ func (s *Selenium) InitChromeWebDriver() {
chromeCaps := chrome.Capabilities{
Path: filepath.FromSlash(chromePath),
Args: []string{
"--incognito",
"--disable-extensions",
"--disable-infobars",
"--disable-dev-shm-usage",
"--no-sandbox",
"--window-size=360,640",
"--window-size=360,740",
},
MobileEmulation: &chrome.MobileEmulation{
DeviceName: "Nexus 5",
DeviceMetrics: &chrome.DeviceMetrics{
Width: 360,
Height: 740,
PixelRatio: 2.05,
},
UserAgent: "Mozilla/5.0 (Linux; Android 8.0.0; SM-G960F Build/R16NW) " +
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36",
},
}
caps.AddChrome(chromeCaps)
Expand Down

0 comments on commit a20c0eb

Please sign in to comment.