Monitoring iOS safari crash: This webpage was reloaded because a problem occurred

I have problem with mobile safari in my react application. When user clicks on the button X I run memory-heavy-3d-component (three.js-based) and safari crashes with This webpage was reloaded because a problem occurred.

I’d like to understand how can I track these crashes for both 1) understanding how big is the issue and 2) monitoring occurrences while I fix it.

I thought about “hacky” way:

  1. store timestamp into localstorage when user clicks the button X
  2. on every app load check stored timestamp and if it is within the 5-10(?) seconds range from now – assume the app was crashed and trigger NewRelic monitoring event.

But are there any more native ways to track those crashes?