Skip to content

Freeze animated images and hide scrollbars #42

Closed

Description

@tmashara

What
Animated GIFs (and animated WebP/APNG) keep playing during capture. Scrollbars are hidden only as a side effect of how Chromium runs headless.

Why
An animated image lands on a different frame on each load, so it shows up as unstable pixels or a reg on every run of unrelated changes, the same way video did before #29. Nothing stops scrollbars from appearing either, e.g. on the installed-Chrome fallback.

How

  • In capture.ts, before the shot, replace every animated img with its first frame: draw it to a canvas and set the data URL as src, keeping the box size. Do the same for CSS background-image GIFs where that's cheap.
  • Add ::-webkit-scrollbar{display:none} and scrollbar-width:none to STILL_CSS in config.ts.
  • List both under "What was neutralized" in the report.

Prior art

  • testivai-oss hides scrollbars with the Chrome launch flag --hide-scrollbars (packages/witness/src/standalone/launcher.ts:109). Pass it in the launch args, which also covers the installed-Chrome fallback; keep the CSS rule only if the flag turns out not to apply there.
  • uiverify.ai holds GIF, WebP, APNG and SVG <animate> on the first frame. Percy has the same as an opt-in, freezeAnimatedImage.

Activity

  1. added
    enhancement
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions