We are currently logging all JavaScript errors. However, some errors seem to be browser internal (plugin, etc) related. Like this one:
Error: Error calling method on NPObject!
Line: 0
Script: http://www.lookr.com/lookout/1329030315-Giglio-Porto
How is it possible to ignore those browser internal, non-directly-website-related errors?
line 0
also seems not appropriate, since inline JavaScript errors would also be ignored (which is not desired)Thank you in advance for your suggestions.
Right-click anywhere in the webpage and then select Inspect. Or, press F12 . DevTools opens next to the webpage. In the top right of DevTools, the Open Console to view errors button displays an error about the webpage.
How to detect the user browser ( Safari, Chrome, IE, Firefox and Opera ) using JavaScript ? The browser on which the current page is opening can be checked using JavaScript. The userAgent property of the navigator object is used to return the user-agent header string sent by the browser.
In Chrome, navigate to View > Developer > JavaScript Console or More Tools > JavaScript Console or press Ctrl + Shift + J. The error console will open. If you don't see any errors try reloading the page. The error may be generated when the page loads.
This is the closest that you can get (onerror)
<html>
<body>
<script>
window.onerror = function(e) {
alert('Error');
console.log(e);
}
show('Error'); // show is not defined
</script>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With