From 68bf958ce3003e5993bebb6f332f67f8cc15a91f Mon Sep 17 00:00:00 2001 From: Rob Holland Date: Mon, 8 May 2017 13:36:03 +0100 Subject: [PATCH] If we receive an updated frame ensure we reset `cur` if required. Prior to this change `cur` can be stale, meaning the frame returned for `WaitFrame(ctxt, cdptypes.EmptyFrameID)` will be out of date, and never updated based on incoming events. --- handler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/handler.go b/handler.go index eae0d92..39ded67 100644 --- a/handler.go +++ b/handler.go @@ -524,6 +524,9 @@ func (h *TargetHandler) pageEvent(ctxt context.Context, ev interface{}) { case *page.EventFrameNavigated: h.Lock() h.frames[e.Frame.ID] = e.Frame + if h.cur != nil && h.cur.ID == e.Frame.ID { + h.cur = e.Frame + } h.Unlock() return