UNPKG

chromatic

Version:

Automate visual testing across browsers. Gather UI feedback. Versioned documentation.

9 lines (8 loc) 304 B
export default function isChromatic(windowArgument) { const windowToCheck = windowArgument || (globalThis.window !== undefined && globalThis); return !!( windowToCheck && (/Chromatic/.test(windowToCheck.navigator.userAgent) || /chromatic=true/.test(windowToCheck.location.href)) ); }