Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit df85e63

Browse files
committed
Add comment for beforeunload why we accept
Resolves: https://github.com/grafana/xk6-browser/pull/663/files#r1035684979
1 parent b7125b9 commit df85e63

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

common/frame_session.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@ func (fs *FrameSession) onEventJavascriptDialogOpening(event *cdppage.EventJavas
272272
"sid:%v tid:%v url:%v dialogType:%s",
273273
fs.session.ID(), fs.targetID, event.URL, event.Type)
274274

275+
// Dialog type of beforeunload needs to accept the
276+
// dialog, instead of dismissing it. We're unable to
277+
// dismiss beforeunload dialog boxes at the moment as
278+
// it seems to pause the exec of any other action on
279+
// the page. I believe this is an issue in Chromium.
275280
action := cdppage.HandleJavaScriptDialog(false)
276281
if event.Type == cdppage.DialogTypeBeforeunload {
277282
action = cdppage.HandleJavaScriptDialog(true)

0 commit comments

Comments
 (0)