Skip to content

Conversation

@mertunsall
Copy link
Collaborator

@mertunsall mertunsall commented Nov 24, 2025

  • Add ClickCoordinateEvent to handle coordinate-based clicking via CDP
  • Replace broken page.mouse.click() with CDP Input.dispatchMouseEvent
  • Add safety checks for file inputs, select elements, and print dialogs
  • Add get_dom_element_at_coordinates() to BrowserSession for element detection
  • Add force parameter to ClickElementAction to optionally skip safety checks
  • Update _click_by_coordinate to dispatch ClickCoordinateEvent instead of using mouse

This fixes coordinate clicking functionality by using CDP directly instead of the broken Actor mouse object, matching the implementation from mert/everything_coordinates.


Note

Introduce ClickCoordinateEvent and replace mouse-based coordinate clicks with CDP Input.dispatchMouseEvent, adding safety checks and an optional force mode.

  • Events
    • Add ClickCoordinateEvent (x/y/button, force flag) with timeout.
  • BrowserSession
    • Add get_dom_element_at_coordinates(x, y) using DOM.getNodeForLocation returning minimal EnhancedDOMTreeNode.
  • DefaultActionWatchdog
    • Handle ClickCoordinateEvent with safety checks (file input, <select>, print -> PDF) and optional force.
    • Implement _click_on_coordinate using CDP Input.dispatchMouseEvent (move/press/release) with timeouts and logging.
    • Minor: model rebuild for new event; improved error paths.
  • Tools (service.py, views.py)
    • Extend ClickElementAction with force: bool.
    • Replace actor page.mouse.click with dispatch of ClickCoordinateEvent; convert LLM-scaled coords; return metadata/validation errors; handle BrowserError.
  • Overall
    • Coordinate clicking now uses CDP directly with guardrails and optional bypass, improving reliability.

Written by Cursor Bugbot for commit 36b2b93. Configure here.


Summary by cubic

Fixes broken coordinate-based clicking by switching to CDP Input.dispatchMouseEvent. Adds ClickCoordinateEvent with safety checks and an optional force mode.

  • New Features

    • ClickCoordinateEvent to click by viewport coordinates via CDP.
    • Safety checks for file inputs, selects, and print buttons; print clicks can auto-generate PDFs.
    • BrowserSession.get_dom_element_at_coordinates for lightweight element detection.
    • force flag on ClickElementAction to skip checks when needed.
  • Bug Fixes

    • Coordinate clicks now work reliably and surface validation errors via the event bus.

Written for commit b2c56f6. Summary will update automatically on new commits.

- Add ClickCoordinateEvent to handle coordinate-based clicking via CDP
- Replace broken page.mouse.click() with CDP Input.dispatchMouseEvent
- Add safety checks for file inputs, select elements, and print dialogs
- Add get_dom_element_at_coordinates() to BrowserSession for element detection
- Add force parameter to ClickElementAction to optionally skip safety checks
- Update _click_by_coordinate to dispatch ClickCoordinateEvent instead of using mouse

This fixes coordinate clicking functionality by using CDP directly instead of
the broken Actor mouse object, matching the implementation from mert/everything_coordinates.
@github-actions
Copy link

github-actions bot commented Nov 24, 2025

Agent Task Evaluation Results: 2/2 (100%)

View detailed results
Task Result Reason
amazon_laptop ✅ Pass Skipped - API key not available (fork PR or missing secret)
browser_use_pip ✅ Pass Skipped - API key not available (fork PR or missing secret)

Check the evaluate-tasks job for detailed task execution logs.

@MagMueller
Copy link
Collaborator

Evaluation Results

Commit: 36b2b93Score: ✅ 100.0%

📊 View Details

Summary

  • Success Rate: ✅ 100.0%
  • Average Steps: 6.0 steps/task
  • Average Time: 16.5 sec/task
  • Average Time per Step: 2.7s/step

Automated evaluation by browser-use

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@MagMueller
Copy link
Collaborator

Evaluation Results

Commit: 0f315beScore: ✅ 100.0%

📊 View Details

Summary

  • Success Rate: ✅ 100.0%
  • Average Steps: 6.4 steps/task
  • Average Time: 16.7 sec/task
  • Average Time per Step: 2.6s/step

Automated evaluation by browser-use

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="browser_use/browser/watchdogs/default_action_watchdog.py">

<violation number="1" location="browser_use/browser/watchdogs/default_action_watchdog.py:232">
`get_dom_element_at_coordinates` returns nodes without tag names or attributes, so the new safety checks in `on_ClickCoordinateEvent` never trigger and risky elements (file inputs, selects, print buttons) can still be clicked.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="browser_use/browser/session.py">

<violation number="1" location="browser_use/browser/session.py:1968">
Constructed nodes for coordinate clicks always have an empty node_name, so tag‑based safety checks (file inputs, &lt;select&gt;, print buttons) never execute. Populate node_name from DOM.getNodeForLocation before returning the node.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@MagMueller
Copy link
Collaborator

Evaluation Results

Commit: b2c56f6Score: ✅ 97.4%

📊 View Details

Summary

  • Success Rate: ✅ 97.4%
  • Average Steps: 5.8 steps/task
  • Average Time: 15.7 sec/task
  • Average Time per Step: 2.7s/step

Automated evaluation by browser-use

@mertunsall mertunsall merged commit ab344ca into main Nov 24, 2025
51 checks passed
@mertunsall mertunsall deleted the fix/replace-mouse-click-with-coordinate-event branch November 24, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants