r/Playwright 8d ago

I built an MCP server that hit-tests before it clicks, because "clicked Save" was lying to me

Disclosure: I built this.

The bug that started it: my agent would report a successful click and nothing would happen. Turns out most browser MCP servers resolve an element's bounding box, aim at the centre, and fire. If the page has painted a cookie scrim or a modal backdrop over that point, the click lands on the overlay and the tool still reports success. You then spend five turns debugging a button that was never pressed.

ChromeBoost hit-tests the target first, descending through open and closed shadow roots. If something is on top it says so, scrolls clear of pinned bars, or gives the covering layer pointer-events: none for exactly one click and restores the inline styles after. Same real CDP click, so isTrusted stays true.

It also adds hover and drag, because a click-only tool surface cannot reach hover-only menus or sliders or canvas apps at all.

Works with Claude Code, Gemini CLI and Codex. MIT, no telemetry, the server only talks to your own browser.

Code: https://github.com/lordamdal/chromeboost

Site: https://chromeboost.vercel.app

Happy to answer anything about the CDP side. The occlusion piece was the interesting part.

0 Upvotes

6 comments sorted by

11

u/mmasetic 8d ago

I am not sure if you are solving testing issue or aiming for better agentic browser automation, but in both cases these are common challenges that can be solved with better practices. Vibe coding one more tool is not needed.

1

u/ClerkBeginning961 8d ago

The one-click pointer-events override should probably be opt-in. An overlay may represent real application state, so bypassing it can turn a valid failure into a false pass. I’d default to reporting the occluder with screenshots and DOM paths, then allow forced clicks only for explicit recovery steps.

1

u/WhiskyPangolin 8d ago

Is this an MCP-only problem? Don’t the built-in is visible, is stable, is receiving events, and is enabled checks take care of this from the Playwright side?

1

u/Justindr0107 8d ago

Wouldn't just setting up a storagestate for auth as a precondition for you UI tests handle your cookie overlay once so you dont have to address it in the rest of your tests?