-
-
Save avargas/9327ddba545cf4fe47c371bd4d154b73 to your computer and use it in GitHub Desktop.
window error ignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// filter out stupid error messags | |
(function () { | |
const prev = window.addEventListener; | |
const ignore = ['__gCrWeb.autofill.']; | |
window.addEventListener = function (a, b, c) { | |
if (a === 'error') { | |
return prev(a, function (err) { | |
// if error is matched to ignore list, ignore it then | |
if (err && err.message && ignore.filter(t => err.message.indexOf(t) > -1).length) { | |
return; | |
} else { | |
prev.apply(window, arguments); | |
} | |
}, c); | |
} | |
return prev.apply(window, arguments); | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment