Stop analytics tracking if running under Cypress tests (#850)

* Stop tracking if running under Cypress tests

* Update CHANGELOG.md
pull/861/head
Iiro Krankka 6 years ago committed by GitHub
parent 432ad2a606
commit dde5116a76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- Capitalized date/time selection keybinds not working plausible/analytics#709
- Invisible text on Google Search Console settings page in dark mode plausible/analytics#759
- Disable analytics tracking when running Cypress tests
## [1.2] - 2021-01-26

@ -18,7 +18,7 @@
function trigger(eventName, options) {
if (/^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$/.test(location.hostname) || location.protocol === 'file:') return warn('localhost');
if (window.phantom || window._phantom || window.__nightmare || window.navigator.webdriver) return;
if (window.phantom || window._phantom || window.__nightmare || window.navigator.webdriver || window.Cypress) return;
if (plausible_ignore=="true") return warn('localStorage flag')
{{#if exclusionMode}}
if (excludedPaths)

Loading…
Cancel
Save