Ignore events from Google and Yandex bots

Signed-off-by: William Brawner <me@wbrawner.com>
This commit is contained in:
William Brawner 2020-09-11 06:53:26 -07:00
parent c22c7ef971
commit 378cc8c432

View file

@ -3,6 +3,11 @@
console.log('Flayre respects DNT');
return;
}
if (window.navigator.userAgent.indexOf('Googlebot') !== -1
|| window.navigator.userAgent.indexOf('YandexBot') !== -1) {
console.log('Ignoring events for bots');
return;
}
const flayreDomain = document.currentScript.src.split('/').slice(0, 3).join('/');
const app = document.currentScript.dataset.app;