No chequear si existe navigator.userAgent
¡Existe desde IE 4!
This commit is contained in:
parent
9d2d811b10
commit
dd230c2fa1
1 changed files with 12 additions and 14 deletions
|
@ -1,11 +1,10 @@
|
||||||
import BotDetector from 'device-detector-js/dist/parsers/bot'
|
import BotDetector from 'device-detector-js/dist/parsers/bot'
|
||||||
import { Notifier } from '@airbrake/browser'
|
import { Notifier } from '@airbrake/browser'
|
||||||
|
|
||||||
if ('userAgent' in navigator) {
|
window.bot_detector = new BotDetector
|
||||||
window.bot_detector = new BotDetector
|
const bot = window.bot_detector.parse(navigator.userAgent)
|
||||||
const bot = window.bot_detector.parse(navigator.userAgent)
|
|
||||||
|
|
||||||
if (!bot) {
|
if (!bot) {
|
||||||
window.airbrake = new Notifier({
|
window.airbrake = new Notifier({
|
||||||
projectId: window.env.AIRBRAKE_PROJECT_ID,
|
projectId: window.env.AIRBRAKE_PROJECT_ID,
|
||||||
projectKey: window.env.AIRBRAKE_PROJECT_KEY,
|
projectKey: window.env.AIRBRAKE_PROJECT_KEY,
|
||||||
|
@ -17,7 +16,6 @@ if ('userAgent' in navigator) {
|
||||||
window.airbrake.notify(e.join(' '))
|
window.airbrake.notify(e.join(' '))
|
||||||
return console.originalError(...e)
|
return console.originalError(...e)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
import 'core-js/stable'
|
import 'core-js/stable'
|
||||||
|
|
Loading…
Reference in a new issue