feat(lightpanda): load linked stylesheets by default

Merged
CD
7d ago
+27-10

What and why

  • lightpanda() loads linked stylesheets by default: loadResources defaults to ['stylesheet'] instead of []
  • Without them, Lightpanda computes styles from inline styles and <style> blocks only: every rule from a linked .css file is missing
  • That changes what a test reads: toBeVisible and toBeHidden, actions that wait for a visible node, the agent's screen tree, and getComputedStyle in the page or in evaluate
  • Lightpanda's own mcp and agent modes load stylesheets by default for the same reason (lightpanda-io/browser#3922)
  • A loadResources list still replaces the default, as --load-resources does in Lightpanda; [] fetches none

Issue

None.

Verified

Ran it locally: yes

  • Playwright over CDP on Lightpanda 1.0.4, a link in a menu that a linked stylesheet hides with .menu { display: none }:

    displayisVisible()click
    no stylesheets (today's default)blocktruegoes through
    --load-resources stylesheetnonefalsewaits for the link to be visible
  • pnpm --filter @e2e-dev/lightpanda test: Tests 10 passed (10)

  • test:lightpanda in apps/testbed, twice each way on Lightpanda 1.0.4: the same 66 pass and 11 fail with and without stylesheets, about 46 s per run either way

Checklist

  • Changeset added (pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.
  • Breaking change: title carries !, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md).
  • Docs updated in the same PR: the docs/**/*.mdx page for the behavior, and skills/e2e/ if the skill describes it.
  • Contract change: emitted .d.ts reviewed, tests/types/sdk-types.ts updated; wire change edits the schema and both fixtures.
  • Engine contract change (e2e/engine): changesets for e2e, @e2e-dev/web, and @e2e-dev/mobile.