chromatic
Version:
Automate visual testing across browsers. Gather UI feedback. Versioned documentation.
11 lines (9 loc) • 324 B
JavaScript
/* eslint-env browser */
export default function isChromatic(windowArgument) {
const windowToCheck = windowArgument || (typeof window !== 'undefined' && window);
return !!(
windowToCheck &&
(/Chromatic/.test(windowToCheck.navigator.userAgent) ||
/chromatic=true/.test(windowToCheck.location.href))
);
}