Don't just call window.onunhandledrejection, fire a CustomEvent too
See original GitHub issueWould be nice to be able to use addEventListener
. It’s very jarring to have .on...
work but .addEventListener("...", fn)
fail.
Issue Analytics
- State:
- Created 9 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Window: unhandledrejection event - Web APIs | MDN
The unhandledrejection event is sent to the global scope of a script when a JavaScript Promise that has no rejection handler is rejected; ......
Read more >Dispatching custom events - The Modern JavaScript Tutorial
If an event handler calls methods that trigger other events – they are processed synchronously too, in a nested fashion. Let's say we...
Read more >CustomEvent in IE with window.opener - Stack Overflow
Trigger the event from the parent with jQuery ... I use hashchange event as a workaround since IE11 doesn't fire event to window.opener...
Read more >GTMTips: Use An All Events Trigger For More Control
In this article, we'll explore a cool use case for the trigger I call an All Events trigger. An All Events trigger is...
Read more >Custom Events in JavaScript - KIRUPA
Don't just use events that others have created. ... The first thing is to create our custom event by calling the CustomEvent constructor:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@domenic to be fair it’s stated very explicitly in the documentation. If it were up to me and not petka we wouldn’t fire either until you guys decide what you want to do at a spec level.
I’m yet to see a browser case where multiple libraries are present that are capable of reporting unhandled rejections - and for a single library you can do
Promise.onPossiblyUnhandledRejection(...)
Awesome, exactly what I was wondering.