Letaief Mohamed

Letaief Mohamed

  • NA
  • 11
  • 2.3k

How to show Angular project errors with a chrome extension

Mar 16 2020 2:39 PM
I want to handle angular errors and exceptions with chrome extension
 
Here my manifest.json
  1. {  
  2. /* declared name , version , etc... */  
  3. "background" : { "scripts" : ["background.js"] }  
  4. }  
I have tried in two ways but it doesn't alert errors .
 
Here my background.js
 
> Method 1
  1. window.onerror = function intercept (message, file, line, col, error) {  
  2. alert("Error occurred: " + message + " in file " + file + " at line " + line);  
  3. return false;  
  4. };   
> Method 2
  1. window.addEventListener('error'function(e) {  
  2. alert('handled uncaught error : ' , e); });  
I know that i can implement ErrorHandler class but i want to do this suff with chrome extension
 
Please how to achieve that

Answers (1)