Skip to content

Commit

Permalink
Merge pull request #2 from rusq/allocator-opts
Browse files Browse the repository at this point in the history
Better way to set the custom options
  • Loading branch information
rusq committed May 3, 2021
2 parents 977eb72 + 6d29b7e commit ce51a99
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions chromedl.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ var UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537
// afterwards. Set the timeout on context if required, by default no timeout is
// set.
func Get(ctx context.Context, uri string) (io.Reader, error) {
opts := [...]func(*chromedp.ExecAllocator){
chromedp.NoFirstRun,
chromedp.NoDefaultBrowserCheck,
chromedp.Headless,

opts := append(chromedp.DefaultExecAllocatorOptions[:],
chromedp.UserAgent(UserAgent),
}
)

allocCtx, cancel := chromedp.NewExecAllocator(ctx, opts[:]...)
defer cancel()
Expand Down

0 comments on commit ce51a99

Please sign in to comment.