From 0db0e4447b536863c1a9403fa53a4714d02933aa Mon Sep 17 00:00:00 2001 From: ankur22 Date: Fri, 22 Nov 2024 20:19:56 +0000 Subject: [PATCH] Fix panic in onFrameRequestedNavigation This panic is unnecessary since the event is associated to a stale frame that no longer exists in memory. --- common/frame_manager.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/frame_manager.go b/common/frame_manager.go index 0a675b666..5f0920079 100644 --- a/common/frame_manager.go +++ b/common/frame_manager.go @@ -389,7 +389,10 @@ func (m *FrameManager) frameRequestedNavigation(frameID cdp.FrameID, url string, m.logger.Debugf("FrameManager:frameRequestedNavigation:nilFrame:return", "fmid:%d fid:%v url:%s docid:%s", m.ID(), frameID, url, documentID) - return fmt.Errorf("no frame exists with ID %s", frameID) + // If a frame doesn't exist then the call to this method (which + // originates from a EventFrameRequestedNavigation CDP event) is on a + // stale frame that no longer exists in memory. + return nil } m.barriersMu.RLock()