From 083abbeacd59744c2fd002ef18c2b55c703a3dda Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 18 Jun 2025 18:54:07 +0900 Subject: [PATCH] Fix inconsistent unhandledrejection behavior when polyfill is used --- common/js/common.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/js/common.js b/common/js/common.js index bf975f0d0..f5a7f4419 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -1111,6 +1111,15 @@ window.addEventListener('popstate', function(event) { } }); +// Fix for browsers that don't support the unhandledrejection event +if (typeof Promise._unhandledRejectionFn !== 'undefined') { + Promise._unhandledRejectionFn = function(error) { + if (error['_rx_ajax_error']) { + alert(error.message.trim()); + } + }; +} + /** * ================= * jQuery extensions