Allocators seperated for transparency. Updated chrome library.

This commit is contained in:
Musab Gültekin committed 2020-09-05 16:14:41 +03:00
1 parent cfb16fe1ee
commit 7a76a9b95e
3 files changed
+19 -6

No files matched your search

+6 -3
View File
@@ -170,11 +170,14 @@ func (c *Client) doRequestChrome(req *Request) (*Response, error) {
var res *network.Response
// Set remote allocator or use local chrome instance
ctx := context.Background()
var ctx context.Context
var cancel context.CancelFunc
if c.opt.RemoteAllocatorURL != "" {
ctx, _ = chromedp.NewRemoteAllocator(ctx, c.opt.RemoteAllocatorURL)
ctx, cancel = chromedp.NewRemoteAllocator(ctx, c.opt.RemoteAllocatorURL)
} else {
ctx, cancel = chromedp.NewExecAllocator(context.Background())
}
ctx, cancel := chromedp.NewContext(ctx)
ctx, cancel = chromedp.NewContext(ctx)
defer cancel()
if err := chromedp.Run(ctx,