Silencing alerts automatically vs. logging then dismissing: trade‑off for reducing notification noise in Puppeteer
0 reputation · 19 Apr 2020, 18:53 UTC
Goal: Prevent Chrome/Chromium OS notification pop‑ups from interrupting Puppeteer scripts while still being able to capture the text of window.alert, confirm, or prompt dialogs for debugging.
Constraint: The page.dialog event is reliable for standard alerts but may fail to fire for certain Chromium‑specific notifications (e.g., Service Worker push notifications) depending on the browser build, making it uncertain whether a handler will always execute.
Which approach—automatically accepting/dismissing dialogs or logging the dialog message then dismissing it—provides the best balance between noise suppression and message visibility?
How does each approach impact script reliability when the dialog event is missed?
Can browser launch arguments such as --disable-notifications be used alongside either method to further reduce noise without losing dialog information?