No chequear si existe navigator.userAgent

¡Existe desde IE 4!
This commit is contained in:
Cat /dev/Nulo 2021-09-20 14:18:31 -03:00
parent 9d2d811b10
commit dd230c2fa1

View file

@ -1,22 +1,20 @@
import BotDetector from 'device-detector-js/dist/parsers/bot'
import { Notifier } from '@airbrake/browser'
if ('userAgent' in navigator) {
window.bot_detector = new BotDetector
const bot = window.bot_detector.parse(navigator.userAgent)
window.bot_detector = new BotDetector
const bot = window.bot_detector.parse(navigator.userAgent)
if (!bot) {
window.airbrake = new Notifier({
projectId: window.env.AIRBRAKE_PROJECT_ID,
projectKey: window.env.AIRBRAKE_PROJECT_KEY,
host: 'https://panel.sutty.nl'
})
if (!bot) {
window.airbrake = new Notifier({
projectId: window.env.AIRBRAKE_PROJECT_ID,
projectKey: window.env.AIRBRAKE_PROJECT_KEY,
host: 'https://panel.sutty.nl'
})
console.originalError = console.error
console.error = (...e) => {
window.airbrake.notify(e.join(' '))
return console.originalError(...e)
}
console.originalError = console.error
console.error = (...e) => {
window.airbrake.notify(e.join(' '))
return console.originalError(...e)
}
}