Allocator options added
This commit is contained in:
1 parent
29c29235ae
commit
9b266b6cce
2 files changed
+2
-11
No files matched your search
+2
-1
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user