Skip to content

Commit

Permalink
Refactor ignored browser errors list to merge better
Browse files Browse the repository at this point in the history
Add exclusion for crash coming from Chrome on Chromium OS
Add exclusion for #darkcss error presumably coming from a browser extension
Add exclusion for chrome://userjs error presumably coming from a browser extension
  • Loading branch information
Jimbly committed Feb 17, 2023
1 parent 2e23671 commit 38b71ef
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions src/glov/client/error_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,38 @@ export function glovErrorReportSetCrashCB(cb) {
}

// Errors from plugins that we don't want to get reported to us, or show the user!
// The exact phrase "Script error.\n at (0:0)" comes from our bootstap.js when we
// receive the message 'Script Error.' and no stack. This happens on the Mi Browser on Redmi phones
// and doesn't seem to be indicative of any actual problem.
// Ignoring null at null for similar reasons and because we get nothing useful from the reports.
// eslint-disable-next-line no-regex-spaces
let filtered_errors = /avast_submit|vc_request_action|^Error: Script error\.$|^Error: Script error\.\n at \(0:0\)$|^Error: null$|^Error: null\n at null\(null:null\)$|getElementsByTagName\('video'\)|document\.getElementById\("search"\)|change_ua|chrome-extension|setConnectedRobot|Failed to (?:start|stop) the audio device|zaloJSV2|getCookie is not defined|originalPrompt|_AutofillCallbackHandler|sytaxError|bannerNight|privateSpecialRepair|__gCrWeb|\$wrap is not/;
let filtered_errors = new RegExp([
// Generic error that shows up with no context, not useful, and probably coming from internal or extension scripts
'^Error: Script error\\.$',
// The exact phrase "Script error.\n at (0:0)" comes from our bootstap.js when we
// receive the message 'Script Error.' and no stack. This happens on the Mi Browser on Redmi phones
// and doesn't seem to be indicative of any actual problem.
'^Error: Script error\\.\n at \\(0:0\\)$',
'^Error: null$',
// Ignoring null at null for similar reasons and because we get nothing useful from the reports.
'^Error: null\n at null\\(null:null\\)$',
'avast_submit',
'vc_request_action',
'getElementsByTagName\\(\'video\'\\)',
'document\\.getElementById\\("search"\\)',
'change_ua',
'chrome-extension',
'setConnectedRobot',
'Failed to (?:start|stop) the audio device',
'zaloJSV2',
'getCookie is not defined',
'originalPrompt',
'_AutofillCallbackHandler',
'sytaxError',
'bannerNight',
'privateSpecialRepair',
'__gCrWeb',
'\\$wrap is not',
'wsWhitelisted',
'#darkcss',
'chrome://userjs',
].join('|'));

export function glovErrorReport(is_fatal, msg, file, line, col) {
console.error(msg);
if (on_crash_cb) {
Expand Down

0 comments on commit 38b71ef

Please sign in to comment.