我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译
您也可以阅读此文章的English (US)版。

The Window.onrejectionhandled property is an event handler for processing rejectionhandled events, which are raised when Promises are rejected.


window.addEventListener("rejectionhandled", function(event) { ... });
window.onrejectionhandled = function(event) { ...};


window.onrejectionhandled = function(e) {


Specification Status Comment
HTML Living Standard
The definition of 'onrejectionhandled' in that specification.
Living Standard Initial definition.

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 49 No support[1] No support No support No support
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support No support No support[1] No support No support No support

[1] Firefox implements the PromiseRejectionEvent interface if you go to about:config and set the dom.promise_rejection_events.enabled pref to true. However, Firefox doesn't yet actually send the unhandledrejection or understand rejectionhandled events.


 此页面的贡献者: Sheppy, chrisdavidmills, fscholz, rolfedh, jpmedley
 最后编辑者: Sheppy,