Basically, I have a content-script which runs on all webpages. I want to listen to the errors of these pages. So I wrote a code like this
window.addEventListener('error', function(e) {
console.log("error here")
});
But for some reason, I am unable to get the errors of that particular page I am on. Lets say I am on certain website X and if X throws an error, I am unable to capture them. Any Idea why this is happening. Please note, I am able to handle events like click.
Here is my manifest
{
"name": "xtension",
"version": "1.0.0",
"description": "extenstion",
"manifest_version": 3,
"author": "Abhi",
"action":{
"default_popup": "index.html",
"default_title": "xtension"
},
"content_scripts":[
{
"matches":[
"<all_urls>"
],
"js": ["content.js"]
}
]
}