Skip to content

window.__RENDERDIFF__ flag and data-renderdiff-mask attribute #49

Closed

Description

@tmashara

What
Two ways for the site under test to cooperate with renderdiff:

  • window.__RENDERDIFF__ = true, set by the init script before any page code runs.
  • A data-renderdiff-mask attribute (optionally with a reason as its value). renderdiff masks any element carrying it, the same as --mask.

Why
Some nondeterminism can only be removed from inside the app: JS-driven charts and carousels, framer-motion, random server-rendered picks. uiverify.ai exposes isUIVerify() for this. The attribute lets a team declare a drifting widget once, in markup, without a config file per repo.

How

  • One line in the existing addInitScript in capture.ts.
  • Add [data-renderdiff-mask] to the mask selectors; the reason from the attribute value, or data-renderdiff-mask, shows up in the report's coverage list like other masks.
  • Document both in docs/scoping.md and the skill.
  • Skip a request header: a custom header turns every cross-origin fetch into a CORS preflight that third parties may reject.

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