From 69d4b39eff84dd9df9248d4fe803052f28efb130 Mon Sep 17 00:00:00 2001 From: Antoni Sawicki <tenox@google.com> Date: Tue, 4 Jun 2019 01:23:46 -0700 Subject: [PATCH] restored context --- wrp.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wrp.go b/wrp.go index 7cf41dd..5db9c5c 100644 --- a/wrp.go +++ b/wrp.go @@ -42,6 +42,8 @@ type Ismap struct { var ( version = "3.0" + ctx context.Context + cancel context.CancelFunc gifmap = make(map[string]bytes.Buffer) ismap = make(map[string][]Ismap) ) @@ -269,9 +271,9 @@ func main() { actx, cancel := chromedp.NewExecAllocator(context.Background(), opts...) defer cancel() if debug { - ctx, cancel := chromedp.NewContext(actx, chromedp.WithDebugf(log.Printf)) + ctx, cancel = chromedp.NewContext(actx, chromedp.WithDebugf(log.Printf)) } else { - ctx, cancel := chromedp.NewContext(actx) + ctx, cancel = chromedp.NewContext(actx) } defer cancel() rand.Seed(time.Now().UnixNano())