I have a javascript code trying to reach for an image resource. sometimes the image exist and sometimes it doesnt (not on the domain, the domain doesnt exist and more).
<script>
var img = new Image();
img.src = 'http://notexistdomain1.com/myimage.png';
img.onerror = function () {
console.log('not found!');
};
img.onload = function (ev) {
console.log(':)', ev.status);
};
</script>
I would like to hide chrome errors from being displayed on console and network:
Using javascript. is that possible?