Skip to content

Implement alert dismissal for screenshot functionality #2267

Description

@coderabbitai

This issue tracks the implementation of automatic JavaScript alert dismissal when taking screenshots to prevent browser timeouts.

Background

On pages with JavaScript alerts, the browser times out because the alert blocks page loading. This prevents successful screenshot capture.

Solution

Implement automatic alert dismissal by:

  • Registering a PageJavascriptDialogOpening event handler
  • Automatically accepting dialogs with PageHandleJavaScriptDialog
  • Setting up event-based handling before navigation

Reference

Files to modify

  • runner/headless.go: ScreenshotWithBody method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions