From dd230c2fa1446bbbe7083ab3d802fa89bafc0034 Mon Sep 17 00:00:00 2001 From: Nulo Date: Mon, 20 Sep 2021 14:18:31 -0300 Subject: [PATCH] No chequear si existe navigator.userAgent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ¡Existe desde IE 4! --- _packs/entry.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/_packs/entry.js b/_packs/entry.js index 237ef10..5a612e6 100644 --- a/_packs/entry.js +++ b/_packs/entry.js @@ -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) } }