Ignore unactionable Sentry JS errors

This commit is contained in:
Son NK 2020-01-30 16:02:36 +07:00
parent aa8e95062c
commit c574824dbd

View file

@ -96,7 +96,34 @@
{% if SENTRY_DSN %}
console.log("Init sentry");
try {
Sentry.init({dsn: '{{SENTRY_DSN}}'});
Sentry.init({
dsn: '{{SENTRY_DSN}}',
// https://docs.sentry.io/platforms/javascript/#filter-events--custom-logic
// Original gist https://gist.github.com/impressiver/5092952
ignoreErrors: [
// Random plugins/extensions
'top.GLOBALS',
// See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error.html
'originalCreateNotification',
'canvas.contentDocument',
'MyApp_RemoveAllHighlights',
'http://tt.epicplay.com',
'Can\'t find variable: ZiteReader',
'jigsaw is not defined',
'ComboSearch is not defined',
'http://loading.retry.widdit.com/',
'atomicFindClose',
// Facebook borked
'fb_xd_fragment',
// ISP "optimizing" proxy - `Cache-Control: no-transform` seems to
// reduce this. (thanks @acdha)
// See http://stackoverflow.com/questions/4113268
'bmi_SafeAddOnload',
'EBCallBackMessageReceived',
// See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
'conduitPage'
]
});
} catch (error) {
console.log("Sentry error, probably due to AdBlocker ...")
}