Problem
With --engine lightpanda, snapshot -i lists elements that an external stylesheet hides (display: none via <link rel="stylesheet">). Elements hidden by an inline <style> block are correctly absent. So a desktop page still reports its hidden mobile-menu button as interactive.
Lightpanda 1.0.1 can fix this: --load-resources stylesheet fetches external stylesheets "so their rules contribute to computed styles (and therefore to visibility checks like display, visibility, opacity, pointer-events)". It is the default only for Lightpanda's mcp and agent modes, not for serve, which agent-browser launches. agent-browser rejects --args for Lightpanda (Custom Chrome arguments (--args) are not supported with Lightpanda), so users cannot opt in.
Repro (agent-browser 0.39.1, Lightpanda 1.0.1, macOS arm64)
mkdir lp && cd lp
printf '.hide{display:none}\n' > s.css
printf '<!doctype html><link rel="stylesheet" href="s.css"><style>.inl{display:none}</style><button>Visible</button><button class="hide">ExternalHidden</button><button class="inl">InlineHidden</button>' > index.html
python3 -m http.server 8765 &
agent-browser --engine lightpanda open http://127.0.0.1:8765/
agent-browser snapshot -iActual:
- button "Visible" [ref=e1]
- button "ExternalHidden" [ref=e2]Expected (Chrome, and Lightpanda with the flag): only Visible.
Confirmed by pointing --executable-path at a wrapper that appends --load-resources stylesheet to the serve command: the snapshot then lists only Visible.
Proposal
Pass --load-resources stylesheet when agent-browser launches Lightpanda (Lightpanda ≥ 1.0.1), or expose a Lightpanda-specific option to set --load-resources.
Activity
0No activity yet.