Merge branch 'ignorar-bots' into 'master'

Ignorar reportes de error de bots

Closes sutty/sutty#2740

See merge request sutty/jekyll/sutty-base-jekyll-theme!17
This commit is contained in:
fauno 2021-09-27 23:55:47 +00:00
commit 4fdbe09338
3 changed files with 21 additions and 9 deletions

View file

@ -1,15 +1,21 @@
import BotDetector from 'device-detector-js/dist/parsers/bot'
import { Notifier } from '@airbrake/browser' import { Notifier } from '@airbrake/browser'
window.airbrake = new Notifier({ 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, projectId: window.env.AIRBRAKE_PROJECT_ID,
projectKey: window.env.AIRBRAKE_PROJECT_KEY, projectKey: window.env.AIRBRAKE_PROJECT_KEY,
host: 'https://panel.sutty.nl' host: 'https://panel.sutty.nl'
}) })
console.originalError = console.error console.originalError = console.error
console.error = (...e) => { console.error = (...e) => {
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'

View file

@ -16,6 +16,7 @@
"axe-core": "^4.1.2", "axe-core": "^4.1.2",
"babel-loader": "^8.1.0", "babel-loader": "^8.1.0",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"device-detector-js": "^2.2.10",
"dotenv-webpack": "^6.0.0", "dotenv-webpack": "^6.0.0",
"liquidjs": "^9.14.0", "liquidjs": "^9.14.0",
"regenerator-runtime": "^0.13.5", "regenerator-runtime": "^0.13.5",

View file

@ -2519,6 +2519,11 @@ detect-node@^2.0.4:
resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1" resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1"
integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==
device-detector-js@^2.2.10:
version "2.2.10"
resolved "https://registry.yarnpkg.com/device-detector-js/-/device-detector-js-2.2.10.tgz#a8fd47837ce89024d7647a4ddf18154d7a920538"
integrity sha512-zLcDSU10WIqbARXecaVJJxx0ZuGWq+MVhj9f9qehdBCFr9RMa5mQGTt2IZNIgKuCIind/j/DzRDViEdc2FfBGQ==
diffie-hellman@^5.0.0: diffie-hellman@^5.0.0:
version "5.0.3" version "5.0.3"
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875"