Allocator options added

This commit is contained in:
Musab Gültekin committed 2021-01-28 20:49:01 +03:00
1 parent 29c29235ae
commit 9b266b6cce
2 files changed
+2 -11

No files matched your search

+2 -1
View File
@@ -36,6 +36,7 @@ type Options struct {
RetryTimes int
RetryHTTPCodes []int
RemoteAllocatorURL string
AllocatorOptions []chromedp.ExecAllocatorOption
}
// Default values for client
@@ -172,7 +173,7 @@ func (c *Client) doRequestChrome(req *Request) (*Response, error) {
if c.opt.RemoteAllocatorURL != "" {
ctx, cancel = chromedp.NewRemoteAllocator(ctx, c.opt.RemoteAllocatorURL)
} else {
ctx, cancel = chromedp.NewExecAllocator(context.Background())
ctx, cancel = chromedp.NewExecAllocator(context.Background(), c.opt.AllocatorOptions...)
}
ctx, cancel = chromedp.NewContext(ctx)
defer cancel()