Skip to content

Commit

Permalink
Fix panic in onFrameRequestedNavigation
Browse files Browse the repository at this point in the history
This panic is unnecessary since the event is associated to a stale
frame that no longer exists in memory.
  • Loading branch information
ankur22 committed Nov 25, 2024
1 parent a56ba56 commit 0db0e44
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/frame_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 0db0e44

Please sign in to comment.