I did a workaround by hard-coding some javascript into the browser before anything and then listening to the alert box text in the console.
here the code for reference:
func main() {
// create context
ctx, cancel := chromedp.NewContext(context.Background())
defer cancel()
// run task list
var res interface{}
err := chromedp.Run(ctx,
chromedp.Navigate(`https://www.quackit.com/javascript/javascript_alert_box.cfm`), // navigate to random page
chromedp.EvaluateAsDevTools(`window.alert = function (txt){return txt}`, &res), // set a function to return the text in the alert box as text
chromedp.EvaluateAsDevTools(`alert('hehe')`, &res), // create an alert box to test the execution
)
if err != nil {
log.Fatal(err)
}
log.Println(res)
}
it will log in your console the res.
Hope it helps ;)