Global javascript exception handler (in Chrome)

后端 未结 4 1851
暖寄归人
暖寄归人 2021-02-13 23:55

How do I overwrite the global Exception handler in javascript so that it becomes the top level handler for all uncaught exceptions?

EDIT: window.onerror didnt work, cod

4条回答
  •  清酒与你
    2021-02-14 00:32

    Chrome Support for window.onerror

    • I believe support started in Chrome v10 (Chromium Issue 7771), but it looks as if "full" support with CORS support was resolved around Chrome 30+ (Chromium Issue 159566)
    • caniuse.com doesn't currently track this JS feature (GitHub Issue 11999) ... to add support to this issue, login to GitHub & "react" with a "Thumbs Up" on the original post (don't +1 in comments.)

    Current Google Documentation for window.onerror

    • Chrome DevTools ~ Handle runtime exceptions using window.onerror

提交回复
热议问题