Bug? Edge on iOS always throws error when a global error handler is attached.

Copper Contributor

When I have a global event handler attached to the main frame, Edge on iOS always seems to throw an error and the event.error object is always NULL. Is this by design?

 

<!doctype HTML>
<html>
<head>
  <title>Global error handler test</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
  <script type='text/javascript'>
    window.addEventListener('error', function(event) {
      alert(event.message + " - " + event.error);
    });
  </script>
</body>
</html>

 

When viewed in Edge iOS, this will always show an alert showing "Script error. -  null". If I intentionally throw an error after adding the handler, then I first get an alert for it with the expected message, but then I also get the generic null error message too.

1 Reply

@jbarile I have come across the exact same issue with Edge for iOS version 46.2.5.  When the global error handler is assigned, it throws null errors every time the app is touched.  This only happens with Edge iOS.  Chrome and Safari work as expected.  This is, IMO, a huge BUG.

 

However, when loading a page in an IFrame, the window.onerror works fine.  It's only in the main page, or top window that has this bug.