Skip to content

Commit ad83070

Browse files
committed
better handling
1 parent 84a54b9 commit ad83070

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

runner/headless.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ func (b *Browser) ScreenshotWithBody(url string, timeout time.Duration, idle tim
104104
if err != nil {
105105
return nil, "", err
106106
}
107-
wait, handle := page.HandleDialog()
108-
go func() {
109-
wait()
110-
handle(&proto.PageHandleJavaScriptDialog{
107+
108+
go page.EachEvent(func(e *proto.PageJavascriptDialogOpening) {
109+
_ = proto.PageHandleJavaScriptDialog{
111110
Accept: true,
112111
PromptText: "",
113-
})
114-
}()
112+
}.Call(page)
113+
})()
114+
115115
for _, header := range headers {
116116
headerParts := strings.SplitN(header, ":", 2)
117117
if len(headerParts) != 2 {

runner/runner.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,6 @@ func makePrintCallback() func(stats clistats.StatisticsClient) interface{} {
713713
builder.WriteString(clistats.String(totalHosts))
714714
builder.WriteRune(' ')
715715
builder.WriteRune('(')
716-
//nolint:gomnd // this is not a magic number
717716
builder.WriteString(clistats.String(uint64(float64(hosts) / float64(totalHosts.(int)) * 100.0)))
718717
builder.WriteRune('%')
719718
builder.WriteRune(')')

0 commit comments

Comments
 (0)